本文整理汇总了PHP中string2array函数的典型用法代码示例。如果您正苦于以下问题:PHP string2array函数的具体用法?PHP string2array怎么用?PHP string2array使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了string2array函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: pc_tag
/**
* 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;
}
开发者ID:klj123wan,项目名称:czsz,代码行数:35,代码来源:block_tag.class.php
示例2: manage
/**
* 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');
}
}
开发者ID:boylzj,项目名称:omguitar,代码行数:35,代码来源:member_setting.php
示例3: editAction
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');
}
开发者ID:43431655,项目名称:qizhongbao,代码行数:27,代码来源:administrator.php
示例4: fieldsFormDisplay
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');
}
开发者ID:keycoolkui,项目名称:weixinfenxiao,代码行数:30,代码来源:module.php
示例5: get
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']);
}
}
开发者ID:panhongsheng,项目名称:zl_cms,代码行数:33,代码来源:call.php
示例6: edit
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();
}
开发者ID:JavaAFei,项目名称:yun001,代码行数:26,代码来源:BlockAction.class.php
示例7: set
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;
}
开发者ID:kennyhonghui,项目名称:zhuoxi,代码行数:60,代码来源:CategoryModel.php
示例8: _initialize
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);
}
}
开发者ID:anywn3773,项目名称:gzsrex,代码行数:31,代码来源:PostAction.class.php
示例9: edit
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'));
}
}
开发者ID:lxp521125,项目名称:TP-Admin,代码行数:27,代码来源:SiteAction.class.php
示例10: addart
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'] = "admin";
$info['inputtime'] = '';
if ($db->add_content($info)) {
return true;
}
return false;
}
开发者ID:baowzh,项目名称:fulianweb,代码行数:25,代码来源:xpush.php
示例11: addart
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'] = "sumuya";
$info['inputtime'] = '';
echo "1";
if ($db->add_content($info)) {
return true;
}
return false;
}
开发者ID:baowzh,项目名称:fulianweb,代码行数:30,代码来源:testpush.php
示例12: get
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']);
}
}
开发者ID:hubs,项目名称:yuncms,代码行数:33,代码来源:CallController.php
示例13: uc
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');
}
开发者ID:jiangwuzhang,项目名称:phpcms,代码行数:28,代码来源:system.php
示例14: get_setting
/**
* 获取应用配置
* @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;
}
开发者ID:hubs,项目名称:yuncms,代码行数:13,代码来源:application_model.php
示例15: __construct
/**
* 构造函数
*/
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/';
}
开发者ID:rainbow88,项目名称:hummel,代码行数:12,代码来源:Wx.php
示例16: __construct
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']);
}
}
开发者ID:panhongsheng,项目名称:zl_cms,代码行数:9,代码来源:image.class.php
示例17: create_js
/**
* 生成广告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;
}
开发者ID:shenhua4286,项目名称:gxw,代码行数:59,代码来源:html.class.php
示例18: menu
protected function menu($string)
{
$auth = string2array($this->admin['auth']);
if ($this->admin['roleid']) {
return true;
}
if ($auth[$string]) {
return true;
} else {
return false;
}
}
开发者ID:43431655,项目名称:qizhongbao,代码行数:12,代码来源:Admin.class.php
示例19: renotice
/**
* 重新通知
*/
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');
}
}
开发者ID:panhongsheng,项目名称:zl_cms,代码行数:56,代码来源:messagequeue.php
示例20: init
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);
}
开发者ID:zhouzhouxs,项目名称:Progect,代码行数:52,代码来源:readpoint.php
注:本文中的string2array函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论