Changeset 8389
- Timestamp:
- 03/17/2007 10:27:00 AM (19 years ago)
- Location:
- subscribe2
- Files:
-
- 2 added
- 8 deleted
- 1 edited
-
branches/WordPressMuand2.1/wp-content/plugins/subscribe2/subscribe2.php (modified) (8 diffs)
-
tags/2.2.1/wp-content/plugins/subscribe2/README.TXT (deleted)
-
tags/2.2.10/wp-content/plugins/subscribe2/ReadMe.txt (deleted)
-
tags/2.2.13/subscribe2/subscribe2.pot (added)
-
tags/2.2.2/wp-content/plugins/subscribe2/README.TXT (deleted)
-
tags/2.2.5/wp-content/plugins/ReadMe.txt (deleted)
-
tags/2.2.6/wp-content/plugins/ReadMe.txt (deleted)
-
tags/2.2.7/wp-content/plugins/ReadMe.txt (deleted)
-
tags/2.2.8/wp-content/plugins/ReadMe.txt (deleted)
-
tags/2.2.9/wp-content/plugins/subscribe2/ReadMe.txt (deleted)
-
trunk/ReadMe.txt (added)
Legend:
- Unmodified
- Added
- Removed
-
subscribe2/branches/WordPressMuand2.1/wp-content/plugins/subscribe2/subscribe2.php
r8209 r8389 10 10 11 11 /* 12 Copyright (C) 2006 Matthew Robinson12 Copyright (C) 2006 Matthew Robinson 13 13 Based on the Original Subscribe2 plugin by 14 14 Copyright (C) 2005 Scott Merrill (skippy@skippy.net) … … 32 32 // If you are on a host that limits the numner of recipients 33 33 // permitted on each outgoing email message 34 // change th is valueto your hosts limit34 // change th to your hosts limit 35 35 define('BCCLIMIT', '0'); 36 36 37 37 // by default, subscribe2 grabs the first page from your database for use 38 38 // 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. 40 40 define('S2PAGE', '0'); 41 41 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 43 44 define('S2VERSION', '2.3.1'); 44 45 … … 1327 1328 $scheds = (array) wp_get_schedules(); 1328 1329 $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 } 1331 1340 } 1332 1341 … … 1878 1887 global $wpdb; 1879 1888 1880 if ( (defined('S2PAGE')) && (0 != =S2PAGE) ) {1889 if ( (defined('S2PAGE')) && (0 != S2PAGE) ) { 1881 1890 return "page_id=" . S2PAGE; 1882 1891 } 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"); 1884 1893 if ($id) { 1885 1894 return "page_id=$id"; … … 1916 1925 1917 1926 // 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;1921 1927 $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 1925 1935 // do we have any posts? 1926 if ( !$posts) { return; }1936 if () { return; } 1927 1937 1928 1938 // if we have posts, let's prepare the digest … … 1966 1976 1967 1977 $author = get_userdata($post->post_author); 1968 $this->authorname = $author->display_name;1969 1978 1970 1979 // do we send as admin, or post author? … … 1978 1987 $this->myemail = $user->user_email; 1979 1988 $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'); 1982 1994 $public = $this->get_public(); 1983 1995 $registered = $this->get_registered(); … … 2030 2042 add_action('private_to_published', array(&$this, 'private2publish')); 2031 2043 } 2032 2044 2033 2045 // load our strings 2034 2046 $this->load_strings();
Note: See TracChangeset
for help on using the changeset viewer.