예제 #1
1
 /**
  * PC标签中调用数据
  * @param array $data 配置数据
  */
 public function pc_tag($data)
 {
     $siteid = isset($data['siteid']) && intval($data['siteid']) ? intval($data['siteid']) : get_siteid();
     $r = $this->db->select(array('pos' => $data['pos'], 'siteid' => $siteid));
     $str = '';
     if (!empty($r) && is_array($r)) {
         foreach ($r as $v) {
             if (defined('IN_ADMIN') && !defined('HTML')) {
                 $str .= '<div id="block_id_' . $v['id'] . '" class="admin_block" blockid="' . $v['id'] . '">';
             }
             if ($v['type'] == '2') {
                 extract($v, EXTR_OVERWRITE);
                 $data = string2array($data);
                 if (!defined('HTML')) {
                     ob_start();
                     include $this->template_url($id);
                     $str .= ob_get_contents();
                     ob_clean();
                 } else {
                     include $this->template_url($id);
                 }
             } else {
                 $str .= $v['data'];
             }
             if (defined('IN_ADMIN') && !defined('HTML')) {
                 $str .= '</div>';
             }
         }
     }
     return $str;
 }
예제 #2
0
 /**
  * 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');
     }
 }
예제 #3
0
 public function editAction()
 {
     $userid = (int) $this->get('userid');
     $data = $this->db->setTableName('admin')->find($userid);
     $auth = string2array($data['auth']);
     $cats = get_cache('category');
     if (empty($data)) {
         $this->show_message('该用户不存在', 2);
     }
     if ($this->post('submit')) {
         $data = $this->post('data');
         if (!empty($data['password'])) {
             if (strlen($data['password']) < 6) {
                 $this->show_message('密码最少6位数', 2, 1);
             }
             $data['password'] = md5(md5($data['password']));
         } else {
             unset($data['password']);
         }
         $auth = $this->post('auth');
         $data['auth'] = array2string($auth);
         $this->db->setTableName('admin')->update($data, 'userid=?', $userid);
         $this->cacheAction();
         $this->show_message('修改成功', 1);
     }
     include $this->admin_tpl('admin_add');
 }
예제 #4
0
 public function fieldsFormDisplay($rid = 0)
 {
     //要嵌入规则编辑页的自定义内容,这里 $rid 为对应的规则编号,新增时为 0
     global $_W;
     load()->func('tpl');
     $reply = pdo_fetch("SELECT * FROM " . tablename('eso_runman_reply') . " WHERE rid = :rid", array(':rid' => $rid));
     if (empty($reply)) {
         $reply['starttime'] = time();
         $reply['endtime'] = time() + 2592000;
         $reply['setting'] = array();
     } else {
         $reply['setting'] = string2array($reply['setting']);
     }
     $sql = "SELECT * FROM " . tablename('uni_account');
     $uniaccounts = pdo_fetchall($sql);
     $accounts = array();
     if (!empty($uniaccounts)) {
         foreach ($uniaccounts as $uniaccount) {
             $accountlist = uni_accounts($uniaccount['uniacid']);
             if (!empty($accountlist)) {
                 foreach ($accountlist as $account) {
                     if (!empty($account['key']) && !empty($account['secret']) && in_array($account['level'], array(3, 4))) {
                         $accounts[$account['acid']] = $account['name'];
                     }
                 }
             }
         }
     }
     include $this->template('form');
 }
예제 #5
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']);
		}
	}
예제 #6
0
 public function edit()
 {
     $pos = strip_tags($_REQUEST['pos']);
     $name = MODULE_NAME;
     $model = M($name);
     $pk = ucfirst($model->getPk());
     $id = $_REQUEST[$model->getPk()];
     if (empty($id)) {
         $this->error(L('do_empty'));
     }
     if ($pos) {
         $map['pos'] = array('eq', $pos);
         if (APP_LANG) {
             $map['lang'] = array('eq', LANG_ID);
         }
         $vo = $model->where($map)->find();
     } else {
         $do = 'getBy' . $pk;
         $vo = $model->{$do}($id);
     }
     if ($vo['setup']) {
         $vo['setup'] = string2array($vo['setup']);
     }
     $this->assign('vo', $vo);
     $this->display();
 }
예제 #7
0
 public function set($catid, $data)
 {
     unset($data['catid']);
     $data['site'] = $this->getSiteId();
     if ($catid) {
         unset($data['typeid'], $data['modelid']);
         if ($data['synpost']) {
             //同步子栏目
             $childs = $this->child($catid);
             $childs = explode(',', $childs);
             if (count($childs) > 2) {
                 foreach ($childs as $id) {
                     if (empty($id) || $id == $catid) {
                         continue;
                     }
                     $cdata = $this->find($id);
                     $cset = string2array($cdata['setting']);
                     $cset['memberpost'] = $data['setting']['memberpost'];
                     $cset['modelpost'] = $data['setting']['modelpost'];
                     $cset['adminpost'] = $data['setting']['adminpost'];
                     $cset['rolepost'] = $data['setting']['rolepost'];
                     $cset['grouppost'] = $data['setting']['grouppost'];
                     $cset['guestpost'] = $data['setting']['guestpost'];
                     $cset['verifypost'] = $data['setting']['verifypost'];
                     $cset['verifyrole'] = $data['setting']['verifyrole'];
                     $this->update(array('setting' => array2string($cset)), 'catid=' . $id);
                 }
             }
         }
         unset($data['synpost']);
         $data['setting'] = array2string($data['setting']);
         $this->update($data, 'catid=' . $catid);
         $this->repair();
         return $catid;
     } else {
         //继承父栏目权限配置
         if (!empty($data['parentid']) && empty($data['child'])) {
             $pdata = $this->find($data['parentid']);
             $pset = string2array($pdata['setting']);
             $data['setting']['memberpost'] = $data['setting']['memberpost'] ? $data['setting']['memberpost'] : ($pset['memberpost'] ? $pset['memberpost'] : null);
             $data['setting']['modelpost'] = $data['setting']['modelpost'] ? $data['setting']['modelpost'] : ($pset['modelpost'] ? $pset['modelpost'] : null);
             $data['setting']['adminpost'] = $data['setting']['adminpost'] ? $data['setting']['adminpost'] : ($pset['adminpost'] ? $pset['adminpost'] : null);
             $data['setting']['rolepost'] = $data['setting']['rolepost'] ? $data['setting']['rolepost'] : ($pset['rolepost'] ? $pset['rolepost'] : null);
             $data['setting']['grouppost'] = $data['setting']['grouppost'] ? $data['setting']['grouppost'] : ($pset['grouppost'] ? $pset['grouppost'] : null);
             $data['setting']['guestpost'] = $data['setting']['guestpost'] ? $data['setting']['guestpost'] : ($pset['guestpost'] ? $pset['guestpost'] : null);
             $data['setting']['verifypost'] = $data['setting']['verifypost'] ? $data['setting']['verifypost'] : ($pset['verifypost'] ? $pset['verifypost'] : null);
             $data['setting']['verifyrole'] = $data['setting']['verifyrole'] ? $data['setting']['verifyrole'] : ($pset['verifyrole'] ? $pset['verifyrole'] : null);
             unset($pdata, $pset);
         }
         unset($data['synpost']);
         $data['setting'] = array2string($data['setting']);
         $data['child'] = 0;
         $data['arrchildid'] = '';
         $data['arrparentid'] = '';
         $this->insert($data);
     }
     $catid = $this->get_insert_id();
     $this->repair();
     return empty($catid) ? lang('failure') : $catid;
 }
예제 #8
0
 public function _initialize()
 {
     parent::_initialize();
     $this->assign('jumpUrl', U('User/Login/index'));
     if (empty($this->Role[$this->_groupid]['allowpost'])) {
         $this->error(L('nologin'));
     }
     $this->assign('bcid', 0);
     $this->moduleid = intval($_REQUEST['moduleid']);
     if (!in_array($this->_groupid, explode(',', $this->module[$this->moduleid]['postgroup']))) {
         $this->error(L('add_no_postgroup'));
     }
     if ($this->moduleid) {
         $this->assign('moduleid', $this->moduleid);
         $module = $this->module[$this->moduleid]['name'];
         $this->dao = D($module);
         $fields = F($this->moduleid . '_Field');
         foreach ($fields as $key => $res) {
             if ($res['unpostgroup']) {
                 $res['unpostgroup'] = explode(',', $res['unpostgroup']);
             }
             if (!in_array($this->_groupid, $res['unpostgroup']) && $res['status']) {
                 $res['setup'] = string2array($res['setup']);
                 $this->fields[$key] = $res;
             }
         }
         unset($fields);
         unset($res);
         $this->assign('fields', $this->fields);
     }
 }
예제 #9
0
 public function edit()
 {
     $siteid = isset($_GET['siteid']) && intval($_GET['siteid']) ? intval($_GET['siteid']) : $this->error(L('illegal_parameters'));
     if ($site = $this->db->where(array('id' => $siteid))->find()) {
         if (IS_POST) {
             $this->checkToken();
             $data = $_POST['info'];
             $data['setting'] = array2string($_POST['setting']);
             if ($this->db->where(array('id' => $siteid))->save($data) !== false) {
                 $this->db->set_cache();
                 $this->success(L('setting_succ'));
             } else {
                 $this->error(L('operation_failure'));
             }
         } else {
             $template_list = template_list();
             $setting = string2array($site['setting']);
             $setting['watermark_img'] = str_replace('statics/images/water/', '', $setting['watermark_img']);
             $this->assign('template_list', $template_list);
             $this->assign('setting', $setting);
             $this->assign('data', $site);
             $this->display();
         }
     } else {
         $this->error(L('notfound'));
     }
 }
예제 #10
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]', '&ldquo;', '&rdquo;', '&nbsp;'), '', strip_tags($info['content'])), 200);
    $info['username'] = "******";
    $info['inputtime'] = '';
    if ($db->add_content($info)) {
        return true;
    }
    return false;
}
예제 #11
0
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;
}
예제 #12
0
 public function get()
 {
     $id = isset($_GET['id']) && intval($_GET['id']) ? intval($_GET['id']) : exit;
     if ($data = $this->db->getby_id($id)) {
         if (!($str = S('dbsource_' . $id))) {
             if ($data['type'] == 1) {
                 // 自定义SQL调用
                 $get_db = Loader::model("get_model");
                 $sql = $data['data'] . (!empty($data['num']) ? " LIMIT {$data['num']}" : '');
                 $str = $get_db->query($sql);
             } else {
                 $filepath = APPS_PATH . $data['application'] . DIRECTORY_SEPARATOR . 'library' . DIRECTORY_SEPARATOR . $data['application'] . '_tag.php';
                 if (file_exists($filepath)) {
                     $yun_tag = Loader::lib($data['application'] . ':' . $data['application'] . '_tag');
                     if (!method_exists($yun_tag, $data['do'])) {
                         exit;
                     }
                     $sql = string2array($data['data']);
                     $sql['do'] = $data['do'];
                     $sql['limit'] = $data['num'];
                     unset($data['num']);
                     $str = $yun_tag->{$data}['do']($sql);
                 } else {
                     exit;
                 }
             }
             if ($data['cache']) {
                 S('tpl_data/dbsource_' . $id, $str, $data['cache']);
             }
         }
         echo $this->_format($data['id'], $str, $data['dis_type']);
     }
 }
예제 #13
0
 public function uc()
 {
     if (isset($_POST['dosubmit'])) {
         $data = isset($_POST['data']) ? $_POST['data'] : '';
         $data['ucuse'] = isset($_POST['ucuse']) && intval($_POST['ucuse']) ? intval($_POST['ucuse']) : 0;
         $filepath = CACHE_PATH . 'configs' . DIRECTORY_SEPARATOR . 'system.php';
         $config = (include $filepath);
         $uc_config = '<?php ' . "\ndefine('UC_CONNECT', 'mysql');\n";
         foreach ($data as $k => $v) {
             $old[] = "'{$k}'=>'" . (isset($config[$k]) ? $config[$k] : $v) . "',";
             $new[] = "'{$k}'=>'{$v}',";
             $uc_config .= "define('" . strtoupper($k) . "', '{$v}');\n";
         }
         $html = file_get_contents($filepath);
         $html = str_replace($old, $new, $html);
         $uc_config_filepath = CACHE_PATH . 'configs' . DIRECTORY_SEPARATOR . 'uc_config.php';
         @file_put_contents($uc_config_filepath, $uc_config);
         @file_put_contents($filepath, $html);
         $this->db->insert(array('name' => 'ucenter', 'data' => array2string($data)), 1, 1);
         showmessage(L('operation_success'), HTTP_REFERER);
     }
     $data = array();
     $r = $this->db->get_one(array('name' => 'ucenter'));
     if ($r) {
         $data = string2array($r['data']);
     }
     include $this->admin_tpl('system_uc');
 }
예제 #14
0
 /**
  * 获取应用配置
  * @param string $application
  * @return mixed|boolean
  */
 public function get_setting($application)
 {
     $result = $this->where(array('application' => $application))->find();
     if (!empty($result['setting'])) {
         return string2array($result['setting']);
     }
     return false;
 }
예제 #15
0
파일: Wx.php 프로젝트: rainbow88/hummel
 /**
  * 构造函数
  */
 public function __construct()
 {
     parent::__construct();
     $file = FCPATH . 'config/weixin.php';
     $this->wx = is_file($file) ? string2array(file_get_contents($file)) : array();
     define("TOKEN", $this->wx['token']);
     define('WECHAT_THEME', SITE_PATH . basename(VIEW_DIR) . '/weixin/');
     $this->cache->cache_dir = APP_ROOT . 'cache/weixin/';
 }
예제 #16
0
    function __construct($thumb_enable = 0 ,$siteid) {
    	$this->thumb_enable = $thumb_enable;
    	if($siteid) {
	    	$this->siteinfo = getcache('sitelist', 'commons');
	    	$this->site_setting = string2array($this->siteinfo[$siteid]['setting']);
			$this->watermark_enable = $this->site_setting['watermark_enable'];
			$this->set($this->site_setting['watermark_img'],$this->site_setting['watermark_pos'],$this->site_setting['watermark_minwidth'],$this->site_setting['watermark_minheight'],$this->site_setting['watermark_quality'],$this->site_setting['watermark_pct']);
    	}
    }
예제 #17
0
 /**
  * 生成广告js文件
  * @param intval $id 广告版位ID
  * @return boolen 成功返回true
  */
 public function create_js($id = 0)
 {
     $id = intval($id);
     if (!$id) {
         $this->msg = L('no_create_js');
         return false;
     }
     $siteid = get_siteid();
     $r = $this->s_db->get_one(array('siteid' => $siteid, 'spaceid' => $id));
     $now = SYS_TIME;
     if ($r['setting']) {
         $space_setting = string2array($r['setting']);
     }
     if ($r['type'] == 'code') {
         return true;
     }
     $poster_template = getcache('poster_template_' . $siteid, 'commons');
     if ($poster_template[$r['type']]['option']) {
         $where = "`spaceid`='" . $id . "' AND `siteid`='" . $siteid . "' AND `disabled`=0 AND `startdate`<='" . $now . "' AND (`enddate`>='" . $now . "' OR `enddate`=0) ";
         $pinfo = $this->db->select($where, '*', '', '`listorder` ASC, `id` DESC');
         if (is_array($pinfo) && !empty($pinfo)) {
             foreach ($pinfo as $k => $rs) {
                 if ($rs['setting']) {
                     $rs['setting'] = string2array($rs['setting']);
                     $pinfo[$k] = $rs;
                 } else {
                     unset($pinfo[$k]);
                 }
             }
             extract($r);
         } else {
             return true;
         }
     } else {
         $where = " `spaceid`='" . $id . "' AND `siteid`='" . $siteid . "' AND `disabled`=0 AND `startdate`<='" . $now . "' AND (`enddate`>='" . $now . "' OR `enddate`=0)";
         $pinfo = $this->db->get_one($where, '*', '`listorder` ASC, `id` DESC');
         if (is_array($pinfo) && $pinfo['setting']) {
             $pinfo['setting'] = string2array($pinfo['setting']);
         }
         extract($r);
         if (!is_array($pinfo) || empty($pinfo)) {
             return true;
         }
         extract($pinfo, EXTR_PREFIX_SAME, 'p');
     }
     $file = CACHE_PATH . $path;
     ob_start();
     include template('poster', $type);
     $data = ob_get_contents();
     ob_end_clean();
     $strlen = pc_base::load_config('system', 'lock_ex') ? file_put_contents($file, $data, LOCK_EX) : file_put_contents($file, $data);
     @chmod($file, 0777);
     return true;
 }
예제 #18
0
 protected function menu($string)
 {
     $auth = string2array($this->admin['auth']);
     if ($this->admin['roleid']) {
         return true;
     }
     if ($auth[$string]) {
         return true;
     } else {
         return false;
     }
 }
예제 #19
0
	/**
	 * 重新通知
	 */
	public function renotice() {
		$noticeid = isset($_POST['noticeid']) ? $_POST['noticeid'] : showmessage(L('illegal_parameters'), HTTP_REFERER);
		$appid = isset($_POST['appid']) ? $_POST['appid'] : showmessage(L('illegal_parameters'), HTTP_REFERER);
		if ($noticeinfo = $this->db->get_one(array('id'=>$noticeid))) {
			//通知app noticedata 返回通知成功的appid 1
			//debug post appid.phpsso.php?data=noticeinfo[noticedata];
			$applist = getcache('applist');
			$url = $applist[$appid]['url'].$applist[$appid]['apifilename'];
			$data = string2array($noticeinfo['noticedata']);
			$data['action'] = $noticeinfo['operation'];
			
			//转换中文编码
			if (CHARSET != $applist[$appid]['charset'] && isset($data['action']) && $data['action'] == 'member_add') {
				if(isset($data['username']) && !empty($data['username'])) {
					if(CHARSET == 'utf-8') {	//判断phpsso字符集是否为utf-8编码
						//应用字符集如果是utf-8,并且用户名是utf-8编码,转换用户名为phpsso字符集,如果为英文,is_utf8返回false,不进行转换
						if(!is_utf8($data['username'])) {
							$data['username'] = iconv(CHARSET, $applist[$appid]['charset'], $data['username']);
						}
					} else {
						if(!is_utf8($data['username'])) {
							$data['username'] = iconv(CHARSET, $applist[$appid]['charset'], $data['username']);
						}
					}
				}
			}
			$tmp_s = strstr($url, '?') ? '&' : '?';
			$status = ps_send($url.$tmp_s.'appid='.$appid, $data, $applist[$appid]['authkey']);

			//通信次数+1
			$this->db->update(array('totalnum'=>'+=1', 'dateline'=>SYS_TIME), array('id'=>$noticeid));
			
			if($status == 1) {
				//重置消息队列app通信状态
				$appstatusarr = json_decode($noticeinfo['appstatus'], 1);
				$appstatusarr[$appid] = 1;
				$appstatus = json_encode($appstatusarr);
				
				//全部通知成功后更新消息队列状态
				if (!strstr($appstatus, ':0')) {
					$this->db->update(array('succeed'=>1), array('id'=>$noticeid));
				}
				
				//更新消息队列
				$this->db->update(array('appstatus'=>$appstatus), array('id'=>$noticeid));
				exit('1');
			} else {
				exit('0');
			}
		} else {
			exit('0');
		}
	}
예제 #20
0
 public function init()
 {
     $allow_visitor = htmlspecialchars($_GET['allow_visitor']);
     $auth = sys_auth($allow_visitor, 'DECODE');
     if (strpos($auth, '|') === false) {
         showmessage(L('illegal_operation'));
     }
     $auth_str = explode('|', $auth);
     $flag = $auth_str[0];
     if (!preg_match('/^([0-9]+)|([0-9]+)/', $flag)) {
         showmessage(L('illegal_operation'));
     }
     $readpoint = intval($auth_str[1]);
     $paytype = intval($auth_str[2]);
     $http_referer = urldecode($_GET['http_referer']);
     if (!$readpoint) {
         showmessage(L('illegal_operation'));
     }
     pc_base::load_app_class('spend', 'pay', 0);
     $flag_arr = explode('_', $flag);
     $catid = $flag_arr[0];
     $siteids = getcache('category_content', 'commons');
     $siteid = $siteids[$catid];
     $CATEGORYS = getcache('category_content_' . $siteid, 'commons');
     if (isset($CATEGORYS[$catid])) {
         $setting = string2array($CATEGORYS[$catid]['setting']);
         $repeatchargedays = intval($setting['repeatchargedays']);
         if ($repeatchargedays) {
             $fromtime = SYS_TIME - 86400 * $repeatchargedays;
             $r = spend::spend_time($this->userid, $fromtime, $flag);
             if ($r) {
                 showmessage(L('have_pay'), $http_referer, 1000);
             }
         }
     }
     if ($paytype) {
         if (spend::amount($readpoint, L('msg_readpoint'), $this->userid, $this->username, '', '', $flag) == false) {
             $msg = spend::get_msg();
             $http_referer = APP_PATH . 'index.php?m=pay&c=deposit&a=pay';
         } else {
             $msg = L('readpoint_pay', array('readpoint' => $readpoint));
         }
     } else {
         if (spend::point($readpoint, L('msg_readpoint'), $this->userid, $this->username, '', '', $flag) == false) {
             $msg = spend::get_msg();
             $http_referer = APP_PATH . 'index.php?m=pay&c=deposit&a=pay';
         } else {
             $msg = L('readpoint_pay_point', array('readpoint' => $readpoint));
         }
     }
     showmessage($msg, $http_referer, 3000);
 }
예제 #21
0
파일: html.php 프로젝트: hubs/yuncms
 /**
  * 生成广告js文件
  *
  * @param intval $id
  *        	广告版位ID
  * @return boolen 成功返回true
  */
 public function create_js($id = 0)
 {
     $id = intval($id);
     if (!$id) {
         $this->msg = L('no_create_js');
         return false;
     }
     $r = $this->s_db->getby_spaceid($id);
     $now = TIME;
     if ($r['setting']) {
         $space_setting = string2array($r['setting']);
     }
     if ($r['type'] == 'code') {
         return true;
     }
     $poster_template = S('common/poster_template');
     if ($poster_template[$r['type']]['option']) {
         $where = "`spaceid`='" . $id . "' AND `disabled`=0 AND `startdate`<='" . $now . "' AND (`enddate`>='" . $now . "' OR `enddate`=0) ";
         $pinfo = $this->db->where($where)->order('listorder ASC, id DESC')->select();
         if (is_array($pinfo) && !empty($pinfo)) {
             foreach ($pinfo as $k => $rs) {
                 if ($rs['setting']) {
                     $rs['setting'] = string2array($rs['setting']);
                     $pinfo[$k] = $rs;
                 } else {
                     unset($pinfo[$k]);
                 }
             }
             extract($r);
         } else {
             return true;
         }
     } else {
         $where = " `spaceid`='" . $id . "' AND `disabled`=0 AND `startdate`<='" . $now . "' AND (`enddate`>='" . $now . "' OR `enddate`=0)";
         $pinfo = $this->db->where($where)->order('listorder ASC, id DESC')->find();
         if (is_array($pinfo) && isset($pinfo['setting'])) {
             $pinfo['setting'] = string2array($pinfo['setting']);
         }
         extract($r);
         if (!is_array($pinfo) || empty($pinfo)) {
             return true;
         }
         extract($pinfo, EXTR_PREFIX_SAME, 'p');
     }
     $file = DATA_PATH . $path;
     ob_start();
     include template('poster', $type);
     $data = ob_get_contents();
     ob_end_clean();
     File::write($file, $data);
     return true;
 }
예제 #22
0
function unserialize_config($cfg)
{
    if (is_string($cfg)) {
        $arr = string2array($cfg);
        $config = array();
        foreach ($arr as $key => $val) {
            $config[$key] = $val['value'];
        }
        return $config;
    } else {
        return false;
    }
}
예제 #23
0
파일: Wx.php 프로젝트: rainbow88/hummel
 /**
  * 配置
  */
 public function config()
 {
     if (IS_POST) {
         $data = $this->input->post('data');
         $size = file_put_contents($this->file, array2string($data));
         if (!$size) {
             $this->adminMsg('config目录无权限写入');
         }
         $this->adminMsg('保存成功', url('admin/wx/config'), 3, 1, 1);
     }
     $this->template->assign(array('data' => is_file($this->file) ? string2array(file_get_contents($this->file)) : array()));
     $this->template->display('admin/wx_config.html');
 }
예제 #24
0
/**
 * @return array
 * 获取模板(酷站)分类
 */
function get_tag_list($fieldid = 130)
{
    $tag_db = pc_base::load_model('model_field_model');
    $taginfo = $tag_db->get_one(array('fieldid' => $fieldid));
    $tags = string2array($taginfo['setting']);
    $tagsArr = explode("\n", $tags['options']);
    $tagData = array();
    foreach ($tagsArr as $tag) {
        $tmpArr = explode('|', $tag);
        $tagData[] = $tmpArr[0];
    }
    return $tagData;
}
예제 #25
0
 public function _initialize()
 {
     parent::_initialize();
     $module = $this->module[$this->moduleid]['name'];
     $this->dao = D($module);
     $fields = F($this->moduleid . '_Field');
     foreach ($fields as $key => $res) {
         $res['setup'] = string2array($res['setup']);
         $this->fields[$key] = $res;
     }
     unset($fields);
     unset($res);
     $this->assign('fields', $this->fields);
 }
예제 #26
0
 public function init()
 {
     $catid = intval($_GET['catid']);
     $id = intval($_GET['id']);
     if (!$catid || !$id) {
         showmessage(L('information_does_not_exist'), 'blank');
     }
     $_userid = $this->_userid;
     $_username = $this->_username;
     $_groupid = $this->_groupid;
     $page = intval($_GET['page']);
     $page = max($page, 1);
     $siteids = getcache('category_content', 'commons');
     $siteid = $siteids[$catid];
     $CATEGORYS = getcache('category_content_' . $siteid, 'commons');
     if (!isset($CATEGORYS[$catid]) || $CATEGORYS[$catid]['type'] != 0) {
         showmessage(L('information_does_not_exist'), 'blank');
     }
     $this->category = $CAT = $CATEGORYS[$catid];
     $this->category_setting = $CAT['setting'] = string2array($this->category['setting']);
     $siteid = $GLOBALS['siteid'] = $CAT['siteid'];
     $MODEL = getcache('model', 'commons');
     $modelid = $CAT['modelid'];
     $tablename = $this->db->table_name = $this->db->db_tablepre . $MODEL[$modelid]['tablename'];
     $r = $this->db->get_one(array('id' => $id));
     if (!$r || $r['status'] != 99) {
         showmessage(L('info_does_not_exists'), 'blank');
     }
     $this->db->table_name = $tablename . '_data';
     $r2 = $this->db->get_one(array('id' => $id));
     $rs = $r2 ? array_merge($r, $r2) : $r;
     //再次重新赋值,以数据库为准
     $catid = $CATEGORYS[$r['catid']]['catid'];
     $modelid = $CATEGORYS[$catid]['modelid'];
     require_once CACHE_MODEL_PATH . 'content_output.class.php';
     $content_output = new content_output($modelid, $catid, $CATEGORYS);
     $data = $content_output->get($rs);
     extract($data);
     //最顶级栏目ID
     $arrparentid = explode(',', $CAT['arrparentid']);
     $top_parentid = $arrparentid[1] ? $arrparentid[1] : $catid;
     $template = 'demo';
     //SEO
     $seo_keywords = '';
     if (!empty($keywords)) {
         $seo_keywords = implode(',', $keywords);
     }
     $SEO = seo($siteid, $catid, $title, $description, $seo_keywords);
     include template('content', $template);
 }
예제 #27
0
파일: Sms.php 프로젝트: rainbow88/hummel
 /**
  * 账号
  */
 public function index()
 {
     if (IS_POST) {
         $data = $this->input->post('data');
         if (strlen($data['note']) > 30) {
             $this->adminMsg('短信签名太长');
         }
         $size = file_put_contents($this->file, array2string($data));
         if (!$size) {
             $this->adminMsg('config目录无权限写入');
         }
         $this->adminMsg('保存成功', url('admin/sms/index'), 3, 1, 1);
     }
     $this->template->assign(array('data' => is_file($this->file) ? string2array(file_get_contents($this->file)) : array()));
     $this->template->display('admin/sms_index.html');
 }
예제 #28
0
파일: index.php 프로젝트: ahmatjan/huluphp
 /**
  * php方式展示广告
  */
 public function show_poster()
 {
     if (!$_GET['id']) {
         exit;
     }
     $id = intval($_GET['id']);
     $sdb = pc_base::load_model('poster_space_model');
     $now = SYS_TIME;
     $siteid = get_siteid();
     $r = $sdb->get_one(array('siteid' => $siteid, 'spaceid' => $id));
     if (!$r) {
         exit;
     }
     if ($r['setting']) {
         $r['setting'] = string2array($r['setting']);
     }
     $poster_template = getcache('poster_template_' . $siteid, 'commons');
     if ($poster_template[$r['type']]['option']) {
         $where = "`spaceid`='" . $id . "' AND `disabled`=0 AND `startdate`<='" . $now . "' AND (`enddate`>='" . $now . "' OR `enddate`=0) ";
         $pinfo = $this->db->select($where, '*', '', '`listorder` ASC, `id` DESC');
         if (is_array($pinfo) && !empty($pinfo)) {
             foreach ($pinfo as $k => $rs) {
                 if ($rs['setting']) {
                     $rs['setting'] = string2array($rs['setting']);
                     $pinfo[$k] = $rs;
                 } else {
                     unset($pinfo[$k]);
                 }
             }
             extract($r);
         } else {
             return true;
         }
     } else {
         $where = " `spaceid`='" . $id . "' AND `disabled`=0 AND `startdate`<='" . $now . "' AND (`enddate`>='" . $now . "' OR `enddate`=0)";
         $pinfo = $this->db->get_one($where, '*', '`listorder` ASC, `id` DESC');
         if (is_array($pinfo) && $pinfo['setting']) {
             $pinfo['setting'] = string2array($pinfo['setting']);
         }
         extract($r);
         if (!is_array($pinfo) || empty($pinfo)) {
             return true;
         }
         extract($pinfo, EXTR_PREFIX_SAME, 'p');
     }
     include template('poster', $type);
 }
예제 #29
0
 /**
  * 设置默认风格
  */
 public function set_default()
 {
     $style = isset($_GET['style']) && trim($_GET['style']) ? trim($_GET['style']) : showmessage(L('illegal_operation'), HTTP_REFERER);
     \Leaps\Base\Config::modify('template', array('name' => $style));
     // 模板配置
     $category_model = Loader::model('category_model');
     $result = S('common/category_content');
     // 加载栏目缓存
     if (!empty($result) && is_array($result)) {
         foreach ($result as $r) {
             $setting = string2array($r['setting']);
             $setting['template_list'] = $style;
             $setting = array2string($setting);
             $category_model->where(array('catid' => $r['catid']))->update(array('setting' => $setting));
         }
     }
     showmessage(L('operation_success'), HTTP_REFERER);
 }
예제 #30
0
	public function public_file_count() {
		$scan = getcache('scan_config', 'scan');
		pc_base::load_app_func('global');
		set_time_limit(120);
		$scan['dir'] = string2array($scan['dir']);
		$scan['file_type'] = explode('|', $scan['file_type']);
		$list = array();
		foreach ($scan['dir'] as $v) {
			if (is_dir($v)) {
				foreach ($scan['file_type'] as $k ) {
					$list = array_merge($list, scan_file_lists($v.DIRECTORY_SEPARATOR, 1, $k, 0, 1, 1));
				}
			} else {
				$list = array_merge($list, array(str_replace(ZLCMS_PATH, '', $v)=>md5_file($v)));
			}
		}
		setcache('scan_list', $list, 'scan');
		showmessage(L('documents_to_file_the_statistics'), '?m=scan&c=index&a=public_file_filter');
	}