prefix . 'post_notification_posts'; $t_cats = $wpdb->prefix . 'post_notification_cats'; $t_emails = $wpdb->prefix . 'post_notification_emails'; $datestr = get_settings('date_format') . ' ' . get_settings('time_format'); //Run the install require_once(POST_NOTIFICATION_PATH . 'install.php'); post_notification_install(); //Check for problems $mutex = @fopen(POST_NOTIFICATION_PATH . '_temp/post_notification.lock', 'w'); if($mutex == false){ echo '
' . __('Couldn\'t create File:', 'post_notification') . ' ' . POST_NOTIFICATION_PATH . '_temp/post_notification.lock
' /// \todo Typo: that the, not the the . __('Please assure the the path is writeable.', 'post_notification') . ' '. __('This is an error!', 'post_notification') . '
' ; } else { fclose($mutex); } if(!function_exists('iconv')){ echo '
' . __('PHP was compiled without iconv-libs. This might cause severe trouble using UTF-8 with special chars or umlauts.', 'post_notification'). ' ' . __('Most hosters support this, as it is a sensible php-extension.', 'post_notification') . ' ' . '' . __('More information.', 'post_notification') . '
'; } if(!function_exists('mb_detect_encoding')){ echo '
' . __('This version of PHP does not support the function mb_detect_encoding. You might experience some trouble with non-ASCII characters.', 'post_notification'). ' ' . __('Most hosters support this, as it is a sensible php-extension.', 'post_notification') . ' ' . '' . __('More information.', 'post_notification') . '
'; } if(!function_exists('html_entity_decode')){ echo '
' . __('This version of PHP does not support the function html_entity_decode. Sending out text mails will not be possible.', 'post_notification'). ' ' . __('Please contact your hoster.', 'post_notification') . '
'; } if('' != ($dest = post_notification_installtheme())){ echo '
' . __('Couldn\'t create File:', 'post_notification') . $dest . ' ' . __('Please assure the the path is writeable.', 'post_notification') . ' ' . __('You can also copy the file from the plugin directory manually.', 'post_notification') . '
'; } if(get_option('post_notification_debug') == 'yes'){ echo '
' . __('PN is in debugging mode. This should only be on, if something isn\'t working correctly.', 'post_notification') . '
'; } if(get_option('post_notification_uninstall') == 'yes'){ require_once(POST_NOTIFICATION_PATH . "install.php"); echo '
' . __('It seems like you want to uninstall this Plugin. Please deactivate it or change the setting the options. ', 'post_notification') . '
'; } else if($wpdb->get_var("SHOW TABLES LIKE '$t_cats'") == NULL){ echo '
' . __('It seems like there is some trouble creating the tables in the DB. If you\'re lucky there should be some errormessages on this page.', 'post_notification') . '
'; } if(ini_get('max_execution_time') != 0 && ini_get('max_execution_time') < 15){ echo '
' . __('The maximum executiontime is very low.', 'post_notification') . ' ' . '' . __('More information.', 'post_notification') . '
';; } if( (get_option('db_version') > 4772) && (get_option('db_version') < 6124) && (substr( get_option('post_notification_template'), -5) == '.html')){ echo '
' . __('There is a bug in WP handling HTML-Mails. Please make sure a mail-plugin is installed.', 'post_notification') . ' Wordpress 2.2 Mailfix
'; } //clean up - just in case. //Probably there's something with better performance, but as long there are not // 10 000 emails in the db this shouldn't matter. /* Not well enaugh tested -> Next version $wpdb->query(" DELETE $t_cats, t_emails FROM $t_cats LEFT JOIN t_emails WHERE email_addr IS NULL "); */ //Try to send. if(get_option('post_notification_debug') == 'yes'){ post_notification_send_check(true); } //------------ Some info..... $nummails = $wpdb->get_var("SELECT COUNT(*) FROM $t_emails WHERE gets_mail = 1"); echo '

'. __('Number of Subscribers:', 'post_notification') . " $nummails

"; //------------ Some advertising ---- if($nummails > 500){ echo '

' . __('Looks like you are realy using this plugin.', 'post_notification') . ' ' . __('What about a donation?.', 'post_notification') . '

'; } echo '

' . __('The time is:', 'post_notification'); echo ' ' . post_notification_date_i18n_tz($datestr, time()) . '

'; //Can use i18n_time as it uses date echo '

' . __('Posts to be notified.', 'post_notification'); $posts = $wpdb->get_results( "SELECT id, post_title, post_date_gmt, notification_sent, post_status, date_saved " . post_notification_sql_posts_to_send(true) . " ORDER BY post_date_gmt DESC"); echo ''; if (empty ($posts)) { echo ''; } else { foreach($posts as $post){ echo ''; } } echo '
' . __('Post-ID', 'post_notification') . '' . __('Post title', 'post_notification') . '' . __('Publish-date', 'post_notification') . '' . __('Save-date', 'post_notification') . '' . __('Last email-id', 'post_notification') . '
' . __('None queued', 'post_notification') . '
' . $post->id . '' . $post->post_title . '' . post_notification_date_i18n_tz($datestr, post_notification_mysql2gmdate($post->post_date_gmt)) . '' . post_notification_date_i18n_tz($datestr, post_notification_mysql2gmdate($post->date_saved)) . '' . $post->notification_sent . '

'; echo '

' . __('The next mail will be sent:', 'post_notification') . ' '; if(get_option('post_notification_nextsend') == '-1'){ _e('None queued', 'post_notification'); } else { echo post_notification_date_i18n_tz($datestr, get_option('post_notification_nextsend')); } echo '

'; echo '

' . __('The last mail was sent:', 'post_notification') . ' '; echo post_notification_date_i18n_tz($datestr, get_option('post_notification_lastsend')); echo '

'; echo '

' . __('The last post was saved:', 'post_notification') . ' '; echo post_notification_date_i18n_tz($datestr, get_option('post_notification_lastpost')); echo '

'; } ?>