当前位置: 首页>>代码示例>>PHP>>正文


PHP CGlobal::curCategory方法代码示例

本文整理汇总了PHP中CGlobal::curCategory方法的典型用法代码示例。如果您正苦于以下问题:PHP CGlobal::curCategory方法的具体用法?PHP CGlobal::curCategory怎么用?PHP CGlobal::curCategory使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CGlobal的用法示例。


在下文中一共展示了CGlobal::curCategory方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: ItemDetailForm

 function ItemDetailForm()
 {
     if (Item::$item['display']) {
         $this->user_info = User::getUser(Item::$item['user_id']);
         if (Item::$item['have_image']) {
             Item::$item['images'] = Item::get_item_images(Item::$item['id']);
             //Item::$item['max_path']	= AZLib::getImageThumbMax(Item::$item['img_url'],'',1,Item::$item['img_server']);
         } else {
             Item::$item['images'] = array();
         }
         CGlobal::$curCategory = Item::$item['category_id'];
         //get current category id from item
         Form::Form('ItemDetailForm');
         //$this->link_header("<script>MM_preloadImages('style/images/add_uncheck.gif','style/images/add_check.gif');</script>");
         $this->link_css('style/ItemDetail.css');
         $this->link_css('style/listItem.css');
         $this->link_css('style/aznet/jquery.lightbox.css');
         $this->link_js('javascript/enbac/item_detail.js');
         $this->link_js('javascript/jquery/jquery.ifixpng2.js');
         $this->link_js('javascript/jquery/lightbox/jquery.lightbox.js');
         $this->link_js('javascript/jquery/packed/jquery.jeditable.js');
         $this->link_js('javascript/jquery/packed/jquery.cookie.js');
         $this->link_js('javascript/enbac/bbcode.js');
         $this->link_js('javascript/ZeroClipboard.js');
         if (User::have_permit(ADMIN_ITEM)) {
             $this->link_css('style/admin.css');
             $this->link_js('javascript/enbac/items_list.js');
             $this->link_js('javascript/jquery/ui.datepicker.js');
             $this->link_css('style/aznet/ui.datepicker.css');
         }
     }
 }
开发者ID:duynhan07,项目名称:elink,代码行数:32,代码来源:ItemDetail.php

示例2: 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']) {
//.........这里部分代码省略.........
开发者ID:duynhan07,项目名称:elink,代码行数:101,代码来源:class.php

示例3: time

        return $value;
    }
    $_REQUEST = array_map('stripslashes_deep', $_REQUEST);
    $_COOKIE = array_map('stripslashes_deep', $_COOKIE);
}
if (!ERROR_PAGE) {
    //get all config
    AZLib::get_config();
    CGlobal::$exchange = (int) @CGlobal::$configs['exchange']['conf_val'];
    //Get all Categories
    AZLib::getCats();
    //if((isset($_GET['category_id']) && $_GET['category_id']) || (isset($_GET['zone_id']) && $_GET['zone_id']) || (Url::get("page","home") == 'home')){
    if (isset($_GET['category_id']) && $_GET['category_id']) {
        //AZLib::getCats();
        if (isset($_GET['category_id']) && isset(CGlobal::$allCategories[(int) $_GET['category_id']]) && CGlobal::$allCategories[(int) $_GET['category_id']]) {
            CGlobal::$curCategory = (int) $_GET['category_id'];
        }
    }
    if (isset($_GET['province_id'])) {
        AZLib::getProvinces();
        //Get all Provinces
        $province_id = (int) $_GET['province_id'];
        if (isset(CGlobal::$provinces[$province_id]) && CGlobal::$provinces[$province_id]) {
            CGlobal::$curCity = $province_id;
            AZLib::my_setcookie('province_id', $province_id, time() + 3600 * 24 * 365);
            if (!isset($_SERVER['HTTP_REFERER']) || strpos($_SERVER['HTTP_REFERER'], WEB_ROOT) !== 0) {
                $request_refer = WEB_ROOT;
            } else {
                $request_refer = $_SERVER['HTTP_REFERER'];
            }
            Url::redirect_url($request_refer);
开发者ID:duynhan07,项目名称:elink,代码行数:31,代码来源:Init.php


注:本文中的CGlobal::curCategory方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。