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