Пример #1
0
 public function __construct()
 {
     $this->reviews_db = pc_base::load_model('reviews_model');
     $this->reviews_setting_db = pc_base::load_model('reviews_setting_model');
     $this->reviews_data_db = pc_base::load_model('reviews_data_model');
     $this->reviews_table_db = pc_base::load_model('reviews_table_model');
 }
Пример #2
0
 /**
  * 构造函数
  * 
  */
 public function __construct()
 {
     $this->db = pc_base::load_model('session_model');
     $this->lifetime = pc_base::load_config('system', 'session_ttl');
     session_set_save_handler(array(&$this, 'open'), array(&$this, 'close'), array(&$this, 'read'), array(&$this, 'write'), array(&$this, 'destroy'), array(&$this, 'gc'));
     session_start();
 }
Пример #3
0
 public function __construct()
 {
     parent::__construct();
     $this->db = pc_base::load_model('sitemodel_field_model');
     $this->model_db = pc_base::load_model('sitemodel_model');
     $this->siteid = $this->get_siteid();
 }
Пример #4
0
	function __construct() {
		parent::__construct();
		$this->siteid = $this->get_siteid();
		$this->db = pc_base::load_model('search_model');
		$this->module_db = pc_base::load_model('module_model');
		$this->type_db = pc_base::load_model('type_model');
	}
Пример #5
0
 /**
  * 更新模型缓存
  */
 public static function update_cache_model()
 {
     $sitemodel_db = pc_base::load_model('sitemodel_model');
     $data = $sitemodel_db->select(array('type' => 2), "*", 1000, 'sort', '', 'modelid');
     setcache('member_model', $data, 'commons');
     if (!defined('MODEL_PATH')) {
         //模型原型存储路径
         define('MODEL_PATH', PC_PATH . 'modules' . DIRECTORY_SEPARATOR . 'member' . DIRECTORY_SEPARATOR . 'fields' . DIRECTORY_SEPARATOR);
     }
     if (!defined('CACHE_MODEL_PATH')) {
         //模型缓存路径
         define('CACHE_MODEL_PATH', PHPCMS_PATH . 'caches' . DIRECTORY_SEPARATOR . 'caches_model' . DIRECTORY_SEPARATOR . 'caches_data' . DIRECTORY_SEPARATOR);
     }
     require MODEL_PATH . 'fields.inc.php';
     //更新内容模型类:表单生成、入库、更新、输出
     $classtypes = array('form', 'input', 'update', 'output');
     foreach ($classtypes as $classtype) {
         $cache_data = file_get_contents(MODEL_PATH . 'member_' . $classtype . '.class.php');
         $cache_data = str_replace('}?>', '', $cache_data);
         foreach ($fields as $field => $fieldvalue) {
             if (file_exists(MODEL_PATH . $field . DIRECTORY_SEPARATOR . $classtype . '.inc.php')) {
                 $cache_data .= file_get_contents(MODEL_PATH . $field . DIRECTORY_SEPARATOR . $classtype . '.inc.php');
             }
         }
         $cache_data .= "\r\n } \r\n?>";
         file_put_contents(CACHE_MODEL_PATH . 'member_' . $classtype . '.class.php', $cache_data);
         chmod(CACHE_MODEL_PATH . 'member_' . $classtype . '.class.php', 0777);
     }
     return true;
 }
Пример #6
0
 function __construct()
 {
     parent::__construct();
     $this->db = pc_base::load_model('workflow_model');
     $this->admin_db = pc_base::load_model('admin_model');
     $this->siteid = $this->get_siteid();
 }
Пример #7
0
 /**
  * 构造函数
  */
 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');
         }
     }
 }
Пример #8
0
	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];
	}
Пример #9
0
 /**
  * 编辑专题首页模板
  */
 public function init()
 {
     echo '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">';
     $specialid = isset($_GET['specialid']) && intval($_GET['specialid']) ? intval($_GET['specialid']) : showmessage(L('illegal_action'), HTTP_REFERER);
     if (!$specialid) {
         showmessage(L('illegal_action'), HTTP_REFERER);
     }
     $info = $this->db->get_one(array('id' => $specialid, 'disabled' => '0', 'siteid' => $this->get_siteid()));
     if (!$info['id']) {
         showmessage(L('illegal_parameters'), HTTP_REFERER);
     }
     $id = $specialid;
     if ($info['css']) {
         $css_param = unserialize($info['css']);
     }
     if (!$info['ispage']) {
         $type_db = pc_base::load_model('type_model');
         $types = $type_db->select(array('module' => 'special', 'parentid' => $id), '*', '', '`listorder` ASC, `typeid` ASC');
     }
     extract($info);
     $css = get_css($css_param);
     $template = $info['index_template'] ? $info['index_template'] : 'index';
     pc_base::load_app_func('global', 'template');
     ob_start();
     include template('special', $template);
     $html = ob_get_contents();
     ob_clean();
     $html = visualization($html, 'default', 'test', 'block.html');
     include $this->admin_tpl('template_edit');
 }
Пример #10
0
	 /**
	 *	申请友情链接 
	 */
	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');
 		}
	} 
Пример #11
0
	function __construct() {
		parent::__construct();
		$this->db = pc_base::load_model('linkage_model');
		$this->sites = pc_base::load_app_class('sites');
		pc_base::load_sys_class('form', '', 0);
		$this->childnode = array();
	}
Пример #12
0
 function __construct()
 {
     parent::__construct();
     $this->db = pc_base::load_model('plugin_model');
     $this->db_var = pc_base::load_model('plugin_var_model');
     pc_base::load_app_func('global');
 }
Пример #13
0
	public function __construct() {
		parent::__construct();
		$this->db = pc_base::load_model('release_point_model');
		if (function_exists('ftp_ssl_connect')) {
			$this->ssl = 1;
		}
	}
Пример #14
0
	public function get() {
		$id = isset($_GET['id']) && intval($_GET['id']) ? intval($_GET['id']) : exit();
		if ($data = $this->db->get_one(array('id'=>$id))) {
			if (!$str = tpl_cache('dbsource_'.$id,$data['cache'])) {
				if ($data['type'] == 1) { //自定义SQL调用
					$get_db = pc_base::load_model("get_model");
					$sql = $data['data'].(!empty($data['num']) ? " LIMIT $data[num]" : '');
					$r= $get_db->query($sql);
					while(($s = $get_db->fetch_next()) != false) {
						$str[] = $s;
					}
				} else {
					$filepath = PC_PATH.'modules'.DIRECTORY_SEPARATOR.$data['module'].DIRECTORY_SEPARATOR.'classes'.DIRECTORY_SEPARATOR.$data['module'].'_tag.class.php';
					if (file_exists($filepath)) {
						$pc_tag = pc_base::load_app_class($data['module'].'_tag', $data['module']); 
						if (!method_exists($pc_tag, $data['action'])) {
							exit();
						}
						$sql = string2array($data['data']);
						$sql['action'] = $data['action'];
						$sql['limit'] = $data['num'];
						unset($data['num']);
						$str  = $pc_tag->$data['action']($sql);
						
					} else {
						exit();
					}
				}
				if ($data['cache']) setcache('dbsource_'.$id, $str, 'tpl_data');
			}
			echo $this->_format($data['id'], $str, $data['dis_type']);
		}
	}
Пример #15
0
	function __construct() {
		$this->db = pc_base::load_model('content_model');
		pc_base::load_app_class('rssbuilder','','','0');
		$this->siteid = $_GET['siteid'] ? intval($_GET['siteid']) : '1';
		$this->rssid = intval($_GET['rssid']);
		define('SITEID', $this->siteid);
	}
Пример #16
0
	/**
	 * defalut
	 */
	function init() {
		$show_header = $show_scroll = true;
		pc_base::load_sys_class('form', '', 0);
		$this->verify_db = pc_base::load_model('member_verify_model');
		
		//搜索框
		$keyword = isset($_GET['keyword']) ? $_GET['keyword'] : '';
		$type = isset($_GET['type']) ? $_GET['type'] : '';
		$groupid = isset($_GET['groupid']) ? $_GET['groupid'] : '';
		$start_time = isset($_GET['start_time']) ? $_GET['start_time'] : date('Y-m-d', SYS_TIME-date('t', SYS_TIME)*86400);
		$end_time = isset($_GET['end_time']) ? $_GET['end_time'] : date('Y-m-d', SYS_TIME);
		$grouplist = getcache('grouplist');
		foreach($grouplist as $k=>$v) {
			$grouplist[$k] = $v['name'];
		}

		$memberinfo['totalnum'] = $this->db->count();
		$memberinfo['vipnum'] = $this->db->count(array('vip'=>1));
		$memberinfo['verifynum'] = $this->verify_db->count(array('status'=>0));

		$todaytime = strtotime(date('Y-m-d', SYS_TIME));
		$memberinfo['today_member'] = $this->db->count("`regdate` > '$todaytime'");
		
		include $this->admin_tpl('member_init');
	}
Пример #17
0
 /**
  * 推送选择界面
  */
 public function init()
 {
     if ($_POST['dosubmit']) {
         $c = pc_base::load_model('content_model');
         $c->set_model($_POST['modelid']);
         $info = array();
         $ids = explode('|', $_POST['id']);
         if (is_array($ids)) {
             foreach ($ids as $id) {
                 $info[$id] = $c->get_content($_POST['catid'], $id);
             }
         }
         $_GET['add_action'] = $_GET['add_action'] ? $_GET['add_action'] : $_GET['action'];
         $this->push->{$_GET}['add_action']($info, $_POST);
         showmessage(L('success'), '', '', 'push');
     } else {
         pc_base::load_app_func('global', 'template');
         if (method_exists($this->push, $_GET['action'])) {
             $html = $this->push->{$_GET['action']}(array('modelid' => $_GET['modelid'], 'catid' => $_GET['catid']));
             $tpl = isset($_GET['tpl']) ? 'push_to_category' : 'push_list';
             include $this->admin_tpl($tpl);
         } else {
             showmessage('CLASS METHOD NO EXISTS!', 'blank');
         }
     }
 }
Пример #18
0
 function __construct()
 {
     $admin_username = param::get_cookie('admin_username');
     $userid = $_SESSION['userid'];
     $this->db = pc_base::load_model('badword_model');
     parent::__construct();
 }
Пример #19
0
 /**
  * 按照模型搜索
  */
 public function lists()
 {
     $tag = safe_replace(addslashes($_GET['tag']));
     $keyword_data_db = pc_base::load_model('keyword_data_model');
     //获取标签id
     $r = $this->keyword_db->get_one(array('keyword' => $tag, 'siteid' => $this->siteid), 'id');
     if (!$r['id']) {
         showmessage('不存在此关键字!');
     }
     $tagid = intval($r['id']);
     $page = max($_GET['page'], 1);
     $pagesize = 20;
     $where = '`tagid`=\'' . $tagid . '\' AND `siteid`=' . $this->siteid;
     $infos = $keyword_data_db->listinfo($where, '`id` DESC', $page, $pagesize);
     $pages = $keyword_data_db->pages;
     $total = $keyword_data_db->number;
     if (is_array($infos)) {
         $datas = array();
         foreach ($infos as $info) {
             list($contentid, $modelid) = explode('-', $info['contentid']);
             $this->db->set_model($modelid);
             $res = $this->db->get_one(array('id' => $contentid), 'title, description, url, inputtime, style');
             $res['title'] = str_replace($tag, '<font color="#f00">' . $tag . '</font>', $res['title']);
             $res['description'] = str_replace($tag, '<font color="#f00">' . $tag . '</font>', $res['description']);
             $datas[] = $res;
         }
     }
     $SEO = seo($siteid, '', $tag);
     include template('content', 'tag_list');
 }
Пример #20
0
 function __construct()
 {
     parent::__construct();
     $this->sites = pc_base::load_app_class('sites', 'admin');
     $this->db = pc_base::load_model('wap_model');
     $this->type_db = pc_base::load_model('wap_type_model');
 }
Пример #21
0
 public function update()
 {
     set_time_limit(120);
     $old_attachment_path = isset($_POST['old_attachment_path']) && trim($_POST['old_attachment_path']) ? trim($_POST['old_attachment_path']) : showmessage(L('old_attachment_address_empty'));
     $new_attachment_path = isset($_POST['new_attachment_path']) && trim($_POST['new_attachment_path']) ? trim($_POST['new_attachment_path']) : showmessage(L('new_attachment_address_empty'));
     //获取数据表列表
     $db = pc_base::load_model('site_model');
     $r = $db->query("show tables");
     $r = $db->fetch_array($db_list);
     foreach ($r as $k => $v) {
         $v = array_pop($v);
         if (strpos($v, $db->db_tablepre) === false) {
             continue;
         }
         $table_name = str_replace($db->db_tablepre, '', $v);
         //获取每个表的数据表结构
         if (!($modle_table_db = pc_base::load_model($table_name . '_model'))) {
             $modle_table_db = $db;
         }
         $s = $modle_table_db->get_fields($table_name);
         if ($s) {
             $sql = '';
             foreach ($s as $key => $val) {
                 //对数据表进行过滤,只有CHAR、TEXT或mediumtext类型的字段才可以保存下附件的地址。
                 if (preg_match('/(char|text|mediumtext)+/i', $val)) {
                     $sql .= !empty($sql) ? ", `{$key}`=replace(`{$key}`, '{$old_attachment_path}', '{$new_attachment_path}')" : "`{$key}`=replace(`{$key}`, '{$old_attachment_path}', '{$new_attachment_path}')";
                 }
             }
             if (!empty($sql)) {
                 $modle_table_db->query("UPDATE " . $db->db_tablepre . $table_name . " SET {$sql}");
             }
         }
     }
     showmessage(L('operation_success'));
 }
Пример #22
0
 function __construct()
 {
     $this->db = pc_base::load_model('copyfrom_model');
     pc_base::load_sys_class('form', '', 0);
     parent::__construct();
     $this->siteid = $this->get_siteid();
 }
Пример #23
0
 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');
 }
Пример #24
0
 function __construct()
 {
     $this->comment_data_db = pc_base::load_model('comment_data_model');
     $this->comment_check_db = pc_base::load_model('comment_check_model');
     parent::__construct();
     $this->comment = pc_base::load_app_class('comment');
 }
Пример #25
0
 public function __construct()
 {
     parent::__construct();
     //if (!module_exists(ROUTE_M)) showmessage(L('module_not_exists'));
     $this->username = param::get_cookie('admin_username');
     $this->db = pc_base::load_model('announce_model');
 }
Пример #26
0
 /**
  * 推荐位编辑
  */
 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');
     }
 }
Пример #27
0
 function __construct()
 {
     parent::__construct();
     $this->db = pc_base::load_model('admin_model');
     $this->role_db = pc_base::load_model('admin_role_model');
     $this->op = pc_base::load_app_class('admin_op');
 }
Пример #28
0
 function __construct()
 {
     $this->db = pc_base::load_model('content_model');
     $this->_userid = param::get_cookie('_userid');
     $this->_username = param::get_cookie('_username');
     $this->_groupid = param::get_cookie('_groupid');
 }
Пример #29
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');
 }
Пример #30
0
	function __construct() {
		parent::__construct();
		$this->comment_setting_db = pc_base::load_model('comment_setting_model');
		$this->comment_data_db = pc_base::load_model('comment_data_model');
		$this->comment_db = pc_base::load_model('comment_model');
		$this->siteid = $this->get_siteid();
	}