本文整理汇总了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');
}