Plugin Directory

Changeset 178396


Ignore:
Timestamp:
12/01/2009 12:41:53 PM (16 years ago)
Author:
davidjmillerorg
Message:

Fixed handling of most recent post time.

Location:
auto-schedule-posts
Files:
5 added
2 edited

Legend:

Unmodified
Added
Removed
  • auto-schedule-posts/trunk/auto-schedule-posts.php

    r152119 r178396  
    44Plugin URI: http://www.davidjmiller.org/auto-schedule-posts/
    55Description: Controls the flow of posts preventing posts from publishing too close together and managing the posts between multiple authors for maximum variety
    6 Version: 0.9
     6Version: 1.0
    77Author: David Miller
    88Author URI: http://www.davidjmiller.org/
     
    117117        if ($lp == '0' || $lp == '' || $options['method'] == 'min') {
    118118            $published = $wpdb->get_results("SELECT MAX(post_date_gmt) as pt from $wpdb->posts where $wpdb->posts.post_status = 'publish'");
    119             foreach ($published as $last)  $lp = $last->pt;
     119            foreach ($published as $last)  $lp = strtotime($last->pt);
    120120        }
    121121        if (time() < ($lp + $interval + $gmtoffset)) $attempt = 'false'; // not time yet
     
    190190    if (isset($_POST['update_options'])) {
    191191        // Fill up the options array as necessary
     192        $options['lpa'] = $_POST['lpa']; // maintain record of last post attempt when changing options.
    192193        $options['method'] = $_POST['method']; // 'set' times or 'min' gap
    193194        $options['interval'] = $_POST['interval'];
     
    234235        <h3><a href="http://www.davidjmiller.org/auto-schedule-posts/"><?php _e('Help and Instructions', 'auto_schedule_posts') ?></a></h3>
    235236        <h5><?php echo 'next ' . date('Y-m-d H:i',wp_next_scheduled('asp_pulse')) . ' ' . date('l') ?> </h5>
     237        <h5><?php echo 'option_lpa ' . strtotime($options['lpa']) . '<br/>';
     238            echo 'db_lp:';
     239            $published = $wpdb->get_results("SELECT MAX(post_date_gmt) as pt from $wpdb->posts where $wpdb->posts.post_status = 'publish'");
     240            foreach ($published as $last)  echo '<br/>' . $last->pt; ?>
     241        </h5>
    236242        <form method="post" action="">
    237243        <fieldset class="options">
     
    249255                <th scope="row" align="right"><?php _e('Interval', 'auto_schedule_posts') ?>:</th>
    250256                <td><input name="interval" type="text" id="interval" value="<?php echo $options['interval']; ?>" size="10" /> <?php _e('Enter a value in minutes', 'auto_schedule_posts') ?>
     257<input type="hidden" name="lpa" id="lpa" value="<?php echo $options['lpa']; ?>" />
    251258</td>
    252259            </tr>
  • auto-schedule-posts/trunk/readme.txt

    r152119 r178396  
    3737== Changelog ==
    3838
     39= 1.0 =
     40* After using this for quite some time I discovered one wrinkle to iron out - in version 0.9 the last published post time was not handled correctly so when updating options new posts could be published before the scheduled time. Now updating options will not open the gate for an extra post to be published.
    3941= 0.9 =
    40 * A virtually beta release - the posts are caught and scheduled, but I would like to add a feature such as onlly scheduling on the hour (as opposed to at least an hour apart).
     42* A virtually beta release - the posts are caught and scheduled, but I would like to add a feature such as only scheduling on the hour (as opposed to at least an hour apart).
Note: See TracChangeset for help on using the changeset viewer.