Plugin Directory

Changeset 8389

Timestamp:
03/17/2007 10:27:00 AM (19 years ago)
Author:
MattyRob
Message:

Updated ReadMe.txt files for WordPress plugin directory

Location:
subscribe2
Files:
2 added
8 deleted
1 edited

Legend:

Unmodified
Added
Removed
  • subscribe2/branches/WordPressMuand2.1/wp-content/plugins/subscribe2/subscribe2.php

    r8209 r8389  
    1010
    1111/*
    12 Copyright (C) 2006 Matthew Robinson
     12Copyright (C) 2006 Matthew Robinson
    1313Based on the Original Subscribe2 plugin by
    1414Copyright (C) 2005 Scott Merrill (skippy@skippy.net)
     
    3232// If you are on a host that limits the numner of recipients
    3333// permitted on each outgoing email message
    34 // change this value to your hosts limit
     34// change th to your hosts limit
    3535define('BCCLIMIT', '0');
    3636
    3737// by default, subscribe2 grabs the first page from your database for use
    3838// when displaying the confirmation screen to public subscribers.
    39 // You can override this by specifying a page ID below.
     39// You can override this by specifying a page ID below.
    4040define('S2PAGE', '0');
    4141
    42 // our version number. Don't touch.
     42// our version number. Don't touch this or any line below
     43// unless you know exacly what you are doing
    4344define('S2VERSION', '2.3.1');
    4445
     
    13271328                $scheds = (array) wp_get_schedules();
    13281329                $interval = ( isset($scheds[$email_freq]['interval']) ) ? (int) $scheds[$email_freq]['interval'] : 0;
    1329                 if ( !wp_next_scheduled('s2_digest_cron') && ($interval !== 0) ) {
    1330                     wp_schedule_event(time() + $interval, $email_freq, 's2_digest_cron');
     1330                if ($interval == 0) {
     1331                    // if we are on per-post emails remove last_cron entry
     1332                    unset($this->subscribe2_options['last_s2cron']);
     1333                } else {
     1334                    if (!wp_next_scheduled('s2_digest_cron')) {
     1335                        // if we are using digest schedule the event and prime last_cron as now
     1336                        wp_schedule_event(time() + $interval, $email_freq, 's2_digest_cron');
     1337                        $now = date('Y-m-d H:i:s', time());
     1338                        $this->subscribe2_options['last_s2cron'] = $now;
     1339                    }
    13311340                }
    13321341
     
    18781887        global $wpdb;
    18791888
    1880         if ( (defined('S2PAGE')) && (0 !== S2PAGE) ) {
     1889        if ( (defined('S2PAGE')) && (0 != S2PAGE) ) {
    18811890            return "page_id=" . S2PAGE;
    18821891        } else {
    1883             $id = $wpdb->get_var("SELECT ID FROM $wpdb->posts WHERE post_status='static' LIMIT 1");
     1892            $id = $wpdb->get_var("SELECT ID FROM $wpdb->posts WHERE post_' LIMIT 1");
    18841893            if ($id) {
    18851894                return "page_id=$id";
     
    19161925
    19171926        // collect posts
    1918         $scheds = (array) wp_get_schedules();
    1919         $email_freq = $this->subscribe2_options['email_freq'];
    1920         $interval = ( isset($scheds[$email_freq]['interval']) ) ? (int) $scheds[$email_freq]['interval'] : 0;
    19211927        $now = date('Y-m-d H:i:s', time());
    1922         $prev = date('Y-m-d H:i:s', time() - $interval);
    1923         $posts = $wpdb->get_results("SELECT ID, post_title, post_excerpt, post_content FROM $wpdb->posts WHERE post_date > '$prev' AND post_date < '$now' AND post_status='publish' AND post_type='post'");
    1924 
     1928        $prev = $this->subscribe2_options['last_s2cron'];
     1929        $posts = $wpdb->get_results("SELECT ID, post_title, post_excerpt, post_content FROM $wpdb->posts WHERE post_date >= '$prev' AND post_date < '$now' AND post_status='publish' AND post_type='post'");
     1930
     1931        // update last_s2cron execution time before completing or bailing
     1932        $this->subscribe2_options['last_s2cron'] = $now;
     1933        update_option('subscribe2_options', $this->subscribe2_options);
     1934   
    19251935        // do we have any posts?
    1926         if (!$posts) { return; }
     1936        if () { return; }
    19271937
    19281938        // if we have posts, let's prepare the digest
     
    19661976
    19671977        $author = get_userdata($post->post_author);
    1968         $this->authorname = $author->display_name;
    19691978       
    19701979        // do we send as admin, or post author?
     
    19781987        $this->myemail = $user->user_email;
    19791988        $this->myname = $user->display_name;
    1980        
    1981         $subject = '[' . stripslashes(get_settings('blogname')) . '] ' . __('Daily Digest', 'subscribe2') . ' ' . $yesterday;
     1989
     1990        $scheds = (array) wp_get_schedules();
     1991        $email_freq = $this->subscribe2_options['email_freq'];
     1992        $display = $scheds[$email_freq]['display'];
     1993        $subject = '[' . stripslashes(get_settings('blogname')) . '] ' . $display . ' ' . __('Digest Email', 'subscribe2');
    19821994        $public = $this->get_public();
    19831995        $registered = $this->get_registered();
     
    20302042            add_action('private_to_published', array(&$this, 'private2publish'));
    20312043        }
    2032        
     2044
    20332045        // load our strings
    20342046        $this->load_strings();
Note: See TracChangeset for help on using the changeset viewer.