本文整理匯總了PHP中item::viewable方法的典型用法代碼示例。如果您正苦於以下問題:PHP item::viewable方法的具體用法?PHP item::viewable怎麽用?PHP item::viewable使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類item
的用法示例。
在下文中一共展示了item::viewable方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: viewable
/**
* Add a set of restrictions to any following queries to restrict access only to items
* viewable by the active user.
* @chainable
*/
public function viewable()
{
$this->join("items", "items.id", "comments.item_id");
return item::viewable($this);
}
示例2: viewable
/**
* Add a set of restrictions to any following queries to restrict access only to items
* viewable by the active user.
* @chainable
*/
public function viewable()
{
return item::viewable($this);
}
示例3: get_thumb_link
public function get_thumb_link($item)
{
if ($item->is_album()) {
return "";
}
if (item::viewable($item)) {
if (access::can("view_full", $item)) {
$direct_link = $item->file_url();
} else {
$direct_link = $item->resize_url();
}
return '<a title="' . $this->get_item_title($item) . '" style="display: none;" class="g-sb-preview" rel="g-preview" href="' . $direct_link . '"> </a>';
} else {
return "";
}
}