本文整理汇总了PHP中Versions::list_selected方法的典型用法代码示例。如果您正苦于以下问题:PHP Versions::list_selected方法的具体用法?PHP Versions::list_selected怎么用?PHP Versions::list_selected使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Versions
的用法示例。
在下文中一共展示了Versions::list_selected方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: list_by_date_for_anchor
/**
* list most recent versions for one anchor
*
* @param string the target anchor
* @param int the offset from the start of the list; usually, 0 or 1
* @param int the number of items to display
* @param string the list variant, if any
* @return NULL on error, else an ordered array with $url => ($prefix, $label, $suffix, $icon)
*
* @see versions/list.php
*/
public static function list_by_date_for_anchor($anchor, $offset = 0, $count = 10, $variant = NULL)
{
global $context;
// locate where we are
if (!isset($variant)) {
$variant = $anchor;
}
// the list of versions
$query = "SELECT * FROM " . SQL::table_name('versions') . " AS versions" . " WHERE (anchor LIKE '" . SQL::escape($anchor) . "')" . " ORDER BY versions.edit_date DESC LIMIT " . $offset . ',' . $count;
$output = Versions::list_selected(SQL::query($query), $variant);
return $output;
}