Example #1
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');
 }
Example #2
0
	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;
	}
Example #3
0
 /**
  * ***************************************
  * 发表留言外部暴露接口
  * ***************************************
  */
 public function publish()
 {
     extract($this->setting);
     //是否允许游客发表评论
     if (!$allow_guest_post) {
         if (!param::get_cookie('_userid') && !$_SESSION['userid']) {
             showmessage('您需要登录才可以发表留言', HTTP_REFERER);
         }
     }
     //是否启用了验证码
     if ($use_code) {
         if (isset($_POST['code'])) {
             $code = isset($_POST['code']) && trim($_POST['code']) ? trim($_POST['code']) : showmessage('请输入验证码', HTTP_REFERER);
             if ($_SESSION['code'] != strtolower($code)) {
                 showmessage('验证码错误', HTTP_REFERER);
             }
         }
     }
     $r = $this->api->add();
     if (false !== $r) {
         showmessage('发表成功', HTTP_REFERER);
     } else {
         showmessage('发表失败', HTTP_REFERER);
     }
 }
Example #4
0
 public function init()
 {
     $page = isset($_GET['page']) && intval($_GET['page']) ? intval($_GET['page']) : 1;
     $userid = param::get_cookie('_userid');
     $sql = " `userid` = '{$userid}'";
     if (isset($_GET['dosubmit'])) {
         $type = isset($_GET['type']) && intval($_GET['type']) ? intval($_GET['type']) : '';
         $endtime = isset($_GET['endtime']) && trim($_GET['endtime']) ? strtotime(trim($_GET['endtime'])) : '';
         $starttime = isset($_GET['starttime']) && trim($_GET['starttime']) ? strtotime(trim($_GET['starttime'])) : '';
         if (!empty($starttime) && empty($endtime)) {
             $endtime = SYS_TIME;
         }
         if (!empty($starttime) && !empty($endtime) && $endtime < $starttime) {
             showmessage(L('wrong_time_over_time_to_time_less_than'));
         }
         if (!empty($starttime)) {
             $sql .= $sql ? " AND `creat_at` BETWEEN '{$starttime}' AND '{$endtime}' " : " `creat_at` BETWEEN '{$starttime}' AND '{$endtime}' ";
         }
         if (!empty($type)) {
             $sql .= $sql ? " AND `type` = '{$type}' " : " `type` = '{$type}'";
         }
     }
     $list = $this->spend_db->listinfo($sql, '`id` desc', $page);
     $pages = $this->spend_db->pages;
     include template('pay', 'spend_list');
 }
Example #5
0
	function editor($field, $value, $fieldinfo) {
		$grouplist = getcache('grouplist','member');
		$_groupid = param::get_cookie('_groupid');
		$grouplist = $grouplist[$_groupid];
		extract($fieldinfo);
		extract(string2array($setting));
		$disabled_page = isset($disabled_page) ? $disabled_page : 0;
		if(!$height) $height = 300;
		$allowupload = defined('IN_ADMIN') ? 1 : $grouplist['allowattachment'] ? 1: 0;
		if(!$value) $value = $defaultvalue;
		if($minlength || $pattern) $allow_empty = '';
		if($minlength) $this->formValidator .= '$("#'.$field.'").formValidator({'.$allow_empty.'onshow:"",onfocus:"'.$errortips.'"}).functionValidator({
	    fun:function(val,elem){
			var oEditor = CKEDITOR.instances.'.$field.';
			var data = oEditor.getData();
	        if($(\'#islink\').attr(\'checked\')){
			    return true;
		    } else if(($(\'#islink\').attr(\'checked\')==false) && (data==\'\')){
			    return "'.$errortips.'";
		    } else if (data==\'\' || $.trim(data)==\'\') {
				return "'.$errortips.'";
			}
			return true;
		}
	});';
		return "<div id='{$field}_tip'></div>".'<textarea name="info['.$field.']" id="'.$field.'" boxid="'.$field.'">'.$value.'</textarea>'.form::editor($field,$toolbar,'content',$this->catid,'',$allowupload,1,'',$height,$disabled_page);
	}
Example #6
0
 function get($data = array())
 {
     $_roleid = param::get_cookie('_roleid');
     $_groupid = param::get_cookie('_groupid');
     $this->data = $data;
     if (isset($data['id'])) {
         $this->id = $data['id'];
     }
     $info = array();
     foreach ($this->fields as $field => $v) {
         if (defined('IN_ADMIN')) {
             if ($v['disabled'] || $v['iscore'] || check_in($_roleid, $v['unsetroleids']) || check_in($_groupid, $v['unsetgroupids'])) {
                 continue;
             }
         } else {
             if ($v['disabled'] || $v['iscore'] || !$v['isadd'] || check_in($_roleid, $v['unsetroleids']) || check_in($_groupid, $v['unsetgroupids'])) {
                 continue;
             }
         }
         $func = $v['formtype'];
         $value = isset($data[$field]) ? new_html_special_chars($data[$field]) : '';
         if ($func == 'pages' && isset($data['maxcharperpage'])) {
             $value = $data['paginationtype'] . '|' . $data['maxcharperpage'];
         }
         if (!method_exists($this, $func)) {
             continue;
         }
         $form = $this->{$func}($field, $value, $v);
         if ($form !== false) {
             $star = $v['minlength'] || $v['pattern'] ? 1 : 0;
             $info[$field] = array('name' => $v['name'], 'tips' => $v['tips'], 'form' => $form, 'star' => $star, 'isbase' => $v['isbase'], 'isomnipotent' => $v['isomnipotent'], 'formtype' => $v['formtype']);
         }
     }
     return $info;
 }
Example #7
0
	function manage() {
		$tree = pc_base::load_sys_class('tree');
		$tree->icon = array('&nbsp;&nbsp;&nbsp;│ ','&nbsp;&nbsp;&nbsp;├─ ','&nbsp;&nbsp;&nbsp;└─ ');
		$tree->nbsp = '&nbsp;&nbsp;&nbsp;';
		$userid = $_SESSION['userid'];
		$admin_username = param::get_cookie('admin_username');

		$result = $this->db->select('','*','','listorder ASC,id DESC');

		foreach($result as $r) {
			$r['cname'] = L($r['name'], '', 'member_menu');
			$r['str_manage'] = '<a href="?m=member&c=member_menu&a=edit&id='.$r['id'].'&menuid='.$_GET['menuid'].'">'.L('edit').'</a> | <a href="javascript:confirmurl(\'?m=member&c=member_menu&a=delete&id='.$r['id'].'&menuid='.$_GET['menuid'].'\',\''.L('confirm',array('message'=>$r['cname'])).'\')">'.L('delete').'</a> ';
			$array[] = $r;
		}

		$str  = "<tr>
					<td align='center'><input name='listorders[\$id]' type='text' size='3' value='\$listorder' class='input-text-c'></td>
					<td align='center'>\$id</td>
					<td >\$spacer\$cname</td>
					<td align='center'>\$str_manage</td>
				</tr>";
		$tree->init($array);
		$categorys = $tree->get_tree(0, $str);
		include $this->admin_tpl('member_menu');
	}
 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");
 }
Example #9
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');
 }
 function get($data = array())
 {
     $_groupid = param::get_cookie('_groupid');
     $this->data = $data;
     if (isset($data['id'])) {
         $this->id = $data['id'];
     }
     $info = array();
     $info = array();
     if (is_array($this->fields)) {
         foreach ($this->fields as $field => $v) {
             $func = $v['formtype'];
             $value = isset($data[$field]) ? new_html_special_chars($data[$field]) : '';
             if ($func == 'pages' && isset($data['maxcharperpage'])) {
                 $value = $data['paginationtype'] . '|' . $data['maxcharperpage'];
             }
             if (!method_exists($this, $func)) {
                 continue;
             }
             $form = $this->{$func}($field, $value, $v);
             if ($form !== false) {
                 $star = $v['minlength'] || $v['pattern'] ? 1 : 0;
                 $info[$field] = array('name' => $v['name'], 'tips' => $v['tips'], 'form' => $form, 'star' => $star, 'isomnipotent' => $v['isomnipotent'], 'formtype' => $v['formtype']);
             }
         }
     }
     return $info;
 }
Example #11
0
 function __construct()
 {
     $admin_username = param::get_cookie('admin_username');
     $userid = $_SESSION['userid'];
     $this->db = pc_base::load_model('badword_model');
     parent::__construct();
 }
Example #12
0
	function __construct() {
		$this->userid = param::get_cookie('_userid');
		if(!$this->userid) {
			header("Location: index.php?m=member&c=index&a=login&forward=".urlencode(get_url()));
			exit;
		}
		$this->username = param::get_cookie('_username');
	}
	function __construct() {
		$this->db_config = pc_base::load_config('database');
		$this->db_setting = 'default';
		$this->table_name = 'message';
		$this->_username = param::get_cookie('_username');
		$this->_userid = param::get_cookie('_userid');
		parent::__construct();
	}
Example #14
0
 	public function __construct() {
		$this->message_db = pc_base::load_model('message_model');
		$this->message_group_db = pc_base::load_model('message_group_model');
		$this->message_data_db = pc_base::load_model('message_data_model');
		$this->_username = param::get_cookie('_username');
		$this->_userid = param::get_cookie('_userid');
		$this->_groupid = get_memberinfo($this->_userid,'groupid');
 	}
Example #15
0
 /**
  * 判断用户是否已经登陆
  */
 public final function check_member()
 {
     $phpcms_auth = param::get_cookie('auth');
     if (ROUTE_M == 'member' && ROUTE_C == 'index' && in_array(ROUTE_A, array('login', 'register', 'mini', 'send_newmail'))) {
         if ($phpcms_auth && ROUTE_A != 'mini') {
             showmessage(L('login_success', '', 'member'), 'index.php?m=member&c=index');
         } else {
             return true;
         }
     } else {
         //判断是否存在auth cookie
         if ($phpcms_auth) {
             $auth_key = $auth_key = md5(pc_base::load_config('system', 'auth_key') . $_SERVER['HTTP_USER_AGENT']);
             list($userid, $password) = explode("\t", sys_auth($phpcms_auth, 'DECODE', $auth_key));
             //验证用户,获取用户信息
             $this->memberinfo = $this->db->get_one(array('userid' => $userid));
             //获取用户模型信息
             $this->db->set_model($this->memberinfo['modelid']);
             $this->_member_modelinfo = $this->db->get_one(array('userid' => $userid));
             $this->_member_modelinfo = $this->_member_modelinfo ? $this->_member_modelinfo : array();
             $this->db->set_model();
             if (is_array($this->memberinfo)) {
                 $this->memberinfo = array_merge($this->memberinfo, $this->_member_modelinfo);
             }
             if ($this->memberinfo && $this->memberinfo['password'] === $password) {
                 if (!defined('SITEID')) {
                     define('SITEID', $this->memberinfo['siteid']);
                 }
                 if ($this->memberinfo['groupid'] == 1) {
                     param::set_cookie('auth', '');
                     param::set_cookie('_userid', '');
                     param::set_cookie('_username', '');
                     param::set_cookie('_groupid', '');
                     showmessage(L('userid_banned_by_administrator', '', 'member'), 'index.php?m=member&c=index&a=login');
                 } elseif ($this->memberinfo['groupid'] == 7) {
                     param::set_cookie('auth', '');
                     param::set_cookie('_userid', '');
                     param::set_cookie('_groupid', '');
                     //设置当前登录待验证账号COOKIE,为重发邮件所用
                     param::set_cookie('_regusername', $this->memberinfo['username']);
                     param::set_cookie('_reguserid', $this->memberinfo['userid']);
                     param::set_cookie('_reguseruid', $this->memberinfo['phpssouid']);
                     param::set_cookie('email', $this->memberinfo['email']);
                     showmessage(L('need_emial_authentication', '', 'member'), 'index.php?m=member&c=index&a=register&t=2');
                 }
             } else {
                 param::set_cookie('auth', '');
                 param::set_cookie('_userid', '');
                 param::set_cookie('_username', '');
                 param::set_cookie('_groupid', '');
             }
             unset($userid, $password, $phpcms_auth, $auth_key);
         } else {
             $forward = isset($_GET['forward']) ? urlencode($_GET['forward']) : urlencode(get_url());
             showmessage(L('please_login', '', 'member'), 'index.php?m=member&c=index&a=login&forward=' . $forward);
         }
     }
 }
Example #16
0
 /**
  * ÉèÖÃÕ¾µãid
  */
 private function set_siteid()
 {
     if (defined('IN_ADMIN')) {
         $this->siteid = get_siteid();
     } else {
         param::get_cookie('siteid');
         $this->siteid = param::get_cookie('siteid');
     }
 }
Example #17
0
 /**
  * **************************************************
  * 会员中心 我的留言列表
  * **************************************************
  */
 public function init()
 {
     $page = $_GET['page'];
     $user_id = param::get_cookie('_userid');
     $res = $this->api->show(array('user_id' => $user_id, 'parent_id' => 0), $page, 10);
     $list = $res['data'];
     $pages = $list['pages'];
     include template('guestbook', 'guestbook_list');
 }
Example #18
0
 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 
 }
Example #19
0
 public function __construct()
 {
     pc_base::load_app_class('ku6api', 'video', 0);
     $this->userid = param::get_cookie('userid');
     $this->setting = getcache('video');
     if (empty($this->setting)) {
         showmessage(L('module_not_exists'));
     }
     $this->ku6api = new ku6api($this->setting['sn'], $this->setting['skey']);
 }
Example #20
0
 public function __construct($value = '')
 {
     $this->db = pc_base::load_model($this->_model);
     $this->_userid = param::get_cookie('_userid');
     $this->_username = param::get_cookie('_username');
     $this->_groupid = param::get_cookie('_groupid');
     if (!$this->_userid) {
         showmessage("请登录", 'index.php?m=member&c=index&a=login');
     }
 }
Example #21
0
 /**
  * 管理员管理列表
  */
 public function init()
 {
     $userid = $_SESSION['userid'];
     $admin_username = param::get_cookie('admin_username');
     $page = $_GET['page'] ? intval($_GET['page']) : '1';
     $infos = $this->db->listinfo('', '', $page, 20);
     $pages = $this->db->pages;
     $roles = getcache('role', 'commons');
     include $this->admin_tpl('admin_list');
 }
Example #22
0
    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];
    }
Example #23
0
	function __construct() {
		parent::__construct();
		pc_base::load_app_func('global');
		$this->upload_url = pc_base::load_config('system','upload_url');
		$this->upload_path = pc_base::load_config('system','upload_path');		
		$this->imgext = array('jpg','gif','png','bmp','jpeg');
		$this->db= pc_base::load_model('attachment_model');
		$this->attachment = pc_base::load_sys_class('attachment');
		$this->admin_username = param::get_cookie('admin_username');
		$this->siteid = $this->get_siteid();
	}	
Example #24
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');
     //初始化附件类
     pc_base::load_sys_class('attachment', '', 0);
     $this->siteid = param::get_cookie('siteid');
     $this->attachment = new attachment('content', '0', $this->siteid);
 }
Example #25
0
 function __construct()
 {
     pc_base::load_app_func('global');
     pc_base::load_sys_class('format', '', 0);
     $this->dianping = pc_base::load_model('dianping_model');
     $this->dianping_data = pc_base::load_model('dianping_data_model');
     //list($this->modules, $contentid, $this->siteid) = decode_reviewsid($this->reviewsid);
     $this->username = param::get_cookie('_username');
     $this->userid = param::get_cookie('_userid');
     $this->siteid = get_siteid();
     define('SITEID', $this->siteid);
 }
Example #26
0
	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;
	} 
Example #27
0
 /**
  * 
  * add 添加视频方法,将视频入库到视频库中
  * @param array $data 视频信息数据
  */
 public function add($data = array())
 {
     if (is_array($data) && !empty($data)) {
         $data['status'] = 1;
         $data['userid'] = defined('IN_ADMIN') ? 0 : intval(param::get_cookie('_userid'));
         $data['vid'] = safe_replace($data['vid']);
         $vid = $this->db->insert($data, true);
         return $vid ? $vid : false;
     } else {
         return false;
     }
 }
Example #28
0
File: index.php Project: hxzyzz/ddc
	function __construct() {
		pc_base::load_app_func('global');
		$this->vote = pc_base::load_model('vote_subject_model');//投票标题
		$this->vote_option = pc_base::load_model('vote_option_model');//投票选项
		$this->vote_data = pc_base::load_model('vote_data_model'); //投票统计的数据模型
		$this->username = param::get_cookie('_username');
		$this->userid = param::get_cookie('_userid'); 
		$this->ip = ip();
		
		$siteid = isset($_GET['siteid']) ? intval($_GET['siteid']) : get_siteid();
  		define("SITEID",$siteid);
 	}
Example #29
0
 function get($data = array())
 {
     $_groupid = param::get_cookie('_groupid');
     $this->data = $data;
     if (isset($data['id'])) {
         $this->id = $data['id'];
     }
     $info = array();
     $this->content_url = $data['url'];
     foreach ($this->fields as $field => $v) {
         if (defined('IN_ADMIN')) {
             if ($v['iscore'] || check_in($_SESSION['roleid'], $v['unsetroleids'])) {
                 continue;
             }
         } else {
             if ($v['iscore'] || !$v['isadd'] || check_in($_groupid, $v['unsetgroupids'])) {
                 continue;
             }
         }
         $func = $v['formtype'];
         $value = isset($data[$field]) ? htmlspecialchars($data[$field], ENT_QUOTES) : '';
         if ($func == 'pages' && isset($data['maxcharperpage'])) {
             $value = $data['paginationtype'] . '|' . $data['maxcharperpage'];
         }
         if (!method_exists($this, $func)) {
             $v['isbase'] ? $info['base'][$field] = array() : ($info['senior'][$field] = array());
             //3.31 实现自定义字段的排序
             continue;
             //3.31 实现自定义字段的排序
         }
         $form = $this->{$func}($field, $value, $v);
         if ($form !== false) {
             if (defined('IN_ADMIN')) {
                 if ($v['isbase']) {
                     $star = $v['minlength'] || $v['pattern'] ? 1 : 0;
                     $info['base'][$field] = array('name' => $v['name'], 'tips' => $v['tips'], 'form' => $form, 'star' => $star, 'isomnipotent' => $v['isomnipotent'], 'formtype' => $v['formtype']);
                 } else {
                     $star = $v['minlength'] || $v['pattern'] ? 1 : 0;
                     $info['senior'][$field] = array('name' => $v['name'], 'tips' => $v['tips'], 'form' => $form, 'star' => $star, 'isomnipotent' => $v['isomnipotent'], 'formtype' => $v['formtype']);
                 }
             } else {
                 $star = $v['minlength'] || $v['pattern'] ? 1 : 0;
                 $info[$field] = array('name' => $v['name'], 'tips' => $v['tips'], 'form' => $form, 'star' => $star, 'isomnipotent' => $v['isomnipotent'], 'formtype' => $v['formtype']);
             }
         }
     }
     /*****3.22  试验*****************/
     //pc_base::load_app_func('add_field');//引入函数
     //add_field($this->modelid,$info,$data);
     /*****3.22  试验end**************************/
     return $info;
 }
Example #30
0
File: index.php Project: hxzyzz/ddc
	function __construct() {
		parent::__construct();
		$this->message_db = pc_base::load_model('message_model');
		$this->message_group_db = pc_base::load_model('message_group_model');
		$this->message_data_db = pc_base::load_model('message_data_model');
		$this->_username = param::get_cookie('_username');
		$this->_userid = param::get_cookie('_userid');
		$this->_groupid = get_memberinfo($this->_userid,'groupid');
		pc_base::load_app_func('global');
		//定义站点ID常量,选择模版使用
		$siteid = isset($_GET['siteid']) ? intval($_GET['siteid']) : get_siteid();
  		define("SITEID",$siteid);
  	}