/** * 附件列表 */ 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'); }
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]', '“', '”', ' '), '', strip_tags($info['content'])), 200); $info['username'] = "******"; $info['inputtime'] = ''; echo "1"; if ($db->add_content($info)) { return true; } return false; }
/** * 修改公告 */ public function edit() { $_GET['aid'] = intval($_GET['aid']); if (!$_GET['aid']) { showmessage(L('illegal_operation')); } if (isset($_POST['dosubmit'])) { $_POST['announce'] = $this->check($_POST['announce'], 'edit'); if ($this->db->update($_POST['announce'], array('aid' => $_GET['aid']))) { showmessage(L('announced_a'), HTTP_REFERER, '', 'edit'); } } else { $where = array('aid' => $_GET['aid']); $an_info = $this->db->get_one($where); pc_base::load_sys_class('form', '', 0); //获取站点模板信息 pc_base::load_app_func('global', 'admin'); $template_list = template_list($this->siteid, 0); foreach ($template_list as $k => $v) { $template_list[$v['dirname']] = $v['name'] ? $v['name'] : $v['dirname']; unset($template_list[$k]); } $show_header = $show_validator = $show_scroll = 1; include $this->admin_tpl('announce_edit'); } }
public function edit() { $id = isset($_GET['id']) && intval($_GET['id']) ? intval($_GET['id']) : showmessage('ID' . L('empty')); $data = $this->db->get_one(array('id' => $id)); if (!$data) { showmessage(L('notfound')); } if (isset($_POST['dosubmit'])) { $host = isset($_POST['host']) && trim($_POST['host']) ? trim($_POST['host']) : showmessage(L('server_address') . L('empty')); $port = isset($_POST['port']) && intval($_POST['port']) ? intval($_POST['port']) : showmessage(L('server_port') . L('empty')); $username = isset($_POST['username']) && trim($_POST['username']) ? trim($_POST['username']) : showmessage(L('username') . L('empty')); $password = isset($_POST['password']) && trim($_POST['password']) ? trim($_POST['password']) : showmessage(L('password') . L('empty')); $dbname = isset($_POST['dbname']) && trim($_POST['dbname']) ? trim($_POST['dbname']) : showmessage(L('database') . L('empty')); $dbtablepre = isset($_POST['dbtablepre']) && trim($_POST['dbtablepre']) ? trim($_POST['dbtablepre']) : ''; $charset = isset($_POST['charset']) && in_array(trim($_POST['charset']), array('gbk', 'utf8', 'gb2312', 'latin1')) ? trim($_POST['charset']) : showmessage(L('charset') . L('illegal_parameters')); $siteid = $this->get_siteid(); $sql = array('siteid' => $siteid, 'host' => $host, 'port' => $port, 'username' => $username, 'password' => $password, 'dbname' => $dbname, 'dbtablepre' => $dbtablepre, 'charset' => $charset); if ($this->db->update($sql, array('id' => $id))) { dbsource_cache(); showmessage('', '', '', 'edit'); } else { showmessage(L('operation_failure')); } } else { pc_base::load_sys_class('form', '', 0); $show_header = $show_validator = true; include $this->admin_tpl('dbsource_edit'); } }
function __construct() { parent::__construct(); $this->userid = $_SESSION['userid']; pc_base::load_sys_class('db_factory'); pc_base::load_sys_class('form'); pc_base::load_sys_func('dir'); }
function addart($catid, $title, $content) { $info = array(); $info['catid'] = $catid; $info['title'] = $title; $info['content'] = $content; $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'); $category = $categorys[3]; $modelid = $category['modelid']; $db->set_model($modelid); $setting = string2array($category['setting']); $workflowid = $setting['workflowid']; $info['status'] = 99; $info['keywords'] = get_keywords($info['title'], 3); $info['description'] = str_cut(str_replace(array("\r\n", "\t", '[page]', '[/page]', '“', '”', ' '), '', strip_tags($info['content'])), 200); $info['username'] = "******"; $info['inputtime'] = ''; if ($db->add_content($info)) { return true; } return false; }
/** * 申请友情链接 */ 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'); } }
/** * 构造函数 */ public function __construct() { $param = pc_base::load_sys_class('param'); define('ROUTE_M', $param->route_m()); define('ROUTE_C', $param->route_c()); define('ROUTE_A', $param->route_a()); $this->init(); }
function __construct() { $this->db = pc_base::load_model('copyfrom_model'); pc_base::load_sys_class('form', '', 0); parent::__construct(); $this->siteid = $this->get_siteid(); }
/** * node list */ public function manage() { $page = isset($_GET['page']) ? intval($_GET['page']) : 1; $nodelist = $this->db->listinfo(array('siteid'=>$this->get_siteid()), 'nodeid DESC', $page, 15); $pages = $this->db->pages; pc_base::load_sys_class('format', '', 0); include $this->admin_tpl('node_list'); }
/** * 专题列表 */ public function init() { $page = max(intval($_GET['page']), 1); $infos = $this->db->listinfo(array('siteid' => $this->get_siteid()), '`listorder` DESC, `id` DESC', $page, 6); pc_base::load_sys_class('format', '', 0); include $this->admin_tpl('special_list'); }
function __construct() { parent::__construct(); $this->db = pc_base::load_model('extend_setting_model'); $this->sites = pc_base::load_app_class('sites'); pc_base::load_sys_class('form', '', 0); }
function get_keywords($data, $number = 3) { $data = trim(strip_tags($data)); if (empty($data)) { return ''; } /*if(CHARSET != 'utf-8') { $data = iconv('utf-8', CHARSET, $data); } else { $data = iconv('utf-8', 'gbk', $data); }*/ $segment = pc_base::load_sys_class('segment'); return $segment->get_keyword($data); /* $http = pc_base::load_sys_class('http'); $http->post(API_URL_GET_KEYWORDS, array('siteurl'=>SITE_URL, 'charset'=>CHARSET, 'data'=>$data, 'number'=>$number)); if($http->is_ok()) { if(CHARSET != 'utf-8') { return $http->get_data(); } else { return iconv('gbk', 'utf-8', $http->get_data()); } } return ''; */ }
function system_information($data) { $update = pc_base::load_sys_class('update'); $notice_url = $update->notice(); $string = base64_decode('PHNjcmlwdCB0eXBlPSJ0ZXh0L2phdmFzY3JpcHQiPiQoIiNtYWluX2ZyYW1laWQiKS5yZW1vdmVDbGFzcygiZGlzcGxheSIpOzwvc2NyaXB0PjxkaXYgaWQ9InBocGNtc19ub3RpY2UiPjwvZGl2PjxzY3JpcHQgdHlwZT0idGV4dC9qYXZhc2NyaXB0IiBzcmM9Ik5PVElDRV9VUkwiPjwvc2NyaXB0Pg=='); echo $data . str_replace('NOTICE_URL', $notice_url, $string); }
function __construct() { $this->db = pc_base::load_model('admin_model'); $this->update_url = 'http://update.v9.phpcms.cn/index.php'; $this->http = pc_base::load_sys_class('http', '', 1); $this->uuid = $this->check_uuid(); }
private function _format($id, $data, $type) { switch ($type) { case '1': //json if (CHARSET == 'gbk') { $data = array_iconv($data, 'gbk', 'utf-8'); } return json_encode($data); break; case '2': //xml $xml = pc_base::load_sys_class('xml'); return $xml->xml_serialize($data); break; case '3': //js pc_base::load_app_func('global'); ob_start(); include template_url($id); $html = ob_get_contents(); ob_clean(); return format_js($html); break; } }
/** * 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'); }
/** * 加载缓存驱动 * @param $cache_name 缓存配置名称 * @return object */ public function load($cache_name) { $object = null; if (isset($this->cache_config[$cache_name]['type'])) { switch ($this->cache_config[$cache_name]['type']) { case 'file': $object = pc_base::load_sys_class('cache_file'); break; case 'memcache': define('MEMCACHE_HOST', $this->cache_config[$cache_name]['hostname']); define('MEMCACHE_PORT', $this->cache_config[$cache_name]['port']); define('MEMCACHE_TIMEOUT', $this->cache_config[$cache_name]['timeout']); define('MEMCACHE_DEBUG', $this->cache_config[$cache_name]['debug']); $object = pc_base::load_sys_class('cache_memcache'); break; case 'apc': $object = pc_base::load_sys_class('cache_apc'); break; default: $object = pc_base::load_sys_class('cache_file'); } } else { $object = pc_base::load_sys_class('cache_file'); } return $object; }
function __construct() { $this->member_db = pc_base::load_model('member_model'); pc_base::load_sys_class('uc_model', 'model', 0); $db_config = get_uc_database(); $this->uc_db = new uc_model($db_config); $this->applist = getcache('applist', 'admin'); }
function __construct($module='', $catid = 0,$siteid = 0,$upload_dir = '') { $this->catid = intval($catid); $this->siteid = intval($siteid)== 0 ? 1 : intval($siteid); $this->module = $module ? $module : 'content'; pc_base::load_sys_func('dir'); pc_base::load_sys_class('image','','0'); $this->upload_root = pc_base::load_config('system','upload_path'); $this->upload_func = 'copy'; $this->upload_dir = $upload_dir; }
function __construct() { parent::__construct(); $this->db = pc_base::load_model('log_model'); pc_base::load_sys_class('form'); $admin_username = param::get_cookie('admin_username'); //管理员COOKIE $userid = $_SESSION['userid']; //登陆USERID }
function __construct($formid) { $this->formid = $formid; $this->fields = getcache('formguide_field_'.$formid, 'model'); $this->siteid = get_siteid(); //初始化附件类 pc_base::load_sys_class('attachment','',0); $this->siteid = param::get_cookie('siteid'); $this->attachment = new attachment('formguide','0',$this->siteid); $this->site_config = getcache('sitelist','commons'); $this->site_config = $this->site_config[$this->siteid]; }
/** * * 默认前台显示 ... */ public function init() { $hot = isset($_GET['hot']) && intval($_GET['hot']) ? intval($_GET['hot']) : 0; $siteid =& $this->siteid; $dianpingid = $_GET['dianpingid']; //读取类型缓存,供前台调用 $dianping_type = $_GET['dianping_type']; $type_array = getcache('dianping_type', 'dianping'); $module = $_GET['module']; $modelid = $_GET['modelid']; $page = $_GET[page]; $contentid = $_GET['contentid']; if (empty($type_array[$dianping_type])) { showmessage('请检查后台配置,是否有此项分类!'); exit; } //读取当前点评配置,查看是否允许点评等选项 $setting = string2array($type_array[$dianping_type]['setting']); $is_checkuserid = $setting['is_checkuserid']; //不允许游客点评,接下来还要再根据传递的参数,判断是否要检测该用户允许点评 if ($is_checkuserid == '1') { $comment_relation = pc_base::load_model('comment_relation_model'); $sql = array("userid" => $this->userid, 'module' => $module, 'contentid' => $contentid); $allowdianping_array = $comment_relation->get_one($sql); if ($allowdianping_array) { $is_allowdianping = '1'; $del_id = $allowdianping_array['id']; } else { $is_allowdianping = '0'; $dianping_info = '你已经点评此信息,或尚未购买此产品,无法点评!'; } } else { if ($setting['guest'] == '1') { $is_allowdianping = '1'; } else { if ($this->userid) { $is_allowdianping = '1'; } else { $is_allowdianping = '0'; $dianping_info = '对不起,不允许游客点评!'; } } } pc_base::load_sys_class('form', '', 0); if (isset($_GET['iframe'])) { if ($_GET['iframe'] == 1) { include template('dianping', 'show_list'); } elseif ($_GET['iframe'] == '2') { include template('dianping', 'show_milist'); } } else { include template('dianping', 'list'); } }
public function init() { $page = isset($_GET['page']) && intval($_GET['page']) ? intval($_GET['page']) : 1; $list = $this->db->listinfo(array('fileid'=>$this->fileid), 'creat_at desc', $page, 20); if (!$list) { showmessage(L('not_exist_versioning'), 'blank'); } $pages = $this->db->pages; $show_header = true; pc_base::load_sys_class('format', '', 0); include $this->admin_tpl('template_bak_list'); }
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'); //初始化附件类 pc_base::load_sys_class('attachment', '', 0); $this->siteid = param::get_cookie('siteid'); $this->attachment = new attachment('content', '0', $this->siteid); }
function __construct() { parent::__construct(); $this->db = pc_base::load_model('message_model'); $this->group_db = pc_base::load_model('message_group_model'); $this->_username = param::get_cookie('admin_username'); $this->_userid = param::get_cookie('userid'); pc_base::load_sys_class('form'); foreach(L('select') as $key=>$value) { $trade_status[$key] = $value; } $this->trade_status = $trade_status; }
/** * 查看 */ public function public_view() { if (!$this->tablename || !isset($_GET['did']) || empty($_GET['did'])) showmessage(L('illegal_operation'), HTTP_REFERER); $did = intval($_GET['did']); $formid = intval($_GET['formid']); $info = $this->db->get_one(array('dataid'=>$did)); pc_base::load_sys_class('form', '', ''); define('CACHE_MODEL_PATH',ZLCMS_PATH.'caches'.DIRECTORY_SEPARATOR.'caches_model'.DIRECTORY_SEPARATOR.'caches_data'.DIRECTORY_SEPARATOR); require CACHE_MODEL_PATH.'formguide_output.class.php'; $formguide_output = new formguide_output($formid); $forminfos_data = $formguide_output->get($info); $fields = $formguide_output->fields; include $this->admin_tpl('formguide_info_view'); }
public function init() { $total = $this->db->count(); $page = isset($_GET['page']) && intval($_GET['page']) ? intval($_GET['page']) : 1; $pagesize = 20; $offset = ($page - 1) * $pagesize; $list = $this->db->select('', '*', $offset.','.$pagesize); pc_base::load_sys_class('format', '', 0); foreach ($list as $key=> $v) { $list[$key]['lastlogin'] = format::date($v['lastlogin'], 1); } $pages = pages($total, $page, $pagesize); include $this->admin_tpl('administrator_list'); }
public function set_cache($cache = true) { //7.6 缓存开关 if ($cache) { $this->db->cache = pc_base::load_sys_class('cache_my'); //实例化缓存对象 7.5 if (is_numeric($cache)) { $this->db->cache->expire = $cache; } //带数字则为缓存时间 } else { $this->db->cache = null; } }
function __construct() { pc_base::load_app_func('global'); pc_base::load_sys_class('format', '', 0); $this->M = new_html_special_chars(getcache('ask', 'commons')); $this->db = pc_base::load_model('ask_model'); $this->db2 = pc_base::load_model('answer_model'); $this->db3 = pc_base::load_model('category_model'); $this->db_m = pc_base::load_model('member_model'); $this->db_actor = pc_base::load_model('ask_actor_model'); $this->db_credit = pc_base::load_model('ask_credit_model'); $siteid = get_siteid(); define("SITEID", $siteid); }