本文整理汇总了PHP中Versions::list_by_date_for_anchor方法的典型用法代码示例。如果您正苦于以下问题:PHP Versions::list_by_date_for_anchor方法的具体用法?PHP Versions::list_by_date_for_anchor怎么用?PHP Versions::list_by_date_for_anchor使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Versions
的用法示例。
在下文中一共展示了Versions::list_by_date_for_anchor方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: array
// total count of versions
$box['bar'] += array('_count' => sprintf(i18n::ns('%d version', '%d versions', $stats['count']), $stats['count']));
// navigation commands
$home = 'versions/list.php';
if ($context['with_friendly_urls'] == 'Y') {
$prefix = $home . '/' . str_replace(':', '/', $anchor->get_reference());
} elseif ($context['with_friendly_urls'] == 'R') {
$prefix = $home . '/' . str_replace(':', '/', $anchor->get_reference());
} else {
$prefix = $home . '?id=' . $anchor->get_reference() . '&page=';
}
$box['bar'] += Skin::navigate($home, $prefix, $stats['count'], VERSIONS_PER_PAGE, $page);
}
// query the database and layout that stuff
$offset = ($page - 1) * VERSIONS_PER_PAGE;
if ($items = Versions::list_by_date_for_anchor($anchor->get_reference(), $offset, VERSIONS_PER_PAGE, 'full')) {
// we have an array to format
if (@count($items)) {
$items = array_merge(array('_' => sprintf(i18n::s('edited by %s %s'), ucfirst($anchor->get_value('edit_name')), Skin::build_date($anchor->get_value('edit_date')))), $items);
$box['text'] .= Skin::build_list($items, 'decorated');
}
// layout everything in a box
if (count($box['bar'])) {
$box['text'] = Skin::build_list($box['bar'], 'menu_bar') . "\n" . $box['text'];
}
$text =& Skin::build_box($box['title'], $box['text']);
}
// cache this to speed subsequent queries
Cache::put($cache_id, $text, 'versions');
}
$context['text'] .= $text;