当前位置: 首页>>代码示例>>PHP>>正文


PHP RSSFeed::UpdateFeeds方法代码示例

本文整理汇总了PHP中RSSFeed::UpdateFeeds方法的典型用法代码示例。如果您正苦于以下问题:PHP RSSFeed::UpdateFeeds方法的具体用法?PHP RSSFeed::UpdateFeeds怎么用?PHP RSSFeed::UpdateFeeds使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在RSSFeed的用法示例。


在下文中一共展示了RSSFeed::UpdateFeeds方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: Run

    /**
     * Run - called by outside cron
     */
    public static function Run()
    {
        // add here your code...
        // Class::Method();
        $perform_actions = false;
        // update last time running
        $sql = 'SELECT
					cron_type,
					cron_run_last_time,
					cron_run_period,
					cron_run_period_value,
					CASE
						WHEN cron_run_last_time = \'0000-00-00 00:00:00\' THEN \'999\'
						WHEN cron_run_period = \'minute\' THEN TIMESTAMPDIFF(MINUTE, cron_run_last_time, \'' . date('Y-m-d H:i:s') . '\')
						ELSE TIMESTAMPDIFF(HOUR, cron_run_last_time, \'' . date('Y-m-d H:i:s') . '\')
					END as time_diff										
				FROM ' . TABLE_SETTINGS;
        $result = database_query($sql, DATA_ONLY, FIRST_ROW_ONLY);
        if ($result['cron_type'] == 'batch') {
            $perform_actions = true;
        } else {
            if ($result['cron_type'] == 'non-batch' && $result['time_diff'] > $result['cron_run_period_value']) {
                $perform_actions = true;
            } else {
                $perform_actions = false;
            }
        }
        if ($perform_actions) {
            // update Feeds
            RSSFeed::UpdateFeeds();
            if (self::$PROJECT == 'ShoppingCart') {
                // close expired discount campaigns
                Campaigns::UpdateStatus();
                // remove expired orders
                Orders::RemoveExpired();
            } else {
                if (self::$PROJECT == 'HotelSite') {
                    // close expired discount campaigns
                    Campaigns::UpdateStatus();
                    // close expired coupons
                    Coupons::UpdateStatus();
                    // remove expired 'Preparing' bookings
                    Bookings::RemoveExpired();
                } else {
                    if (self::$PROJECT == 'BusinnessDirectory') {
                        // close expired lisitngs
                        Listings::UpdateStatus();
                        // remove old inquiries
                        Inquiries::RemoveOld();
                    } else {
                        if (self::$PROJECT == 'MedicalAppointment') {
                            // remove expired appointments
                            Appointments::RemoveExpired();
                            // send reminders for patient and doctor
                            Appointments::SendReminders();
                        } else {
                            if (self::$PROJECT == 'MicroBlog') {
                                // close expired polls
                                Pools::UpdateStatus();
                            }
                        }
                    }
                }
            }
            // update last time running
            $sql = 'UPDATE ' . TABLE_SETTINGS . ' SET cron_run_last_time = \'' . date('Y-m-d H:i:s') . '\'';
            database_void_query($sql);
        }
    }
开发者ID:mozdial,项目名称:Directory,代码行数:72,代码来源:Cron.class.php

示例2: array

                                        $params_ranks = array();
                                        $params_ranks['alexa_rank'] = number_format((double) $objSettings->CheckAlexaRank($http_host));
                                        $params_ranks['google_rank'] = (int) $objSettings->CheckGoogleRank($http_host);
                                        if ($objSettings->UpdateFields($params_ranks) == true) {
                                            $msg = draw_success_message(_CHANGES_WERE_SAVED, false);
                                        } else {
                                            $msg = draw_important_message($objSettings->error, false);
                                        }
                                    } else {
                                        if ($submition_type == 'cron_settings') {
                                            if ($objSettings->UpdateFields($params_cron) == true) {
                                                $msg = draw_success_message(_CHANGES_WERE_SAVED, false);
                                            } else {
                                                $msg = draw_important_message($objSettings->error, false);
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
    $template = $objSettings->GetTemplate();
    if (strtolower(SITE_MODE) != 'demo' && $submition_type == 'general' || $submition_type == 'visual_settings' || $submition_type == 'meta_tags') {
        $objSiteDescription->LoadData();
        RSSFeed::UpdateFeeds();
    }
}
开发者ID:mozdial,项目名称:Directory,代码行数:31,代码来源:handler_settings.php

示例3: defined

// *** Make sure the file isn't accessed directly
defined('APPHP_EXEC') or die('Restricted Access');
//--------------------------------------------------------------------------
if ($objLogin->IsLoggedInAsAdmin() && Modules::IsModuleInstalled('news')) {
    $action = MicroGrid::GetParameter('action');
    $rid = MicroGrid::GetParameter('rid');
    $mode = 'view';
    $msg = '';
    $objNews = News::Instance();
    if ($action == 'add') {
        $mode = 'add';
    } else {
        if ($action == 'create') {
            if ($objNews->AddRecord()) {
                if (ModulesSettings::Get('news', 'news_rss') == 'yes') {
                    $rss_result = RSSFeed::UpdateFeeds();
                }
                $msg .= draw_success_message(_ADDING_OPERATION_COMPLETED, false);
                if (!empty($rss_result)) {
                    $msg .= draw_important_message($rss_result, false);
                }
                $mode = 'view';
            } else {
                $msg = draw_important_message($objNews->error, false);
                $mode = 'add';
            }
        } else {
            if ($action == 'edit') {
                $mode = 'edit';
            } else {
                if ($action == 'update') {
开发者ID:mozdial,项目名称:Directory,代码行数:31,代码来源:mod_news_management.php


注:本文中的RSSFeed::UpdateFeeds方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。