Exemple #1
0
 function process_autoblog()
 {
     global $wpdb;
     // Our starting time
     $timestart = current_time('timestamp');
     //Or processing limit
     $timelimit = AUTOBLOG_PROCESSING_TIMELIMIT;
     // max seconds for processing
     $lastprocessing = get_autoblog_option('autoblog_processing', strtotime('-1 week', current_time('timestamp')));
     if ($lastprocessing < strtotime('-' . AUTOBLOG_PROCESSING_CHECKLIMIT . ' minutes', current_time('timestamp'))) {
         update_autoblog_option('autoblog_processing', current_time('timestamp'));
         // grab the feeds
         $autoblogs = $this->get_autoblogentries(current_time('timestamp'));
         foreach ((array) $autoblogs as $key => $ablog) {
             if (current_time('timestamp') > $timestart + $timelimit) {
                 // time out
                 $this->msgs[] = __('<strong>Notice:</strong> Processing stopped due to ' . $timelimit . ' second timeout.', 'autoblogtext');
                 break;
             }
             $details = unserialize($ablog->feed_meta);
             $process = false;
             if (isset($details['processfeed']) && $details['processfeed'] > 0) {
                 $process = true;
             } else {
                 $process = false;
             }
             if ($process) {
                 do_action('autoblog_pre_process_feed', $ablog->feed_id, $details);
                 $this->process_feed($ablog->feed_id, $details);
                 do_action('autoblog_post_process_feed', $ablog->feed_id, $details);
             }
         }
     } else {
     }
     if (!empty($this->msgs)) {
         $this->record_msg();
     }
 }
Exemple #2
0
 function update_settings_page()
 {
     if (isset($_POST['action']) && $_POST['action'] == 'updatesettings') {
         check_admin_referer('update-autoblog-settings');
         if ($_POST['debugmode'] == 'yes') {
             update_autoblog_option('autoblog_debug', true);
         } else {
             delete_autoblog_option('autoblog_debug');
         }
         wp_safe_redirect(add_query_arg('msg', 1, wp_get_referer()));
     }
 }