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


PHP ca_occurrences::getMostViewedItems方法代码示例

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


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

示例1: Index

 public function Index()
 {
     $t_occurrence = new ca_occurrences();
     if ($this->request->config->get("dont_enforce_access_settings")) {
         $va_access_values = array();
     } else {
         $va_access_values = caGetUserAccessValues($this->request);
     }
     # --- get the most viewed occ records
     $va_occ_info = array();
     $va_most_viewed_occs = $t_occurrence->getMostViewedItems(3, array('checkAccess' => $va_access_values));
     foreach ($va_most_viewed_occs as $vn_occurrence_id => $va_occ_info) {
         $t_occurrence->load($vn_occurrence_id);
         $va_occ_info['title'] = $t_occurrence->getLabelForDisplay();
         $va_preview_stills = $t_occurrence->get('ca_occurrences.ic_stills.ic_stills_media', array('version' => "widepreview", "showMediaInfo" => false, "returnAsArray" => true));
         if (sizeof($va_preview_stills) > 0) {
             $va_occ_info["mediaPreview"] = array_shift($va_preview_stills);
         }
         $va_medium_stills = $t_occurrence->get('ca_occurrences.ic_stills.ic_stills_media', array('version' => "medium", "showMediaInfo" => false, "returnAsArray" => true));
         if (sizeof($va_medium_stills) > 0) {
             $va_occ_info["mediaMedium"] = array_shift($va_medium_stills);
         }
         $va_occ_info["repository"] = $t_occurrence->get("CLIR2_institution", array('convertCodesToDisplayText' => true));
         $va_most_viewed_occs[$vn_occurrence_id] = $va_occ_info;
     }
     $this->view->setVar('most_viewed_occs', $va_most_viewed_occs);
     $this->render('Engage/engage_index_html.php');
 }
开发者ID:guaykuru,项目名称:pawtucket,代码行数:28,代码来源:EngageController.php


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