Plugin Directory

Changeset 830637


Ignore:
Timestamp:
12/31/2013 05:18:58 AM (12 years ago)
Author:
markthomes
Message:

Bug fixes and minor enhancements. Fixed a bug that caused errors with different table prefixes. Fixed a bug that clears up header warnings caused by a session_start

File:
1 edited

Legend:

Unmodified
Added
Removed
  • dishsoap/trunk/dishsoap.php

    r648851 r830637  
    55Plugin URI: http://withan.es/dishsoap
    66Description: Cleanup those old posts with DishSoap. DishSoap is an post unpublishing plugin for those that want to automatically unpublish or unsticky a post on a specified date and time.
    7 Version: 1.0
     7Version: 1.1
    88Author: Mark Thomes (with an Es)
    99Author URI: http://withan.es/dishsoap
     
    2020$dishsoap_debug = false;
    2121
    22 // CHOOSE to display DISHSOAP COLORS
    23 $dishsoap_color = false;
     22// TARGET different Post Type
     23$ds_post_type = "post"; // LEAVE blank "" if you want it to apply to all post_types
     24// WARNING -- Changing this after expirations have
     25//            already been set for a post will that
     26//            expiraton will no longer be editable.
    2427
    2528
     
    8588function dishsoap_add_meta_boxes() {
    8689
    87   // STYLE the dishsoap meta_box
    88   global $dishsoap_color;
    89   $dishsoap_id = 'dishsoap-meta';
    90   if(!$dishsoap_color) {
    91     $dishsoap_id = 'dishsoap-meta-style';
    92   }
     90  global $ds_post_type;
    9391
    9492  add_meta_box(
    95     "$dishsoap_id",
    96     esc_html__( 'Dishsoap', 'example' ),
    97     'dishsoap_meta_meta_box',
    98     'post',
     93    'dishsoap-meta',
     94    esc_html__( 'Dishsoap', 'dishsoap' ),
     95    'dishsoap_meta_box',
     96    "$ds_post_type",
    9997    'side',
    10098    'default'
     
    133131////////////////////////////
    134132
    135 function dishsoap_meta_meta_box( $object, $box ) {
     133function dishsoap_meta_box( $object, $box ) {
    136134
    137135  // SET timezone
     
    143141
    144142  // SESSION START (used to display errors and maintain form)
    145   session_start();
     143  @session_start();
    146144
    147145  wp_nonce_field( basename( __FILE__ ), 'dishsoap_meta_nonce' ); ?>
    148146
    149147  <p>
    150     <label for="dishsoap-meta" class="ds_calendar">Unpublush post on specified date and time</label>
     148    Unpublish post on...
    151149   
    152150    <?php
     
    259257        >
    260258        <br>
    261         <label for="ds_option">Option:
     259        <label for="ds_option" id="ds_option_select">Option:
    262260          <select id="ds_option" name="dishsoap-meta-option" tabindex="4">
    263261            <?php
     
    301299      <?php } ?>
    302300  </p>
    303 <?php } // <-- END dishsoap_meta_meta_box
     301<?php } // <-- END dishsoap_meta_box
    304302
    305303
     
    317315
    318316  // Start SESSION for validation ERRORS
    319   session_start();
     317  @session_start();
    320318
    321319  // CHECK origin of post data
     
    423421
    424422  // QUERY wp_postmeta
    425   $query = "SELECT * FROM wp_postmeta WHERE (meta_key='dishsoap_meta' AND SUBSTRING_INDEX(meta_value,':',1) <= $tnow AND SUBSTRING(meta_value,-1) = 0) OR (meta_key='dishsoap_meta' AND SUBSTRING_INDEX(meta_value,':',1) <= $tnow AND SUBSTRING(meta_value,-1) = 2)";
     423  $query = "SELECT * FROM $wpdb->postmeta WHERE (meta_key='dishsoap_meta' AND SUBSTRING_INDEX(meta_value,':',1) <= $tnow AND SUBSTRING(meta_value,-1) = 0) OR (meta_key='dishsoap_meta' AND SUBSTRING_INDEX(meta_value,':',1) <= $tnow AND SUBSTRING(meta_value,-1) = 2)";
    426424
    427425  // LOOP through results
Note: See TracChangeset for help on using the changeset viewer.