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


PHP get_siteid函数代码示例

本文整理汇总了PHP中get_siteid函数的典型用法代码示例。如果您正苦于以下问题:PHP get_siteid函数的具体用法?PHP get_siteid怎么用?PHP get_siteid使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


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

示例1: pc_tag

 /**
  * PC标签中调用数据
  * @param array $data 配置数据
  */
 public function pc_tag($data)
 {
     $siteid = isset($data['siteid']) && intval($data['siteid']) ? intval($data['siteid']) : get_siteid();
     $r = $this->db->select(array('pos' => $data['pos'], 'siteid' => $siteid));
     $str = '';
     if (!empty($r) && is_array($r)) {
         foreach ($r as $v) {
             if (defined('IN_ADMIN') && !defined('HTML')) {
                 $str .= '<div id="block_id_' . $v['id'] . '" class="admin_block" blockid="' . $v['id'] . '">';
             }
             if ($v['type'] == '2') {
                 extract($v, EXTR_OVERWRITE);
                 $data = string2array($data);
                 if (!defined('HTML')) {
                     ob_start();
                     include $this->template_url($id);
                     $str .= ob_get_contents();
                     ob_clean();
                 } else {
                     include $this->template_url($id);
                 }
             } else {
                 $str .= $v['data'];
             }
             if (defined('IN_ADMIN') && !defined('HTML')) {
                 $str .= '</div>';
             }
         }
     }
     return $str;
 }
开发者ID:klj123wan,项目名称:czsz,代码行数:35,代码来源:block_tag.class.php

示例2: keyword

	function keyword ($field, $value) {
		//获取post过来的关键字,关键字用空格或者‘,’分割的
		$data = array();
		$data = split('[ ,]', $value);
		//加载关键字的数据模型
		$keyword_db = pc_base::load_model('keyword_model');
		$keyword_data_db = pc_base::load_model('keyword_data_model');
		pc_base::load_sys_func('iconv');
		if (is_array($data) && !empty($data)) {
			$siteid = get_siteid();
			foreach ($data as $v) {
				$v = defined('IN_ADMIN') ? $v : safe_replace(addslashes($v));
				$v = str_replace(array('//','#','.'),' ',$v);
				if (!$r = $keyword_db->get_one(array('keyword'=>$v, 'siteid'=>$siteid))) {
					$letters = gbk_to_pinyin($v);
					$letter = strtolower(implode('', $letters));
					$tagid = $keyword_db->insert(array('keyword'=>$v, 'siteid'=>$siteid, 'pinyin'=>$letter, 'videonum'=>1), true);
				} else {
					$keyword_db->update(array('videonum'=>'+=1'), array('id'=>$r['id']));
					$tagid = $r['id'];
				}
				$contentid = $this->id.'-'.$this->modelid;
				if (!$keyword_data_db->get_one(array('tagid'=>$tagid, 'siteid'=>$siteid, 'contentid'=>$contentid))) {
					$keyword_data_db->insert(array('tagid'=>$tagid, 'siteid'=>$siteid, 'contentid'=>$contentid));
				}
				unset($contentid, $tagid, $letters);
			}
		}
		return $value;
	}
开发者ID:panhongsheng,项目名称:zl_cms,代码行数:30,代码来源:content_update.class.php

示例3: __construct

    function __construct($modelid,$catid = 0,$categorys = array()) {
		$this->modelid = $modelid;
		$this->catid = $catid;
		$this->categorys = $categorys;
		$this->fields = getcache('model_field_'.$modelid,'model');
		$this->siteid = get_siteid();
    }
开发者ID:hxzyzz,项目名称:ddc,代码行数:7,代码来源:content_form.class.php

示例4: _initialize

 function _initialize()
 {
     $this->siteid = get_siteid();
     // 用户权限检查
     if (C('USER_AUTH_ON') && !in_array(CONTROLLER_NAME, explode(',', C('NOT_AUTH_MODULE')))) {
         if (!RBAC::AccessDecision()) {
             //检查认证识别号
             if (!$_SESSION[C('USER_AUTH_KEY')]) {
                 //跳转到认证网关
                 //$this->error('请先登录后台管理','index.php/Admin/Public/login/');
                 redirect('index.php/Admin/Public/login/');
             }
             // 没有权限 抛出错误
             if (C('RBAC_ERROR_PAGE')) {
                 // 定义权限错误页面
                 $this->assign('jumpUrl', __MODULE__ . C('RBAC_ERROR_PAGE'));
                 $this->error('您没有权限操作该项');
                 D('Log')->addLog(2);
                 // redirect(C('RBAC_ERROR_PAGE'));
             } else {
                 if (C('GUEST_AUTH_ON')) {
                     $this->assign('jumpUrl', PHP_FILE . C('USER_AUTH_GATEWAY'));
                 }
                 // 提示错误信息
                 $this->error(L('_VALID_ACCESS_'));
             }
         }
     }
     // 记录操作日志
     if (!in_array(ACTION_NAME, array('public_session_life'))) {
         D('Log')->addLog(1);
     }
 }
开发者ID:RocherKong,项目名称:518ESHOP,代码行数:33,代码来源:CommonController.class.php

示例5: manage

 /**
  * member list
  */
 function manage()
 {
     if (isset($_POST['dosubmit'])) {
         $member_setting = array2string($_POST['info']);
         $this->db->update(array('module' => 'member', 'setting' => $member_setting), array('module' => 'member'));
         setcache('member_setting', $_POST['info']);
         showmessage(L('operation_success'), HTTP_REFERER);
     } else {
         $show_scroll = true;
         $member_setting = $this->db->get_one(array('module' => 'member'), 'setting');
         $member_setting = string2array($member_setting['setting']);
         $email_config = getcache('common', 'commons');
         $this->sms_setting_arr = getcache('sms', 'sms');
         $siteid = get_siteid();
         if (empty($email_config['mail_user']) || empty($email_config['mail_password'])) {
             $mail_disabled = 1;
         }
         if (!empty($this->sms_setting_arr[$siteid])) {
             $this->sms_setting = $this->sms_setting_arr[$siteid];
             if ($this->sms_setting['sms_enable'] == '0') {
                 $sms_disabled = 1;
             } else {
                 if (empty($this->sms_setting['userid']) || empty($this->sms_setting['productid']) || empty($this->sms_setting['sms_key'])) {
                     $sms_disabled = 1;
                 }
             }
         } else {
             $sms_disabled = 1;
         }
         include $this->admin_tpl('member_setting');
     }
 }
开发者ID:boylzj,项目名称:omguitar,代码行数:35,代码来源:member_setting.php

示例6: __construct

 function __construct($formid, $no_allowed = 0)
 {
     $this->formid = $formid;
     $this->no_allowed = $no_allowed ? 'disabled=""' : '';
     $this->fields = getcache('formguide_field_' . $formid, 'model');
     $this->siteid = get_siteid();
 }
开发者ID:codercpf,项目名称:privatewk,代码行数:7,代码来源:formguide_form.class.php

示例7: init

	public function init() {
		if(isset($_POST['dosubmit'])) {
			$info['siteurl'] = trim($_POST['info']['siteurl']);
			$info['sitename'] = trim($_POST['info']['sitename']);
			$info['siteid'] = intval($_POST['info']['siteid']);
			if(empty($info['sitename'])) showmessage(L('downserver_not_empty'), HTTP_REFERER);	
			if(empty($info['siteurl']) || !preg_match('/(\w+):\/\/(.+)[^\/]$/i', $info['siteurl'])) showmessage(L('downserver_error'), HTTP_REFERER);
			$insert_id = $this->db->insert($info,true);
			if($insert_id){
				$this->_set_cache();
				showmessage(L('operation_success'), HTTP_REFERER);
			}
		} else {
			$infos =  $sitelist = array();
			$current_siteid = get_siteid();
			$where = "`siteid`='$current_siteid' or `siteid`=''";
			$sitelists = $this->sites->get_list();
			if($_SESSION['roleid'] == '1') {
				foreach($sitelists as $key=>$v) $sitelist[$key] = $v['name'];
				$default = L('all_site');
			} else {
				$sitelist[$current_siteid] = $sitelists[$current_siteid]['name'];
				$default = '';
			}			
			$page = $_GET['page'] ? $_GET['page'] : '1';
			$infos = $this->db->listinfo($where, 'listorder DESC,id DESC', $page, $pagesize = 20);
			$pages = $this->db->pages;						
			include $this->admin_tpl('downservers_list');
		}
	}
开发者ID:hxzyzz,项目名称:ddc,代码行数:30,代码来源:downservers.php

示例8: add

 function add()
 {
     if ($_POST['dosubmit']) {
         $siteid = intval($_POST['siteid']) ? intval($_POST['siteid']) : showmessage(L('parameter_error'), HTTP_REFERER);
         if ($this->db->get_one(array('siteid' => $siteid))) {
             showmessage(L('wap_add_samesite_error'), HTTP_REFERER);
         }
         $sitename = trim(new_addslashes($_POST['sitename']));
         $logo = trim($_POST['logo']);
         $domain = trim($_POST['domain']);
         $setting = array2string($_POST['setting']);
         $return_id = $this->db->insert(array('siteid' => $siteid, 'sitename' => $sitename, 'logo' => $logo, 'domain' => $domain, 'setting' => $setting), '1');
         $this->wap_site_cache();
         showmessage(L('operation_success'), '', '', 'add');
     } else {
         $sitelists = array();
         $current_siteid = get_siteid();
         $sitelists = $this->sites->get_list();
         if ($_SESSION['roleid'] == '1') {
             foreach ($sitelists as $key => $v) {
                 $sitelist[$key] = $v['name'];
             }
         } else {
             $sitelist[$current_siteid] = $sitelists[$current_siteid]['name'];
         }
         $show_header = true;
         include $this->admin_tpl('m_add');
     }
 }
开发者ID:ahmatjan,项目名称:huluphp,代码行数:29,代码来源:wap_admin.php

示例9: getAccessibleLeftMenu

 /**
  * 获取左导航可访问菜单
  * @return array
  */
 public function getAccessibleLeftMenu($pid)
 {
     $menu_model = model('Menu');
     $models = model('model')->where(array('siteid' => get_siteid()))->field('tablename')->select();
     $post_type = array();
     foreach ($models as $key => $value) {
         $post_type[] = $value['tablename'];
     }
     if (session(C('ADMIN_AUTH_KEY'))) {
         $menulist = $menu_model->where(array('pid' => $pid, 'status' => 1))->order('sort desc, id asc')->select();
     } else {
         $role_id = session('user_info.role_id');
         $menulist = $menu_model->table('__ACCESS__ as access, __NODE__ as node')->where(array('node.pid' => $pid, 'node.id' => array('exp', ' = access.node_id'), 'access.role_id' => $role_id, 'access.siteid' => get_siteid()))->order('node.sort desc, node.id asc')->select();
     }
     // 过滤不属于当前站点的POST TYPE 菜单
     foreach ($menulist as $key => $value) {
         if (empty($value['post_type']) || in_array($value['post_type'], $post_type)) {
             continue;
         }
         unset($menulist[$key]);
     }
     foreach ($menulist as $key => $value) {
         if (session(C('ADMIN_AUTH_KEY'))) {
             $childs = $menu_model->where(array('pid' => $value['id'], 'status' => 1))->order('sort desc')->select();
         } else {
             $childs = $menu_model->table('__ACCESS__ as access, __NODE__ as node')->where(array('node.pid' => $value['id'], 'node.id' => array('exp', ' = access.node_id'), 'access.role_id' => $role_id, 'access.siteid' => get_siteid()))->order('node.sort desc, node.id asc')->select();
         }
         $menulist[$key]['childs'] = $childs;
     }
     return $menulist;
 }
开发者ID:WALES7CH,项目名称:TP-Admin,代码行数:35,代码来源:MenuLogic.class.php

示例10: __construct

	public function __construct() {
		$this->db_config = pc_base::load_config('database');
		$this->db_setting = 'default';
		parent::__construct();
		$this->url = pc_base::load_app_class('url', 'content');
		$this->siteid = get_siteid();
	}
开发者ID:panhongsheng,项目名称:zl_cms,代码行数:7,代码来源:content_model.class.php

示例11: __construct

	function __construct() {
		$this->db = pc_base::load_model('sitemodel_model');
		$this->m_db = pc_base::load_model('sitemodel_field_model');
		$this->M = new_html_special_chars(getcache('formguide', 'commons'));
		$this->siteid = intval($_GET[siteid]) ? intval($_GET[siteid]) : get_siteid();
		$this->M = $this->M[$this->siteid];
	}
开发者ID:panhongsheng,项目名称:zl_cms,代码行数:7,代码来源:index.php

示例12: edit

	/**
	 * 推荐位编辑
	 */
	public function edit() {
		if(isset($_POST['dosubmit'])) {
			$_POST['posid'] = intval($_POST['posid']);
			if(!is_array($_POST['info']) || empty($_POST['info']['name'])){
				showmessage(L('operation_failure'));
			}
			$_POST['info']['siteid'] = intval($_POST['info']['modelid']) ? get_siteid() : 0;
			$_POST['info']['listorder'] = intval($_POST['info']['listorder']);
			$_POST['info']['maxnum'] = intval($_POST['info']['maxnum']);			
			$_POST['info']['thumb'] = $_POST['info']['thumb'];			
			$this->db->update($_POST['info'],array('posid'=>$_POST['posid']));
			$this->_set_cache();
			showmessage(L('operation_success'), '', '', 'edit');
		} else {
			$info = $this->db->get_one(array('posid'=>intval($_GET['posid'])));
			extract($info);
			pc_base::load_sys_class('form');
			$this->sitemodel_db = pc_base::load_model('sitemodel_model');
			$sitemodel = $sitemodel = array();
			$sitemodel = getcache('model','commons');
			foreach($sitemodel as $value){
				if($value['siteid'] == get_siteid())$modelinfo[$value['modelid']]=$value['name'];
			}
			$show_validator = $show_header = $show_scroll = true;
			include $this->admin_tpl('position_edit');
		}

	}
开发者ID:panhongsheng,项目名称:zl_cms,代码行数:31,代码来源:position.php

示例13: sg

 /**
  * 查看邮件标签
  * @param  $data
  */
 public function sg($data)
 {
     $ysqgk_id = $data['ysqgkid'];
     if (empty($ysqgk_id)) {
         $ysqgk_id = '';
     }
     $bh = $data['bh'];
     $siteid = $data['siteid'];
     $pass = $data['pass'];
     if (empty($siteid)) {
         $siteid = get_siteid();
     }
     if ($pass) {
         $pass = md5($pass);
     }
     if ($pass != '' and $ysqgk_id != '') {
         $sql = array('ysqgkid' => $ysqgk_id, 'pass' => $pass, 'siteid' => $siteid);
     } elseif ($ysqgk_id !== '') {
         $sql = array('ysqgkid' => $ysqgk_id, 'siteid' => $siteid);
     } elseif ($bh != '') {
         $sql = array('bh' => $bh, 'siteid' => $siteid);
     }
     $r = $this->ysqgk_db->select($sql, '*', $data['limit'], 'addtime ' . $data['order']);
     return new_html_special_chars($r);
 }
开发者ID:baowzh,项目名称:renfang,代码行数:29,代码来源:ysqgk_tag.class.php

示例14: listinfos

 function listinfos($where = '', $order = '', $page = 1, $pagesize = 50, $flags = 0)
 {
     if (!isset($ACTOR)) {
         $ACTOR = getcache('actor_' . get_siteid(), 'ask');
     }
     if ($where) {
         $where = " WHERE {$where}";
     }
     if ($order) {
         $order = " ORDER BY {$order}";
     }
     $page = max(intval($page), 1);
     $offset = $pagesize * ($page - 1);
     $limit = " LIMIT {$offset}, {$pagesize}";
     $r = $this->get_one('', ' COUNT(*) AS num');
     $number = $r['number'];
     $this->db->pages;
     $array = array();
     $i = 1;
     $result = $this->db->query("SELECT * FROM {$this->table_name} {$where} {$order} {$limit}");
     $data = $this->fetch_array($result);
     foreach ($data as $r) {
         $userids[] = $userid = $r['userid'];
         $r['orderid'] = $i;
         $_array[] = $array[$userid] = $r;
         $i++;
     }
     if ($userids != '') {
         $userids = implodeids($userids);
         $data = $this->db_m->listinfo("userid IN ({$userids})");
         foreach ($data as $r) {
             $userid = $r['userid'];
             $credit = $r['point'];
             $r['lastdate'] = date('Y-m-d H:i', $r['lastdate']);
             foreach ($ACTOR[$r['actortype']] as $k => $v) {
                 if ($credit >= $v['min'] && $credit <= $v['max']) {
                     $r['grade'] = $v['grade'] . ' ' . $v['actor'];
                 } elseif ($credit > $v['max']) {
                     $r['grade'] = $v['grade'] . ' ' . $v['actor'];
                 }
             }
             if ($flags) {
                 $_info[$userid] = $r;
             } else {
                 $info[] = array_merge($array[$userid], $r);
             }
         }
         if ($flags) {
             foreach ($_array as $r) {
                 $userid = $r['userid'];
                 $info[] = array_merge($_info[$userid], $r);
             }
         }
     }
     $info = array_filter($info);
     $this->number = $this->db_m->page;
     $this->db->free_result($result);
     return $info;
 }
开发者ID:zhouzhouxs,项目名称:Progect,代码行数:59,代码来源:ask_credit_model.class.php

示例15: attachment_list

 public function attachment_list($where = array(), $order = 'id desc', $limit = 8)
 {
     $attachs = $this->where(array_merge(array('siteid' => get_siteid()), $where))->order($order)->page((isset($_GET['p']) ? $_GET['p'] : 0) . ', ' . $limit)->select();
     $count = $this->where(array_merge(array('siteid' => get_siteid()), $where))->count();
     $Page = new Page($count, $limit);
     $show = $Page->show();
     return array("data" => $attachs, "pages" => $show);
 }
开发者ID:WALES7CH,项目名称:TP-Admin,代码行数:8,代码来源:AttachmentModel.class.php


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