本文整理汇总了PHP中search::search_within_album方法的典型用法代码示例。如果您正苦于以下问题:PHP search::search_within_album方法的具体用法?PHP search::search_within_album怎么用?PHP search::search_within_album使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类search
的用法示例。
在下文中一共展示了search::search_within_album方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: get_siblings
static function get_siblings($q, $album, $limit, $offset)
{
if (!isset($limit)) {
$limit = 100;
}
if (!isset($offset)) {
$offset = 1;
}
$result = search::search_within_album(search::add_query_terms($q), $album, $limit, $offset);
return $result[1];
}
示例2: get_display_context
static function get_display_context($item, $album_id, $title, $query_terms, $q)
{
$album = ORM::factory("item", $album_id);
$position = search::get_position_within_album($item, $query_terms, $album);
if ($position > 1) {
list($count, $result_data) = search::search_within_album($query_terms, $album, 3, $position - 2);
list($previous_item, $ignore, $next_item) = $result_data;
} else {
$previous_item = null;
list($count, $result_data) = search::search_within_album($query_terms, $album, 1, $position);
list($next_item) = $result_data;
}
$search_url = url::abs_site("search" . "?q=" . urlencode($q) . "&album=" . urlencode($album_id) . "&show={$item->id}");
$root = item::root();
return array("position" => $position, "previous_item" => $previous_item, "next_item" => $next_item, "sibling_count" => $count, "breadcrumbs" => array(Breadcrumb::instance($root->title, "/", $root->id)->set_first(), Breadcrumb::instance(t("Search: %q", array("q" => $q)), $search_url), Breadcrumb::instance($item->title, $item->url())->set_last()));
}
示例3: search
static function search($q, $limit, $offset)
{
return search::search_within_album($q, item::root(), $limit, $offset);
}