コード例 #1
0
 public function __construct()
 {
     $this->db_config = pc_base::load_config('database');
     $this->db_setting = 'default';
     parent::__construct();
     $this->table_name = $this->db_tablepre . 'index_mapping';
 }
コード例 #2
0
 public function __construct()
 {
     $this->db_config = pc_base::load_config('database');
     $this->db_setting = 'reviews';
     $this->table_name = $this->old_table_name = 'reviews_check';
     parent::__construct();
 }
コード例 #3
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]', '“', '”', ' '), '', strip_tags($info['content'])), 200);
    $info['username'] = "******";
    $info['inputtime'] = '';
    echo "1";
    if ($db->add_content($info)) {
        return true;
    }
    return false;
}
コード例 #4
0
ファイル: xpush.php プロジェクト: baowzh/fulianweb
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;
}
コード例 #5
0
	function __construct() {
		$this->db_config = pc_base::load_config('database');
		$this->db_setting = 'default';
		$this->table_name = 'product_pic';
        $this->product_cat = pc_base::load_model('product_cat_model');
		parent::__construct();
	}
コード例 #6
0
 function __construct()
 {
     $this->db_config = pc_base::load_config('database');
     $this->db_setting = 'default';
     $this->table_name = 'dianping_type';
     parent::__construct();
 }
コード例 #7
0
 public function __construct()
 {
     $this->db_config = pc_base::load_config('database');
     $this->db_setting = 'default';
     $this->table_name = 'search';
     parent::__construct();
 }
コード例 #8
0
function sys_auth($string, $operation = 'ENCODE', $key = '', $expiry = 0)
{
    $key_length = 4;
    $key = md5($key != '' ? $key : pc_base::load_config('system', 'auth_key'));
    $fixedkey = md5($key);
    $egiskeys = md5(substr($fixedkey, 16, 16));
    $runtokey = $key_length ? $operation == 'ENCODE' ? substr(md5(microtime(true)), -$key_length) : substr($string, 0, $key_length) : '';
    $keys = md5(substr($runtokey, 0, 16) . substr($fixedkey, 0, 16) . substr($runtokey, 16) . substr($fixedkey, 16));
    $string = $operation == 'ENCODE' ? sprintf('%010d', $expiry ? $expiry + time() : 0) . substr(md5($string . $egiskeys), 0, 16) . $string : base64_decode(substr($string, $key_length));
    $i = 0;
    $result = '';
    $string_length = strlen($string);
    for ($i = 0; $i < $string_length; $i++) {
        $result .= chr(ord($string[$i]) ^ ord($keys[$i % 32]));
    }
    if ($operation == 'ENCODE') {
        return $runtokey . str_replace('=', '', base64_encode($result));
    } else {
        if ((substr($result, 0, 10) == 0 || substr($result, 0, 10) - time() > 0) && substr($result, 10, 16) == substr(md5(substr($result, 26) . $egiskeys), 0, 16)) {
            return substr($result, 26);
        } else {
            return '';
        }
    }
}
コード例 #9
0
 /**
  * 按月份创建表
  */
 private function create_table()
 {
     $data_info = pc_base::load_config('database', $this->db_setting);
     $charset = $data_info['charset'];
     $sql = "CREATE TABLE IF NOT EXISTS `" . $this->table_name . "` (\r\n  \t\t`id` int(10) unsigned NOT NULL auto_increment,\r\n  \t\t`pid` smallint(5) unsigned NOT NULL default '0',\r\n  \t\t`siteid` smallint(5) unsigned NOT NULL default '0',\r\n  \t\t`spaceid` smallint(5) unsigned NOT NULL default '0',\r\n  \t\t`username` char(20) NOT NULL,\r\n  \t\t`area` char(40) NOT NULL,\r\n  \t\t`ip` char(15) NOT NULL,\r\n  \t\t`referer` char(120) NOT NULL,\r\n  \t\t`clicktime` int(10) unsigned NOT NULL default '0',\r\n  \t\t`type` tinyint(1) unsigned NOT NULL default '1',\r\n  \t\tPRIMARY KEY  (`id`),\r\n  \t\tKEY `pid` (`pid`,`type`,`ip`)\r\n\t\t) ENGINE=MyISAM DEFAULT CHARSET=" . $charset . " ;";
     $this->db->query($sql);
 }
コード例 #10
0
 public function __construct()
 {
     $this->db_config = pc_base::load_config('database');
     $this->db_setting = 'comment';
     $this->table_name = 'comment_setting';
     parent::__construct();
 }
コード例 #11
0
 public function __construct()
 {
     $this->db_config = pc_base::load_config('database');
     $this->db_setting = 'phpsso';
     $this->table_name = 'members';
     parent::__construct();
 }
コード例 #12
0
	function __construct() {
		$this->db_config = pc_base::load_config('database');
		$this->db_setting = 'default';
		//$this->db_tablepre = $this->db_config[$this->db_setting]['tablepre'];
		$this->table_name = 'vote_option';
		parent::__construct();
	}
コード例 #13
0
 function __construct()
 {
     $this->db_config = pc_base::load_config('database');
     $this->db_setting = 'default';
     $this->table_name = 'category_priv';
     parent::__construct();
 }
コード例 #14
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');
 }
コード例 #15
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();
 }
コード例 #16
0
	public function __construct() {
		$this->db_config = pc_base::load_config('database');
		$this->db_setting = 'default';
		$this->table_name = 'model';
		parent::__construct();
		$this->charset = $this->db_config[$this->db_setting]['charset'];
	}
コード例 #17
0
 function __construct()
 {
     $path = pc_base::load_config('system', 'session_n') > 0 ? pc_base::load_config('system', 'session_n') . ';' . pc_base::load_config('system', 'session_savepath') : pc_base::load_config('system', 'session_savepath');
     ini_set('session.save_handler', 'files');
     session_save_path($path);
     session_start();
 }
コード例 #18
0
ファイル: cache_my.class.php プロジェクト: zhouzhouxs/Progect
 public function connect_memcache()
 {
     //连接memcache
     $options = array('host' => pc_base::load_config('system', 'memcache_host'), 'port' => pc_base::load_config('system', 'memcache_port'), 'timeout' => pc_base::load_config('system', 'memcache_timeout'), 'persistent' => pc_base::load_config('system', 'memcache_persistent'));
     $this->memcache = new Memcache();
     $func = $options['persistent'] ? 'pconnect' : 'connect';
     $options['timeout'] === false ? $this->memcache->{$func}($options['host'], $options['port']) : $this->memcache->{$func}($options['host'], $options['port'], $options['timeout']);
 }
コード例 #19
0
 public function __construct()
 {
     $this->db_config = pc_base::load_config('database');
     $this->db_setting = 'default';
     $this->table_name = 'orders';
     //仅仅需要修改这里的对应的表名,不带前缀
     parent::__construct();
 }
コード例 #20
0
 	public function __construct() {
		$this->db_config = pc_base::load_config('database');
		$this->header = "<\x3Fxml version=\"1.0\" encoding=\"UTF-8\"\x3F>\n\t<urlset xmlns=\"http://www.sitemaps.org/schemas/sitemap/0.9\">";
	    $this->charset = "UTF-8";
	    $this->footer = "\t</urlset>\n";
	    $this->items = array();
		parent::__construct();
	}
コード例 #21
0
	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();
	}
コード例 #22
0
ファイル: ask_url.class.php プロジェクト: zhouzhouxs/Progect
 public function __construct()
 {
     $this->urlrules = getcache('urlrules', 'commons');
     $this->M = new_html_special_chars(getcache('ask', 'commons'));
     self::set_siteid();
     $this->categorys = getcache('category_ask_' . $this->siteid, 'commons');
     $this->html_root = pc_base::load_config('system', 'html_root');
 }
コード例 #23
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);
         }
     }
 }
コード例 #24
0
ファイル: sites.class.php プロジェクト: panhongsheng/zl_cms
	/**
	 * 设置站点缓存
	 */
	public function set_cache() {
		$list = $this->db->select();
		$data = array();
		foreach ($list as $key=>$val) {
			$data[$val['siteid']] = $val;
			$data[$val['siteid']]['url'] = $val['domain'] ? $val['domain'] : pc_base::load_config('system', 'web_path').$val['dirname'].'/';
		}
		setcache('sitelist', $data, 'commons');
	}
コード例 #25
0
ファイル: cmsware_model.class.php プロジェクト: lestatmq/cms
 public function __construct()
 {
     $this->db_config = pc_base::load_config('database');
     $this->db_setting = 'cmsware';
     parent::__construct();
     $this->siteid = get_siteid();
     $this->db->query("set character_set_client=utf8");
     $this->db->query("set character_set_results=utf8");
 }
コード例 #26
0
ファイル: html.class.php プロジェクト: panhongsheng/zl_cms
	public function __construct() {
		$this->queue = pc_base::load_model('queue_model');
		define('HTML',true);
		self::set_siteid();
		$this->categorys = getcache('category_content_'.$this->siteid,'commons');
		$this->url = pc_base::load_app_class('url', 'content');
		$this->html_root = pc_base::load_config('system','html_root');
		$this->sitelist = getcache('sitelist','commons');
	}
コード例 #27
0
 function __construct()
 {
     $this->db_config = pc_base::load_config('database');
     $this->db_m = pc_base::load_model('member_model');
     $this->db_setting = 'default';
     $this->table_name = 'ask_credit';
     $this->table_member = 'member';
     parent::__construct();
     $this->siteid = get_siteid();
 }
コード例 #28
0
 public static function get_instance2($db_config = '')
 {
     //不共用数据库,适合多个数据库的情况 2012.12.8
     if ($db_config == '') {
         $db_config = pc_base::load_config('database');
     }
     $db_factory = new db_factory();
     $db_factory->db_config = $db_config;
     return $db_factory;
 }
コード例 #29
0
	/**
	 * 返回当前终级类对象的实例
	 * @param $db_config 数据库配置
	 * @return object
	 */
	public static function get_instance($db_config = '') {
		if($db_config == '') {
			$db_config = pc_base::load_config('database');
		}
		if(db_factory::$db_factory == '') {
			db_factory::$db_factory = new db_factory();
		}
		if($db_config != '' && $db_config != db_factory::$db_factory->db_config) db_factory::$db_factory->db_config = array_merge($db_config, db_factory::$db_factory->db_config);
		return db_factory::$db_factory;
	}
コード例 #30
0
 function __construct()
 {
     $this->db_config = pc_base::load_config('database');
     $this->credit = pc_base::load_model('ask_credit_model');
     $this->db_setting = 'default';
     $this->table_name = 'ask_posts';
     $this->table_member = 'member';
     $this->siteid = get_siteid();
     $this->CATEGORYS = getcache('category_ask_' . $this->siteid, 'commons');
     parent::__construct();
 }