コード例 #1
0
ファイル: manage.php プロジェクト: panhongsheng/zl_cms
	/**
	 * 附件列表
	 */
	public function init() {
		$where = '';
		if($_GET['dosubmit']){
				if(is_array($_GET['info'])&&!empty($_GET['info']))extract($_GET['info']);
				if($filename) $where = "AND `filename` LIKE '%$filename%' ";
				if($start_uploadtime && $end_uploadtime) {
					$start = strtotime($start_uploadtime);
					$end = strtotime($end_uploadtime);
					if($start > $end) showmessage(L('range_not_correct'),HTTP_REFERER);
					$where .= "AND `uploadtime` >= '$start' AND  `uploadtime` <= '$end' ";				
				}
				if($fileext) $where .= "AND `fileext`='$fileext' ";
				$status =  trim($_GET['status']);
				if($status!='' && ($status==1 ||$status==0)) $where .= "AND `status`='$status' ";
				$module =  trim($_GET['module']);
				if(isset($module) && $module!='') $where .= "AND `module`='$module' ";		
		}
		$where .="AND `siteid`='".$this->siteid."'";
		if($where) $where = substr($where, 3);
		pc_base::load_sys_class('form');
		$category = getcache('category_content_'.$this->siteid,'commons');
		$modules = getcache('modules','commons');
		$page = $_GET['page'] ? $_GET['page'] : '1';
		$infos = $this->db->listinfo($where, 'uploadtime DESC', $page, $pagesize = 20);
		$pages = $this->db->pages;
		include $this->admin_tpl('attachment_list');
	}
コード例 #2
0
 /**
  * 获取评论信息
  * @param $module      模型
  * @param $contentid   文章ID
  * @param $siteid      站点ID
  */
 function get_info($module, $contentid, $siteid)
 {
     $category = getcache('category_content_' . $siteid, 'commons');
     list($module, $catid) = explode('_', $module);
     $cat = $category[$catid];
     if ($cat['type'] == 1) {
         //单网页   3.28  增加评论模块对单网页的支持
         return array('title' => $cat['catname'], 'url' => $cat['url'], 'allow_comment' => 1);
     } else {
         //不是单网页
         if (empty($contentid) || empty($catid)) {
             return false;
         }
         $this->db->set_catid($catid);
         $r = $this->db->get_one(array('catid' => $catid, 'id' => $contentid), '`title`');
         //$category = getcache('category_content_'.$siteid, 'commons');
         $model = getcache('model', 'commons');
         //$cat = $category[$catid];
         $data_info = array();
         if ($cat['type'] == 0) {
             $this->db->table_name = $this->db->db_tablepre . $model[$cat['modelid']]['tablename'] . '_data';
             $data_info = $this->db->get_one(array('id' => $contentid));
         }
         if ($r) {
             return array('title' => $r['title'], 'url' => go($catid, $contentid, 1), 'allow_comment' => isset($data_info['allow_comment']) ? $data_info['allow_comment'] : 1);
         } else {
             return false;
         }
     }
 }
コード例 #3
0
ファイル: ask_url.class.php プロジェクト: zhouzhouxs/Progect
 /**
  * 获取栏目的访问路径
  * 在修复栏目路径处重建目录结构用
  * @param intval $catid 栏目ID
  * @param intval $page 页数
  */
 public function category_url($catid, $page = 1)
 {
     $M = getcache('ask', 'commons');
     $M = $M[1];
     $category = $this->categorys[$catid];
     if ($category['type'] == 2) {
         return $category['url'];
     }
     $page = max(intval($page), 1);
     $setting = string2array($category['setting']);
     $category_ruleid = $setting['category_ruleid'];
     $urlrules = $this->urlrules[$M['category_ruleid']];
     $urlrules_arr = explode('|', $urlrules);
     if ($page == 1) {
         $urlrule = $urlrules_arr[0];
     } else {
         $urlrule = $urlrules_arr[1];
     }
     $url = str_replace(array('{$catid}', '{$page}'), array($catid, $page), $urlrule);
     if (strpos($url, '\\') !== false) {
         $url = APP_PATH . str_replace('\\', '/', $url);
     }
     if (in_array(basename($url), array('index.html', 'index.htm', 'index.shtml'))) {
         $url = dirname($url) . '/';
     }
     if (strpos($url, '://') === false) {
         $url = str_replace('//', '/', $url);
     }
     if (strpos($url, '/') === 0) {
         $url = substr($url, 1);
     }
     return $url;
 }
コード例 #4
0
 function vote($id, $pid)
 {
     $M = getcache('ask', 'commons');
     $M = $M[1];
     $_username = param::get_cookie('_username');
     $_userid = param::get_cookie('_userid');
     $id = intval($id);
     $pid = intval($pid);
     $userid = intval($_userid);
     if (!$id || !$pid || !$userid) {
         return false;
     }
     $r = $this->db->get_one("count(voteid) AS num", $this->db_tablepre . "ask_vote", "askid={$id} AND userid={$userid}");
     if ($r['num'] > 0) {
         return false;
     }
     $a = $this->db->get_one('catid', $this->db_tablepre . "ask", "askid={$id} AND siteid=" . $this->siteid);
     //检测表
     $posts_table_name = $this->posts_table($a['catid']);
     $this->table_name = $posts_table_name;
     $this->update(array('votecount' => '+=1'), "pid={$pid}");
     if ($M['vote_give_credit']) {
         $maxnum = floor($M['vote_max_credit'] / $M['vote_give_credit']);
         if ($r['num'] <= $maxnum) {
             $this->credit->update_credit($_userid, $_username, $M['vote_give_credit'], 1);
             pc_base::load_app_class('receipts', 'pay', 0);
             receipts::point($M['vote_give_credit'], $_userid, $_username, $flag, 'selfincome', L('votes_the_reward_integral'), $_username);
         }
     }
     $posts['askid'] = $id;
     $posts['pid'] = $pid;
     $posts['userid'] = $userid;
     $posts['addtime'] = SYS_TIME;
     return $this->db->insert($posts, $this->db_tablepre . "ask_vote");
 }
コード例 #5
0
		public function oauth() {
			pc_base::load_plugin_class('weibooauth','',0);
			$setting = getcache('weibo_var','plugins');			
			if(!isset($_REQUEST['oauth_verifier']) || $_REQUEST['oauth_verifier'] == '') {
				if($this->auth_db->get_one(array('source'=>'sina'))) {
					$txt = '授权成功,<a href="?m=zl_admin&c=plugin&a=config&pluginid='.$this->pluginid.'&module=removeauth&pc_hash='.$_SESSION['pc_hash'].'">解除绑定</a>';
				} else {
					$o = new WeiboOAuth( $setting['wb_akey'] , $setting['wb_skey']);
					$keys = $o->getRequestToken();
					print_r($keys);
					$aurl = $o->getAuthorizeURL( $keys['oauth_token'] ,false , get_url());
					$_SESSION['keys'] = $keys;
					$txt = '<a href="'.$aurl.'">点击进行授权</a>';
				}
				
			} else {
				$o = new WeiboOAuth( $setting['wb_akey'] , $setting['wb_skey'] , $_SESSION['keys']['oauth_token'] , $_SESSION['keys']['oauth_token_secret']  );
				$last_key = $o->getAccessToken(  $_REQUEST['oauth_verifier'] ) ;				
				$c = new WeiboClient( $setting['wb_akey'] , $setting['wb_skey'] , $last_key['oauth_token'] , $last_key['oauth_token_secret']  );
				$ms  = $c->home_timeline(); // done
				$me = $c->verify_credentials();	
				$this->auth_db->insert(array('uid'=>$me['id'],'token'=>$last_key['oauth_token'],'tsecret'=>$last_key['oauth_token_secret'],'source'=>'sina'));
				$txt = '授权成功,'.$me['name'].'<a href="?m=zl_admin&c=plugin&a=config&pluginid='.$this->pluginid.'&module=removeauth&pc_hash='.$_SESSION['pc_hash'].'">解除绑定</a>';
			}
			include $this->op->plugin_tpl('oauth',PLUGIN_ID);
		}
コード例 #6
0
ファイル: update.class.php プロジェクト: panhongsheng/zl_cms
	function url($action = 'check') {
        $modules = '';
        $site = getcache('sitelist','commons');
        $sitename = $site['1']['name'];
		$siturl = $site['1']['domain'];
        foreach ($site as $list) $sitelist .= $list['domain'].',';
		$pars = array(
			'action'=>$action,
			'ZLCMS_username'=>'',
			'sitename'=>$sitename,
			'siteurl'=>$siturl,
			'charset'=>CHARSET,
			'version'=>PC_VERSION,
			'release'=>PC_RELEASE,
			'os'=>PHP_OS,
			'php'=>phpversion(),
			'mysql'=>mysql_get_server_info(),
			'browser'=>urlencode($_SERVER['HTTP_USER_AGENT']),
			'username'=>urlencode(param::get_cookie('admin_username')),
			'email'=> urlencode(param::get_cookie('admin_email')),
			'modules'=>ROUTE_M,
			'sitelist'=>urlencode($sitelist),
			'uuid'=>urlencode($this->uuid),
			);
		$data = http_build_query($pars);
		$verify = md5($this->uuid);		
		if($s = $this->module()) {
			$p = '&p='.$s;
		}
		return $this->update_url.'?'.$data.'&verify='.$verify.$p;
	}
コード例 #7
0
ファイル: cache_all.php プロジェクト: jiangwuzhang/phpcms
 public function init()
 {
     if (isset($_POST['dosubmit']) || isset($_GET['dosubmit'])) {
         $page = $_GET['page'] ? intval($_GET['page']) : 0;
         $modules = array(array('name' => L('module'), 'function' => 'module'), array('name' => L('sites'), 'mod' => 'admin', 'file' => 'sites', 'function' => 'set_cache'), array('name' => L('category'), 'function' => 'category'), array('name' => L('downservers'), 'function' => 'downservers'), array('name' => L('badword_name'), 'function' => 'badword'), array('name' => L('ipbanned'), 'function' => 'ipbanned'), array('name' => L('keylink'), 'function' => 'keylink'), array('name' => L('linkage'), 'function' => 'linkage'), array('name' => L('position'), 'function' => 'position'), array('name' => L('admin_role'), 'function' => 'admin_role'), array('name' => L('urlrule'), 'function' => 'urlrule'), array('name' => L('sitemodel'), 'function' => 'sitemodel'), array('name' => L('type'), 'function' => 'type', 'param' => 'content'), array('name' => L('workflow'), 'function' => 'workflow'), array('name' => L('dbsource'), 'function' => 'dbsource'), array('name' => L('member_setting'), 'function' => 'member_setting'), array('name' => L('member_group'), 'function' => 'member_group'), array('name' => L('membermodel'), 'function' => 'membermodel'), array('name' => L('member_model_field'), 'function' => 'member_model_field'), array('name' => L('search_type'), 'function' => 'type', 'param' => 'search'), array('name' => L('search_setting'), 'function' => 'search_setting'), array('name' => L('update_vote_setting'), 'function' => 'vote_setting'), array('name' => L('update_link_setting'), 'function' => 'link_setting'), array('name' => L('special'), 'function' => 'special'), array('name' => L('setting'), 'function' => 'setting'), array('name' => L('database'), 'function' => 'database'), array('name' => L('update_formguide_model'), 'mod' => 'formguide', 'file' => 'formguide', 'function' => 'public_cache'), array('name' => L('cache_file'), 'function' => 'cache2database'), array('name' => L('cache_copyfrom'), 'function' => 'copyfrom'), array('name' => L('clear_files'), 'function' => 'del_file'), array('name' => L('video_category_tb'), 'function' => 'video_category_tb'));
         $this->cache_api = pc_base::load_app_class('cache_api', 'admin');
         $m = $modules[$page];
         if ($m['mod'] && $m['function']) {
             if ($m['file'] == '') {
                 $m['file'] = $m['function'];
             }
             $M = getcache('modules', 'commons');
             if (in_array($m['mod'], array_keys($M))) {
                 $cache = pc_base::load_app_class($m['file'], $m['mod']);
                 $cache->{$m}['function']();
             }
         } else {
             if ($m['target'] == 'iframe') {
                 echo '<script type="text/javascript">window.parent.frames["hidden"].location="index.php?' . $m['link'] . '";</script>';
             } else {
                 $this->cache_api->cache($m['function'], $m['param']);
             }
         }
         $page++;
         if (!empty($modules[$page])) {
             echo '<script type="text/javascript">window.parent.addtext("<li>' . L('update') . $m['name'] . L('cache_file_success') . '..........</li>");</script>';
             showmessage(L('update') . $m['name'] . L('cache_file_success'), '?m=admin&c=cache_all&page=' . $page . '&dosubmit=1&pc_hash=' . $_SESSION['pc_hash'], 0);
         } else {
             echo '<script type="text/javascript">window.parent.addtext("<li>' . L('update') . $m['name'] . L('site_cache_success') . '..........</li>")</script>';
             showmessage(L('update') . $m['name'] . L('site_cache_success'), 'blank');
         }
     } else {
         include $this->admin_tpl('cache_all');
     }
 }
コード例 #8
0
	/**
	 * 获取站点栏目列表
	 * @param integer $siteid  站点ID
	 * @return array()         返回为数组
	 */
	public static function get_category($siteid) {
		$category = getcache('category_content_'.$siteid, 'commons');
		foreach ($category as $k=>$v) {
			if (!in_array($v['type'], array(0,1))) unset($category[$k]); 
		}
		return $category;
	}
コード例 #9
0
 function __construct($modelid, $catid = 0, $categorys = array())
 {
     $this->modelid = $modelid;
     $this->catid = $catid;
     $this->categorys = $categorys;
     $this->fields = getcache('model_field_' . $modelid, 'model');
 }
コード例 #10
0
ファイル: index.php プロジェクト: panhongsheng/zl_cms
	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];
	}
コード例 #11
0
ファイル: url.class.php プロジェクト: klj123wan/czsz
 public function __construct()
 {
     $this->urlrules = getcache('urlrules', 'commons');
     self::set_siteid();
     $this->categorys = getcache('category_content_' . $this->siteid, 'commons');
     $this->html_root = pc_base::load_config('system', 'html_root');
 }
コード例 #12
0
ファイル: index.php プロジェクト: hxzyzz/ddc
	 /**
	 *	申请友情链接 
	 */
	public function register() { 
 		$siteid = SITEID;
 		if(isset($_POST['dosubmit'])){
 			if($_POST['name']==""){
 				showmessage(L('sitename_noempty'),"?m=link&c=index&a=register&siteid=$siteid");
 			}
 			if($_POST['url']==""){
 				showmessage(L('siteurl_not_empty'),"?m=link&c=index&a=register&siteid=$siteid");
 			}
 			if(!in_array($_POST['linktype'],array('0','1'))){
 				$_POST['linktype'] = '0';
 			}
 			$link_db = pc_base::load_model(link_model);
 			$_POST['logo'] =new_html_special_chars($_POST['logo']);
 			
 			if($_POST['linktype']=='0'){
 				$sql = array('siteid'=>$siteid,'typeid'=>$_POST['typeid'],'linktype'=>$_POST['linktype'],'name'=>$_POST['name'],'url'=>$_POST['url']);
 			}else{
 				$sql = array('siteid'=>$siteid,'typeid'=>$_POST['typeid'],'linktype'=>$_POST['linktype'],'name'=>$_POST['name'],'url'=>$_POST['url'],'logo'=>$_POST['logo']);
 			}
 			$link_db->insert($sql);
 			showmessage(L('add_success'), "?m=link&c=index&siteid=$siteid");
 		} else {
  			$setting = getcache('link', 'commons');
			$setting = $setting[$siteid];
 			if($setting['is_post']=='0'){
 				showmessage(L('suspend_application'), HTTP_REFERER);
 			}
 			$this->type = pc_base::load_model('type_model');
 			$types = $this->type->get_types($siteid);//获取站点下所有友情链接分类
 			pc_base::load_sys_class('form', '', 0);
  			$SEO = seo(SITEID, '', L('application_links'), '', '');
   			include template('link', 'register');
 		}
	} 
コード例 #13
0
ファイル: load.php プロジェクト: zhouzhouxs/Progect
 public function category()
 {
     $id = $_GET['id'];
     $categorys = array();
     $result = getcache('category_ask_' . $this->siteid, 'commons');
     if (!empty($result)) {
         foreach ($result as $r) {
             $categorys[$r['catid']] = $r;
         }
     }
     if ($id) {
         $str = "<span>→</span>";
         $LANG_SELECT = L('please_select');
     } else {
         $str = '';
         $LANG_SELECT = L('please_select');
     }
     if ($id) {
         //$str .= '<select onchange="$(\'#catid\').val(this.value);category_load(this.value);" multiple style="height:300px;width:120px;">';
         $str .= '<select onchange="$(\'#catid\').val(this.value);category_load(this.value);" multiple style="height:300px;width:120px;">';
     } else {
         $str .= '<select onchange="category_change_reload(this.options[this.selectedIndex].value)" multiple style="height:300px;width:120px;">';
     }
     $options = '';
     foreach ($categorys as $i => $v) {
         if (isset($id) && $v['parentid'] == $id || $v['module'] == 'ask') {
             $options .= '<option value="' . $i . '">' . $v['catname'] . '</option>';
         }
     }
     if (empty($options)) {
         exit;
     }
     $str .= $options . '</select>';
     echo $str;
 }
コード例 #14
0
ファイル: testpush.php プロジェクト: baowzh/fulianweb
function addart($catid, $title, $content)
{
    $info = array();
    $info['catid'] = 3;
    $info['title'] = "api push";
    $info['content'] = "absolutelu api push";
    $db_config = pc_base::load_config('database');
    pc_base::load_sys_class('mysql', '', 0);
    pc_base::load_sys_class('param', '', 0);
    $db = pc_base::load_model('content_model');
    $categorys = getcache('category_content_1', 'commons');
    $category = $categorys[3];
    //var_dump($categorys);
    $modelid = $category['modelid'];
    //var_dump($modelid);
    //die;
    $db->set_model($modelid);
    $setting = string2array($category['setting']);
    $workflowid = $setting['workflowid'];
    $info['status'] = 99;
    $info['keywords'] = "";
    $info['description'] = str_cut(str_replace(array("\r\n", "\t", '[page]', '[/page]', '&ldquo;', '&rdquo;', '&nbsp;'), '', strip_tags($info['content'])), 200);
    $info['username'] = "******";
    $info['inputtime'] = '';
    echo "1";
    if ($db->add_content($info)) {
        return true;
    }
    return false;
}
コード例 #15
0
ファイル: search_admin.php プロジェクト: ahmatjan/huluphp
 /**
  * 创建索引
  */
 public function createindex()
 {
     if (isset($_GET['dosubmit'])) {
         //重建索引首先清空表所有数据,然后根据搜索类型接口重新全部重建索引
         if (!isset($_GET['have_truncate'])) {
             $db_tablepre = $this->db->db_tablepre;
             //删除该站点全文索引
             $this->db->delete(array('siteid' => $this->siteid));
             $types = $this->type_db->select(array('siteid' => $this->siteid, 'module' => 'search'));
             setcache('search_types', $types, 'search');
         } else {
             $types = getcache('search_types', 'search');
         }
         //$key typeid 的索引
         $key = isset($_GET['key']) ? intval($_GET['key']) : 0;
         foreach ($types as $_k => $_v) {
             if ($key == $_k) {
                 $typeid = $_v['typeid'];
                 if ($_v['modelid']) {
                     if ($_v['typedir'] !== 'yp') {
                         $search_api = pc_base::load_app_class('search_api', 'content');
                     } else {
                         $search_api = pc_base::load_app_class('search_api', $_v['typedir']);
                     }
                     if (!isset($_GET['total'])) {
                         $total = $search_api->total($_v['modelid']);
                     } else {
                         $total = intval($_GET['total']);
                         $search_api->set_model($_v['modelid']);
                     }
                 } else {
                     $module = trim($_v['typedir']);
                     $search_api = pc_base::load_app_class('search_api', $module);
                     if (!isset($_GET['total'])) {
                         $total = $search_api->total();
                     } else {
                         $total = intval($_GET['total']);
                     }
                 }
                 $pagesize = $_GET['pagesize'] ? intval($_GET['pagesize']) : 50;
                 $page = max(intval($_GET['page']), 1);
                 $pages = ceil($total / $pagesize);
                 $datas = $search_api->fulltext_api($pagesize, $page);
                 foreach ($datas as $id => $r) {
                     $this->db->update_search($typeid, $id, $r['fulltextcontent'], $r['title'], $r['adddate'], 1);
                 }
                 $page++;
                 if ($pages >= $page) {
                     showmessage("正在更新 <span style='color:#ff0000;font-size:14px;text-decoration:underline;' >{$_v['name']}</span> - 总数:{$total} - 当前第 <font color='red'>{$page}</font> 页", "?m=search&c=search_admin&a=createindex&menuid=909&page={$page}&total={$total}&key={$key}&pagesize={$pagesize}&have_truncate=1&dosubmit=1");
                 }
                 $key++;
                 showmessage("开始更新: <span style='color:#ff0000;font-size:14px;text-decoration:underline;' >{$_v['name']}</span> - 总数:{$total}条", "?m=search&c=search_admin&a=createindex&menuid=909&page=1&key={$key}&pagesize={$pagesize}&have_truncate=1&dosubmit=1");
             }
         }
         showmessage('全站索引更新完成', 'blank');
     } else {
         $big_menu = array('javascript:window.top.art.dialog({id:\'add\',iframe:\'?m=search&c=search_type&a=add\', title:\'' . L('add_search_type') . '\', width:\'580\', height:\'240\', lock:true}, function(){var d = window.top.art.dialog({id:\'add\'}).data.iframe;var form = d.document.getElementById(\'dosubmit\');form.click();return false;}, function(){window.top.art.dialog({id:\'add\'}).close()});void(0);', L('add_search_type'));
         include $this->admin_tpl('createindex');
     }
 }
コード例 #16
0
 /**
  * 获取评论信息
  * @param $module      模型
  * @param $contentid   文章ID
  * @param $siteid      站点ID
  */
 function get_info($module, $contentid, $siteid)
 {
     list($module, $catid) = explode('_', $module);
     if (empty($contentid) || empty($catid)) {
         return false;
     }
     //判断栏目是否存在 s
     $CATEGORYS = getcache('category_content_' . $siteid, 'commons');
     if (!$CATEGORYS[$catid]) {
         return false;
     }
     //判断模型是否存在
     $this_modelid = $CATEGORYS[$catid]['modelid'];
     $MODEL = getcache('model', 'commons');
     if (!$MODEL[$this_modelid]) {
         return false;
     }
     $this->db->set_catid($catid);
     $r = $this->db->get_one(array('catid' => $catid, 'id' => $contentid), '`title`');
     $category = getcache('category_content_' . $siteid, 'commons');
     $model = getcache('model', 'commons');
     $cat = $category[$catid];
     $data_info = array();
     if ($cat['type'] == 0) {
         if ($model[$cat['modelid']]['tablename']) {
             $this->db->table_name = $this->db->db_tablepre . $model[$cat['modelid']]['tablename'] . '_data';
             $data_info = $this->db->get_one(array('id' => $contentid));
         }
     }
     if ($r) {
         return array('title' => $r['title'], 'url' => go($catid, $contentid, 1), 'allow_comment' => isset($data_info['allow_comment']) ? $data_info['allow_comment'] : 1);
     } else {
         return false;
     }
 }
コード例 #17
0
ファイル: member_setting.php プロジェクト: boylzj/omguitar
 /**
  * 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');
     }
 }
コード例 #18
0
ファイル: vote.php プロジェクト: pondyond/phpcmsv9
 function __construct()
 {
     parent::__construct();
     $this->M = new_html_special_chars(getcache('vote', 'commons'));
     $this->db = pc_base::load_model('vote_subject_model');
     $this->db2 = pc_base::load_model('vote_option_model');
 }
コード例 #19
0
 function __construct($modelid)
 {
     $this->db = pc_base::load_model('sitemodel_field_model');
     $this->db_pre = $this->db->db_tablepre;
     $this->modelid = $modelid;
     $this->fields = getcache('model_field_' . $modelid, 'model');
 }
コード例 #20
0
ファイル: points.php プロジェクト: zydj333/hualiangcaifu
 public function detail()
 {
     $id = $this->input->get('id');
     //导航及数量
     $nav_category = $this->a_caifu_model->get_dictionary_list('db_caifu_product', 'category');
     foreach ($nav_category as $key => $val) {
         $cateid = $val['column_value'];
         $where = array('category' => $cateid);
         $con = $this->a_caifu_model->count($where, 'caifu_product');
         $nav_category[$key]['numbs'] = intval($con);
     }
     $points_info = $this->a_caifu_model->get_one(array('id' => $id), 'db_caifu_points');
     $_data['points_info'] = $points_info;
     $_data['current_nav'] = "points";
     $_data['nav_category'] = $nav_category;
     //网站基本设置
     $setup_setting = getcache('setup', 'commons');
     $hot_search = empty($setup_setting['hot_search']) ? '' : $setup_setting['hot_search'];
     $hot_arr = array();
     if (!empty($hot_search)) {
         $hot_arr = explode(",", $hot_search);
     }
     $_data['hot_arr'] = $hot_arr;
     $this->seo_title = $points_info['name'] . " - " . $setup_setting['site_title'];
     $this->view('points_detail', $_data);
 }
コード例 #21
0
ファイル: news.php プロジェクト: zydj333/hualiangcaifu
 public function detail()
 {
     $id = $this->input->get('id');
     //导航及数量
     $nav_category = $this->a_caifu_model->get_dictionary_list('db_caifu_product', 'category');
     foreach ($nav_category as $key => $val) {
         $cateid = $val['column_value'];
         $where = array('category' => $cateid);
         $con = $this->a_caifu_model->count($where, 'caifu_product');
         $nav_category[$key]['numbs'] = intval($con);
     }
     $article_info = $this->a_article_model->get_one(array('article_id' => $id), 'article');
     $dot = $article_info['dot'];
     $dot += 1;
     $this->load->model('article');
     $this->article->update(array('article_id' => $id), array('dot' => $dot), 'article');
     $_data['article_info'] = $article_info;
     //分类基本信息
     $cate_info = $this->a_article_model->get_one(array('ac_id' => $article_info['ac_id']), 'article_category');
     //网站基本设置
     $setup_setting = getcache('setup', 'commons');
     $hot_search = empty($setup_setting['hot_search']) ? '' : $setup_setting['hot_search'];
     $hot_arr = array();
     if (!empty($hot_search)) {
         $hot_arr = explode(",", $hot_search);
     }
     $_data['hot_arr'] = $hot_arr;
     $this->seo_title = empty($article_info['article_title']) ? '新闻中心 - ' . $setup_setting['site_title'] : $article_info['article_title'] . $setup_setting['site_title'];
     $_data['cate_info'] = $cate_info;
     $_data['current_nav'] = "help";
     $_data['nav_category'] = $nav_category;
     $this->view('news_detail', $_data);
 }
コード例 #22
0
ファイル: index.php プロジェクト: ahmatjan/huluphp
 public function right()
 {
     $this->member_db = pc_base::load_model('member_model');
     $this->messagequeue_db = pc_base::load_model('messagequeue_model');
     $total_member = $this->member_db->count();
     //会员总数
     $todaytime = strtotime(date('Y-m-d', SYS_TIME));
     //今日会员数
     $today_member = $this->member_db->count("`regdate` > '{$todaytime}'");
     $total_messagequeue = $this->messagequeue_db->count();
     //消息总数
     $mysql_version = $this->member_db->get_version();
     //mysql版本
     $mysql_table_status = $this->member_db->get_table_status();
     $mysql_table_size = $mysql_table_index_size = '';
     foreach ($mysql_table_status as $table) {
         $mysql_table_size += $table['Data_length'];
         $mysql_table_index_size += $table['Index_length'];
     }
     $mysql_table_size = sizecount($mysql_table_size);
     $mysql_table_index_size = sizecount($mysql_table_index_size);
     //应用个数
     $applist = getcache('applist');
     $appnum = empty($applist) ? 0 : count($applist);
     include $this->admin_tpl('right');
 }
コード例 #23
0
 /**
  * 
  * IP禁止判断接口,供外部调用 ...
  */
 public function check_ip()
 {
     $ip_array = array();
     //当前IP
     $ip = ip();
     //加载IP禁止缓存
     $ipbanned_cache = getcache('ipbanned', 'commons');
     if (!empty($ipbanned_cache)) {
         foreach ($ipbanned_cache as $data) {
             $ip_array[$data['ip']] = $data['ip'];
             //是否是IP段
             if (strpos($data['ip'], '*')) {
                 $ip_min = $this->convert_ip("min", $data['ip']);
                 $ip_max = $this->convert_ip("max", $data['ip']);
                 $result = $this->ipforbidden($ip, $ip_min, $ip_max);
                 if ($result == 0 && $data['expires'] > SYS_TIME) {
                     //被封
                     showmessage('你在IP禁止段内,所以禁止你访问');
                 }
             } else {
                 //不是IP段,用绝对匹配
                 if ($ip == $data['ip'] && $data['expires'] > SYS_TIME) {
                     showmessage('IP地址绝对匹配,禁止你访问');
                 }
             }
         }
     }
 }
コード例 #24
0
ファイル: log.php プロジェクト: shenhua4286/gxw
 /**
  * 日志搜索
  */
 public function search_log()
 {
     $where = '';
     extract($_GET['search'], EXTR_SKIP);
     if ($username) {
         $where .= $where ? " AND username='******'" : " username='******'";
     }
     if ($module) {
         $where .= $where ? " AND module='{$module}'" : " module='{$module}'";
     }
     if ($start_time && $end_time) {
         $start = $start_time;
         $end = $end_time;
         $where .= "AND `time` >= '{$start}' AND `time` <= '{$end}' ";
     }
     $page = isset($_GET['page']) && intval($_GET['page']) ? intval($_GET['page']) : 1;
     $infos = $this->db->listinfo($where, $order = 'logid DESC', $page, $pages = '12');
     $pages = $this->db->pages;
     //模块数组
     $module_arr = array();
     $modules = getcache('modules', 'commons');
     $default = $module ? $module : L('open_module');
     //未设定则显示 不限模块 ,设定则显示指定的
     foreach ($modules as $module => $m) {
         $module_arr[$m['module']] = $m['module'];
     }
     include $this->admin_tpl('log_search_list');
 }
コード例 #25
0
ファイル: phpsso.class.php プロジェクト: pondyond/phpcmsv9
 /**
  * 构造函数
  */
 public function __construct()
 {
     $this->db = pc_base::load_model('member_model');
     pc_base::load_app_func('global');
     /*获取系统配置*/
     $this->settings = getcache('settings', 'admin');
     $this->applist = getcache('applist', 'admin');
     if (isset($_GET) && is_array($_GET) && count($_GET) > 0) {
         foreach ($_GET as $k => $v) {
             if (!in_array($k, array('m', 'c', 'a'))) {
                 $_POST[$k] = $v;
             }
         }
     }
     if (isset($_POST['appid'])) {
         $this->appid = intval($_POST['appid']);
     } else {
         exit('0');
     }
     if (isset($_POST['data'])) {
         parse_str(sys_auth($_POST['data'], 'DECODE', $this->applist[$this->appid]['authkey']), $this->data);
         if (!is_array($this->data)) {
             exit('0');
         }
     } else {
         exit('0');
     }
     if (isset($GLOBALS['HTTP_RAW_POST_DATA'])) {
         $this->data['avatardata'] = $GLOBALS['HTTP_RAW_POST_DATA'];
         if ($this->applist[$this->appid]['authkey'] != $this->data['ps_auth_key']) {
             exit('0');
         }
     }
 }
コード例 #26
0
 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();
 }
コード例 #27
0
ファイル: link.php プロジェクト: baowzh/fulianweb
 function __construct()
 {
     parent::__construct();
     $this->M = new_html_special_chars(getcache('link', 'commons'));
     $this->db = pc_base::load_model('link_model');
     $this->db2 = pc_base::load_model('type_model');
 }
コード例 #28
0
ファイル: --bill.php プロジェクト: zydj333/hualiangcaifu
 public function kaipiao()
 {
     $this->load->model('user');
     $data['userInfo'] = $this->user->get_one(array('user_id' => $this->user_id), 'user');
     $data['groupInfo'] = $this->user->get_one(array('id' => $data['userInfo']['group']), 'user_group');
     if (isset($_POST['dosubmit']) && $_POST['dosubmit'] == 1) {
         $bill_id = trim($this->input->post('billid'));
         $_data['member_id'] = $this->user_id;
         $_data['compname'] = trim($this->input->post('compname'));
         $_data['compcode'] = trim($this->input->post('compcode'));
         $_data['address'] = trim($this->input->post('address2'));
         $_data['tel'] = trim($this->input->post('tel'));
         $_data['bank'] = trim($this->input->post('bank'));
         $_data['bankcode'] = trim($this->input->post('bankcode'));
         if (empty($bill_id)) {
             $id = $this->bill->add($_data, 'bill');
             $this->showmessage('success', '开票资料添加成功!', HTTP_REFERER);
             return;
         } else {
             $this->bill->update(array('member_id' => $this->user_id), $_data, 'bill');
             $this->showmessage('success', '开票资料更新成功!', HTTP_REFERER);
             return;
         }
     } else {
         $bill = $this->bill->get_one(array('member_id' => $this->user_id), 'bill');
         //网站基本设置
         $setup_setting = getcache('setup', 'commons');
         $this->seo_title = "开票信息 - " . $setup_setting['site_title'];
         $data['bill'] = $bill;
         $this->view('bill_add', $data);
     }
 }
コード例 #29
0
 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;
 }
コード例 #30
0
ファイル: rss.php プロジェクト: panhongsheng/zl_cms
	public function init() {
		$siteurl = siteurl(SITEID);
		if(empty($this->rssid)) {
			$catid = $_GET['catid'] ? intval($_GET['catid']) : '0';
			$siteids = getcache('category_content','commons');
			$siteid = $siteids[$catid] ? $siteids[$catid] : 1;
			$CATEGORYS = getcache('category_content_'.$siteid,'commons');
			$subcats = subcat($catid,0,1,$siteid);
			foreach ($CATEGORYS as $r) if($r['parentid'] == 0) $channel[] = $r;
			include template('content','rss');
		} else {
			$CATEGORYS = getcache('category_content_'.$this->siteid,'commons');
			$SITEINFO = getcache('sitelist','commons');
			$CAT = $CATEGORYS[$this->rssid];
			if(count($CAT) == 0) showmessage(L('missing_part_parameters'),'blank');
			$siteid = $CAT['siteid'];
			$sitedomain = $SITEINFO[$siteid]['domain'];  //获取站点域名
			$MODEL = getcache('model','commons');
			$modelid = $CAT['modelid'];		
		    $encoding   =  CHARSET;
		    $about      =  SITE_PROTOCOL.SITE_URL;
		    $title      =  $CAT['catname'];
		    $description = $CAT['description'];
		    $content_html = $CAT['content_ishtml'];
		    $image_link =  "<![CDATA[".$CAT['image']."]]> ";
		    $category   =  '';
		    $cache      =  60;
		    $rssfile    = new RSSBuilder($encoding, $about, $title, $description, $image_link, $category, $cache);
		    $publisher  =  '';
		    $creator    =  SITE_PROTOCOL.SITE_URL;
		    $date       =  date('r');
		    $rssfile->addDCdata($publisher, $creator, $date);
		    $ids = explode(",",$CAT['arrchildid']);
		    if(count($ids) == 1 && in_array($this->rssid, $ids)) {
		        $sql .= "`catid` = '$this->rssid' AND `status` = '99'";
		    } else {
		        $sql .= get_sql_catid('category_content_'.$siteid,$this->rssid)." AND `status` = '99'";
		    }
			if(empty($MODEL[$modelid]['tablename'])) showmessage(L('missing_part_parameters'),'blank');
		    $this->db->table_name = $this->db->db_tablepre.$MODEL[$modelid]['tablename'];
			$info = $this->db->select($sql,'`title`, `description`, `url`, `inputtime`, `thumb`, `keywords`','0,20','id DESC');
		
			foreach ($info as $r) {
			    //添加项目
			    if(!empty($r['thumb'])) $img = "<img src=".thumb($r['thumb'], 150, 150)." border='0' /><br />";else $img = '';
		        $about          =  $link = (strpos($r['url'], 'http://') !== FALSE || strpos($r['url'], 'https://') !== FALSE) ? "<![CDATA[".$r['url']."]]> " : (($content_html == 1) ? "<![CDATA[".substr($sitedomain,0,-1).$r['url']."]]> " : "<![CDATA[".substr(APP_PATH,0,-1).$r['url']."]]> ");
		        $title          =   "<![CDATA[".$r['title']."]]> ";
		        $description    =  "<![CDATA[".$img.$r['description']."]]> ";
		        $subject        =  '';
		        $date           =  date('Y-m-d H:i:s' , $r['inputtime']);
		        $author         =  $ZLCMS['sitename'].' '.SITE_PROTOCOL.SITE_URL;
		        $comments       =  '';//注释;
	
		        $rssfile->addItem($about, $title, $link, $description, $subject, $date,	$author, $comments, $image);
			}	
			$version = '2.00';
	    	$rssfile->outputRSS($version);
		}    	        	
	}