本文整理汇总了PHP中Item::id方法的典型用法代码示例。如果您正苦于以下问题:PHP Item::id方法的具体用法?PHP Item::id怎么用?PHP Item::id使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Item
的用法示例。
在下文中一共展示了Item::id方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: ItemRelate
function ItemRelate($row)
{
Module::Module($row);
if (Item::$id == -1) {
Item::$id = (int) Url::get('id', 0);
Item::$item = Item::get_item(Item::$id);
}
AZLib::checkItem();
if (Item::$item) {
if (Item::$item['display']) {
require_once 'forms/ItemRelate.php';
$this->add_form(new ItemRelateForm());
}
}
}
示例2: ItemDetail
function ItemDetail($row)
{
Module::Module($row);
require_once 'core/se.php';
if (Item::$id == -1) {
Item::$id = (int) Url::get('id', 0);
Item::$item = Item::get_item(Item::$id);
}
AZLib::checkItem();
if (Item::$item) {
if (Item::$item['display']) {
if (REWRITE_ON) {
//tuannk add 2010.07.28 fix redirect 301 với các url link sai
$nice_name1 = '';
if (Item::$item['category_id'] && isset(CGlobal::$allCategories[Item::$item['category_id']]) && CGlobal::$allCategories[Item::$item['category_id']]) {
$nice_name1 = CGlobal::$allCategories[Item::$item['category_id']]['nice_name'];
}
$url_detail = WEB_DIR . $nice_name1 . "/p" . Item::$item['id'] . "/" . AZLib::safe_title(Item::$item['name']) . ".html";
if ($nice_name1 != '' && strpos($_SERVER['REQUEST_URI'], $url_detail) !== 0) {
Url::redirect_url($url_detail, 301);
}
}
CGlobal::$website_title = Item::$item['name'];
CGlobal::$website_title .= ' - ' . AZLib::titlePath(Item::$item['category_id']);
if (Item::$item['status'] == 2) {
if (User::have_permit(ADMIN_ITEM)) {
CGlobal::$website_title = 'Tin đang ẩn';
} else {
Item::$item['display'] = 0;
}
}
Item::update_read_count();
}
}
require_once 'forms/ItemDetail.php';
$this->add_form(new ItemDetailForm());
}
示例3:
function display_feedback_thoitrang()
{
global $display;
$show_all = Url::get('show_all', 1);
Item::$id = (int) Url::get('id', 0);
Item::$item = Item::get_item(Item::$id);
/* if($show_all)
{*/
$this->get_all_comment_thoitrang();
/* }
else{
if(StaticCache::notExistCache('fb_'.Item::$id,0)){
StaticCache::startCache();
$this->get_all_comment_thoitrang();
StaticCache::endCache();
}
}*/
}
示例4: foreach
function __construct($row)
{
Module::Module($row);
require_once 'forms/header.php';
if (AZNet::$page['name'] == 'zone') {
$zone_id = (int) Url::get("zone_id");
if (!$zone_id || $zone_id && !isset(CGlobal::$allZones[$zone_id])) {
//Url::access_denied();
Url::redirect('home');
}
}
if (AZNet::$page['name'] == 'item_detail') {
$item_id = (int) Url::get('id', 0);
if (Item::$id == -1) {
Item::$id = $item_id;
Item::$item = Item::get_item($item_id);
AZLib::checkItem();
if (Item::$item && Item::$item['display']) {
CGlobal::$curCategory = Item::$item['category_id'];
}
}
}
$curCategory = false;
if (CGlobal::$curCategory && isset(CGlobal::$allCategories[CGlobal::$curCategory])) {
$curCategory = CGlobal::$allCategories[CGlobal::$curCategory];
}
$str_keywords = '';
$str_catSub = '';
$meta_desc = '';
if ($curCategory) {
if ($curCategory['parent_id'] && isset(CGlobal::$allCategories[$curCategory['parent_id']])) {
$parent_cat = CGlobal::$allCategories[$curCategory['parent_id']];
CGlobal::$curMainCat = CGlobal::$allCategories[$curCategory['parent_id']];
CGlobal::$curLevel2Cat = $curCategory;
} else {
CGlobal::$curMainCat = $curCategory;
}
}
if (CGlobal::$curMainCat && isset(CGlobal::$curMainCat['zones'])) {
foreach (CGlobal::$curMainCat['zones'] as $zid) {
if ($zid && isset(CGlobal::$allZones[$zid])) {
CGlobal::$curZone = CGlobal::$allZones[$zid];
if (CGlobal::$curMainCat['id'] != 100) {
break;
}
}
}
}
if (!CGlobal::$curZone) {
$zid = (int) Url::get("zone_id", 0);
if ($zid && isset(CGlobal::$allZones[$zid])) {
CGlobal::$curZone = CGlobal::$allZones[$zid];
}
}
if (AZNet::$page['name'] == 'zone') {
if (REWRITE_ON) {
//tuannk add 2010.07.28 fix redirect 301 với các url link sai
$ebname = CGlobal::$curZone['ebname'];
$eburl = WEB_DIR . "z" . CGlobal::$curZone['id'] . "/{$ebname}.html";
if ($ebname != '' && strpos($_SERVER['REQUEST_URI'], $eburl) !== 0) {
Url::redirect_url($eburl, 301);
}
}
##########################################
#For SEO
if (isset(CGlobal::$curZone['cats'])) {
foreach (CGlobal::$curZone['cats'] as $catid) {
if (isset(CGlobal::$allCategories[$catid])) {
$str_catSub .= ($str_catSub ? ', ' : '') . CGlobal::$allCategories[$catid]['name'];
if (CGlobal::$allCategories[$catid]['keywords']) {
$str_keywords .= ($str_keywords ? ', ' : '') . CGlobal::$allCategories[$catid]['keywords'];
}
if (CGlobal::$allCategories[$catid]['description']) {
$meta_desc .= ($meta_desc ? ', ' : '') . CGlobal::$allCategories[$catid]['description'];
}
}
}
}
if (!$str_keywords) {
if ($str_catSub) {
$str_keywords = $str_catSub;
} else {
$str_keywords = CGlobal::$curZone['name'];
}
}
if (!$meta_desc) {
if ($str_catSub) {
$meta_desc = $str_catSub;
} else {
$meta_desc = CGlobal::$curZone['name'];
}
}
CGlobal::$keywords = $str_keywords;
CGlobal::$meta_desc = $meta_desc;
CGlobal::$website_title = CGlobal::$curZone['name'];
#For SEO
##########################################
} else {
$catid = CGlobal::$curCategory;
if (isset(CGlobal::$allCategories[$catid]) && CGlobal::$allCategories[$catid]['ref_id']) {
//.........这里部分代码省略.........
示例5: idsByItem
/**
* This method provides access to a list of IDs for flows associated with
* certain item.
*
* @param \TooBasic\Workflows\Item $item Associated item.
* @return int[] Returns a list of IDs.
*/
public function idsByItem(Item $item)
{
//
// Default values.
$out = array();
//
// Enforcing basic prefixes to be loaded.
$this->queryAdapterPrefixes();
//
// Creating a query to retieve associated flows.
$query = $this->_db->queryAdapter()->select('wkfl_item_flows', array('type' => $item->type(), 'item' => $item->id()), $this->_queryAdapterPrefixes);
$stmt = $this->_db->prepare($query[GC_AFIELD_QUERY]);
//
// Retrieving...
$stmt->execute($query[GC_AFIELD_PARAMS]);
//
// Genearating a list.
foreach ($stmt->fetchAll() as $row) {
$idx = "{$this->_CP_ColumnsPerfix}id";
$out[] = $row[$idx];
}
return $out;
}
示例6: link
function link(Item $item)
{
return $this->view_helper->anchor_tag($item->title(), 'item.php?id=' . $item->id(), 'blank', array('class' => 'item_link'));
}
示例7:
function display_feedback()
{
global $display;
$show_all = Url::get('show_all', 0);
Item::$id = (int) Url::get('id', 0);
Item::$item = Item::get_item(Item::$id);
if (Item::$item) {
if (!isset(Item::$item['display'])) {
Item::$item['display'] = 1;
if (isset(Item::$item['id'])) {
//Check trạng thái tin và quyền thao tác:
if (Item::$item['status'] != 1) {
//Tin không được kiểm duyệt
//Nếu tin chưa được kiểm duyệt ,chỉ admin hoặc chủ tin được xem!
if (Item::$item['status'] == 2) {
if (User::id() != Item::$item['user_id'] && !User::have_permit(ADMIN_ITEM) && !User::have_cat_permit(Item::$item['category_id'])) {
Item::$item['display'] = 0;
}
} else {
//Nếu tin ở trạng thái xóa
if (Item::$item['status'] == -1) {
if (!User::have_permit(ADMIN_ITEM)) {
Item::$item['display'] = 0;
//Url::access_denied();
}
}
}
//Nếu tin bị ẩn ,chỉ admin được xem!
if (Item::$item['status'] == 0) {
if (!User::is_admin()) {
Item::$item['display'] = 0;
//Url::access_denied();
}
}
}
}
}
if (Item::$item['display']) {
if ($show_all) {
$this->get_all_comment();
} else {
if (StaticCache::notExistCache('fb_' . Item::$id, 0)) {
StaticCache::startCache();
$this->get_all_comment();
StaticCache::endCache();
}
}
}
}
}