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


PHP c2cTools::convertC2cActivityIdsToMetaIds方法代码示例

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


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

示例1: executeHome

 /**
  * Executes the actions to display the Home Page
  */
 public function executeHome()
 {
     $timer = new sfTimer('executeHome');
     $mobile_version = c2cTools::mobileVersion();
     // user filters:
     $perso = c2cPersonalization::getInstance();
     if ($perso->isMainFilterSwitchOn()) {
         $langs = $perso->getLanguagesFilter();
         $ranges = $perso->getPlacesFilter();
         $activities = $perso->getActivitiesFilter();
     } else {
         $langs = $ranges = $activities = array();
     }
     // some of the latest documents published on the site
     $latest_outings = Outing::listLatest($mobile_version ? sfConfig::get('app_recent_documents_outings_mobile_limit') : sfConfig::get('app_recent_documents_outings_limit'), $langs, $ranges, $activities);
     // choose best language for outings and regions names
     $latest_outings = Language::getTheBest($latest_outings, 'Outing');
     $this->latest_outings = Language::getTheBestForAssociatedAreas($latest_outings);
     $this->latest_articles = Article::listLatest($mobile_version ? sfConfig::get('app_recent_documents_articles_mobile_limit') : sfConfig::get('app_recent_documents_articles_limit'), $langs, $activities);
     $latest_images = Image::listLatest($mobile_version ? sfConfig::get('app_recent_documents_images_mobile_limit') : sfConfig::get('app_recent_documents_images_limit'), $langs, $ranges, $activities);
     $this->latest_images = Language::getTheBest($latest_images, 'Image');
     // outings from metaengine:
     $region_ids = c2cTools::convertC2cRangeIdsToMetaIds($ranges);
     $activity_ids = c2cTools::convertC2cActivityIdsToMetaIds($activities);
     $this->meta_feed_url = str_replace('http:', '', sfConfig::get('app_meta_engine_base_url')) . 'outings?system_id=2,3,4' . '&orderby=outing_date' . '&outing_lang=' . implode(',', $langs) . '&activity_ids=' . implode(',', $activity_ids) . '&region_id=' . implode(',', $region_ids);
     // forum 'mountain news' latest active threads
     $news_filter_ids = PunbbTopics::getForumIds('app_forum_mountain_news', $langs, $activities);
     $this->latest_mountain_news = PunbbTopics::listLatestById($mobile_version ? sfConfig::get('app_recent_documents_mountain_news_mobile_limit') : sfConfig::get('app_recent_documents_mountain_news_limit'), $news_filter_ids);
     $this->news_filter_ids = implode('-', $news_filter_ids);
     // forum latest active threads
     $forum_filter_ids = PunbbTopics::getForumIds('app_forum_public_ids', $langs, $activities);
     $this->latest_threads = PunbbTopics::listLatestById($mobile_version ? sfConfig::get('app_recent_documents_threads_mobile_limit') : sfConfig::get('app_recent_documents_threads_limit'), $forum_filter_ids);
     $this->forum_filter_ids = implode('-', array_merge($news_filter_ids, $forum_filter_ids));
     // Custom welcome message:
     $prefered_langs = $this->getUser()->getCulturesForDocuments();
     $this->message = Message::find($prefered_langs[0]);
     if (!$mobile_version) {
         // c2c news
         $this->latest_c2c_news = PunbbTopics::listLatestC2cNews(sfConfig::get('app_recent_documents_c2c_news_limit'), $langs);
         $this->figures = sfConfig::get('app_figures_list');
     }
     // mobile version
     $this->getResponse()->addMeta('robots', 'index, follow');
     c2cActions::statsdTiming('document.executeHome', $timer->getElapsedTime('executeHome'));
 }
开发者ID:snouhaud,项目名称:camptocamp.org,代码行数:48,代码来源:actions.class.php


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