public function set($key, $value = null) { if ($value === null) { $this->vars = $key; } else { data_set($this->vars, $key, $value); } return $this; }
/** @return static */ public function set($key, $value = null) { data_set($this->items, $key, $value); return $this; }
<?php if (!defined('iBUAA') || !defined('IN_ADMINCP')) { exit('Access Denied'); } //权限 if (!checkperm('manageapp')) { cpmessage('no_authority_management_operation'); } if (submitcheck('appsubmit')) { include_once S_ROOT . './source/function_cache.php'; data_set('relatedtag', $_POST['relatedtag']); tagtpl_cache(); app_cache(); //应用列表缓存 cpmessage('do_success', 'admincp.php?ac=app'); } if (empty($_GET['op'])) { include_once S_ROOT . './uc_client/client.php'; $applist = uc_app_ls(); $relatedtag = data_get('relatedtag'); $relatedtag = unserialize($relatedtag); if (empty($relatedtag)) { $relatedtag = array(); } } //更新tag模板文件 function tagtpl_cache() { $relatedtag = unserialize(data_get('relatedtag')); if (empty($relatedtag)) {
if (strexists($value, ',')) { $narr = array(); $arr = explode(',', $value); foreach ($arr as $v) { $v = trim($v); $v = intval($v); if ($v) { $narr[$v] = $v; } } $value = implode(',', $narr); } elseif (preg_match("/[^a-z]/i", $value)) { $value = intval($value); } $values[$key] = $value; } $_POST['network'][$type] = $values; } data_set('network', $_POST['network']); // Update Cache include_once S_ROOT . './source/function_cache.php'; network_cache(); cpmessage('do_success', 'admincp.php?ac=network'); } $network = $_SGLOBAL['network']; // sort $orders = $scs = array(); foreach (array('blog', 'pic', 'thread', 'poll', 'event') as $value) { $orders[$value] = array($network[$value]['order'] => ' selected'); $scs[$value] = array($network[$value]['sc'] => ' selected'); }
'thumbwidth' => 100, 'thumbheight' => 100, 'watermarkpos' => 4, 'watermarktrans' => 75 ); data_set('setting', $settings); //随便看看 $network = array( 'blog' => array('hot1'=>3, 'cache'=>600), 'pic' => array('hot1'=>3, 'cache'=>700), 'thread' => array('hot1'=>3, 'cache'=>800), 'event' => array('cache'=>900), 'poll' => array('cache'=>500), ); data_set('network', $network); //计划任务 $datas = array( "1, 'system', '更新浏览数统计', 'log.php', $_SGLOBAL[timestamp], $_SGLOBAL[timestamp], -1, -1, -1, '0 5 10 15 20 25 30 35 40 45 50 55'", "1, 'system', '清理过期feed', 'cleanfeed.php', $_SGLOBAL[timestamp], $_SGLOBAL[timestamp], -1, -1, 3, '4'", "1, 'system', '清理个人通知', 'cleannotification.php', $_SGLOBAL[timestamp], $_SGLOBAL[timestamp], -1, -1, 5, '6'", "1, 'system', '同步UC的feed', 'getfeed.php', $_SGLOBAL[timestamp], $_SGLOBAL[timestamp], -1, -1, -1, '2 7 12 17 22 27 32 37 42 47 52'", "1, 'system', '清理脚印和最新访客', 'cleantrace.php', $_SGLOBAL[timestamp], $_SGLOBAL[timestamp], -1, -1, 2, '3'" ); $_SGLOBAL['db']->query("TRUNCATE TABLE ".tname('cron')); $_SGLOBAL['db']->query("INSERT INTO ".tname('cron')." (available, type, name, filename, lastrun, nextrun, weekday, day, hour, minute) VALUES (".implode('),(', $datas).")"); //用户任务 $datas = array(); $datas[] = "1, '更新一下自己的头像', '头像就是你在这里的个人形象。<br>设置自己的头像后,会让更多的朋友记住您。', 'avatar.php', 1, '', 0, 20, 'image/task/avatar.gif'";
//Error-free execution off the table and I create a column without quotes if (empty($filename) || strlen($filename) > 40) { //Determine the length of the file name cpmessage('documents_were_incorrect_length'); } else { $filename = preg_replace("/[^a-z0-9_]/i", '', str_replace('.', '_', $filename)); } $tables = array(); // backup mode if ($type == 'uchomes') { $tables = arraykeys2(fetchtablelist($tablepre), 'Name'); } elseif ($type == 'custom') { if (isset($_POST['setup'])) { //POST submit backup $tables = empty($_POST['customtables']) ? array() : $_POST['customtables']; data_set('custombackup', $tables); } else { //Jump backup automatically $tables = data_get('custombackup'); $tables = unserialize($tables); } } if (empty($tables) || !is_array($tables)) { cpmessage('backup_table_wrong'); } $time = sgmdate('Y-m-d H:i:s', $_SGLOBAL['timestamp']); $idstring = '# Identify: ' . base64_encode("{$_SGLOBAL['timestamp']}," . X_VER . ",{$type},{$method},{$volume}") . "\n"; $dumpcharset = $sqlcharset ? $sqlcharset : str_replace('-', '', $_SC['charset']); $setnames = $sqlcharset && $_SGLOBAL['db']->version() > '4.1' && (!$sqlcompat || $sqlcompat == 'MYSQL41') ? "SET NAMES '{$dumpcharset}';\n\n" : ''; if ($_SGLOBAL['db']->version() > '4.1') { if ($sqlcharset) {
//好玩的应用 $myapplist = $onlielist = array(); if ($_SCONFIG['my_status']) { $query = $_SGLOBAL['db']->query("SELECT appid,appname FROM " . tname('myapp') . " WHERE flag>=0 ORDER BY flag DESC, displayorder LIMIT 0,5"); while ($value = $_SGLOBAL['db']->fetch_array($query)) { $myapplist[] = $value; } } else { $query = $_SGLOBAL['db']->query("SELECT uid,username FROM " . tname('session') . " ORDER BY lastactivity DESC LIMIT 0,5"); while ($value = $_SGLOBAL['db']->fetch_array($query)) { realname_set($value['uid'], $value['username']); $onlinelist[] = $value; } } //缓存 data_set('index_cache', array('bloglist' => $bloglist, 'albumlist' => $albumlist, 'feedlist' => $feedlist, 'mtaglist' => $mtaglist, 'threadlist' => $threadlist, 'spacelist' => $spacelist, 'myapplist' => $myapplist, 'onlinelist' => $onlinelist, '_SN' => $_SN)); } //图片幻灯 $piclist = array(); @(include_once S_ROOT . './data/data_network.php'); if (empty($netcache['piclist'])) { $query = $_SGLOBAL['db']->query("SELECT p.* FROM " . tname('pic') . " p, " . tname('album') . " a\r\n\t\tWHERE a.friend='0' AND a.albumid=p.albumid\r\n\t\tORDER BY p.dateline DESC LIMIT 0,5"); while ($value = $_SGLOBAL['db']->fetch_array($query)) { $value['pic'] = mkpicurl($value, 0); $value['title'] = getstr($value['title'], 50, 0, 1, 0, 0, -1); $piclist[] = $value; } } else { $piclist = $netcache['piclist']; } //获取实名
/** * @param $key * @param null $value * * @return static */ public function set($key, $value = null) { if ($value === null) { $this->customMerge($key); } else { data_set($this->items, $key, $value); } return $this; }
/* [UCenter Home] (C) 2007-2008 Comsenz Inc. $Id: admincp_credit.php 8390 2008-08-06 05:50:42Z liguode $ */ if (!defined('IN_UCHOME') || !defined('IN_ADMINCP')) { exit('Access Denied'); } //х╗оч if (!checkperm('managecredit')) { cpmessage('no_authority_management_operation'); } if (submitcheck('creditsubmit')) { $ins = array(); foreach ($_POST['get'] as $key => $value) { $ins['get'][$key] = abs(intval($value)); } foreach ($_POST['pay'] as $key => $value) { $ins['pay'][$key] = abs(intval($value)); } data_set('creditrule', $ins); include_once S_ROOT . './source/function_cache.php'; creditrule_cache(); cpmessage('do_success', 'admincp.php?ac=credit'); } @(include_once S_ROOT . './data/data_creditrule.php'); if (empty($_SGLOBAL['creditrule'])) { $get = $pay = array(); } else { $get = $_SGLOBAL['creditrule']['get']; $pay = $_SGLOBAL['creditrule']['pay']; }
$datas = array(); foreach ($_POST['data'] as $var => $value) { $datas[$var] = trim(stripslashes($value)); } data_set('setting', $datas); //发送邮件设置 $mails = array(); foreach ($_POST['mail'] as $var => $value) { $mails[$var] = trim(stripslashes($value)); } data_set('mail', $mails); //更新缓存 include_once S_ROOT . './source/function_cache.php'; config_cache(); //用户栏目缓存 data_set('spacebarusername', '', 1); cpmessage('do_success', 'admincp.php?ac=config'); } $configs = array(); $query = $_SGLOBAL['db']->query("SELECT * FROM " . tname('config')); while ($value = $_SGLOBAL['db']->fetch_array($query)) { $configs[$value['var']] = shtmlspecialchars($value['datavalue']); } if (empty($configs['siteallurl'])) { $configs['siteallurl'] = getsiteurl(); } if (empty($configs['feedfilternum']) || $configs['feedfilternum'] < 1) { $configs['feedfilternum'] = 1; } $datasets = $datas = $mails = array(); $query = $_SGLOBAL['db']->query("SELECT * FROM " . tname('data'));
function space_open($uid, $username, $gid = 0, $email = '') { global $_SGLOBAL, $_SCONFIG; if (empty($uid) || empty($username)) { return array(); } //验证 space 是否被管理员 delete $query = $_SGLOBAL['db']->query("SELECT * FROM " . tname('spacelog') . " WHERE uid='{$uid}' AND flag='-1'"); if ($value = $_SGLOBAL['db']->fetch_array($query)) { showmessage('the_space_has_been_closed'); } $space = array('uid' => $uid, 'username' => $username, 'dateline' => $_SGLOBAL['timestamp'], 'groupid' => $gid, 'regip' => getonlineip()); // Bonus Points $reward = getreward('register', 0, $uid); if ($reward['credit']) { $space['credit'] = $reward['credit']; } if ($reward['experience']) { $space['experience'] = $reward['experience']; } inserttable('space', $space, 0, true); inserttable('spacefield', array('uid' => $uid, 'email' => $email), 0, true); //发送PM if ($_SGLOBAL['supe_uid'] && $_SGLOBAL['supe_uid'] != $uid) { include_once S_ROOT . './uc_client/client.php'; uc_pm_send($_SGLOBAL['supe_uid'], $uid, cplang('space_open_subject'), cplang('space_open_message', array(getsiteurl())), 1, 0, 0); } //发送邮箱验证邮件 include_once S_ROOT . './source/function_cp.php'; emailcheck_send($uid, $email); //产生feed $_uid = $_SGLOBAL['supe_uid']; $_username = $_SGLOBAL['supe_username']; $_SGLOBAL['supe_uid'] = $uid; $_SGLOBAL['supe_username'] = addslashes($username); if (ckprivacy('spaceopen', 1)) { feed_add('profile', cplang('feed_space_open')); } // update 最新会员 if ($_SCONFIG['newspacenum'] > 0) { $newspacelist = array(); $wherearr = array('1'); if ($_SCONFIG['newspaceavatar']) { $wherearr[] = "avatar='1'"; } if ($_SCONFIG['newspacerealname']) { $wherearr[] = "namestatus='1'"; } if ($_SCONFIG['newspacevideophoto']) { $wherearr[] = "videostatus='1'"; } $query = $_SGLOBAL['db']->query("SELECT uid,username,name,namestatus,videostatus,dateline FROM " . tname('space') . " WHERE " . implode(' AND ', $wherearr) . " ORDER BY uid DESC LIMIT 0,{$_SCONFIG['newspacenum']}"); while ($value = $_SGLOBAL['db']->fetch_array($query)) { $newspacelist[] = $value; } data_set('newspacelist', $newspacelist); } //Statistics update include_once S_ROOT . './source/function_cp.php'; updatestat('register'); $_SGLOBAL['supe_uid'] = $_uid; $_SGLOBAL['supe_username'] = $_username; return $space; }
$thes[] = $datas[$value][$i]; } $newdatas[$i] = "(" . simplode($thes) . ")"; } $_SGLOBAL['db']->query("TRUNCATE TABLE " . tname('usergroup')); $_SGLOBAL['db']->query("REPLACE INTO " . tname('usergroup') . " (" . implode(',', $keys) . ") VALUES " . implode(',', $newdatas)); //积分规则 $_SGLOBAL['db']->query("TRUNCATE TABLE " . tname('data')); $ins = array('get' => array('blog' => 2, 'pic' => 1, 'comment' => 1, 'thread' => 2, 'post' => 1, 'invite' => 10), 'pay' => array('blog' => 2, 'pic' => 1, 'comment' => 1, 'thread' => 2, 'post' => 1, 'search' => 1, 'attach' => 10, 'xmlrpc' => 5, 'invite' => 0, 'domain' => 10, 'realname' => 10)); data_set('creditrule', $ins); //邮件设置 $mails = array('mailsend' => 1, 'maildelimiter' => 0, 'mailusername' => 1); data_set('mail', $mails); //缩略图设置 $settings = array('thumbwidth' => 100, 'thumbheight' => 100, 'watermarkpos' => 4, 'watermarktrans' => 75); data_set('setting', $settings); //计划任务 $datas = array("1, 'system', '更新浏览数统计', 'log.php', {$_SGLOBAL['timestamp']}, {$_SGLOBAL['timestamp']}, -1, -1, -1, '0\t5\t10\t15\t20\t25\t30\t35\t40\t45\t50\t55'", "1, 'system', '清理过期feed', 'cleanfeed.php', {$_SGLOBAL['timestamp']}, {$_SGLOBAL['timestamp']}, -1, -1, 3, '4'", "1, 'system', '清理个人通知', 'cleannotification.php', {$_SGLOBAL['timestamp']}, {$_SGLOBAL['timestamp']}, -1, -1, 5, '6'", "1, 'system', '同步UC的feed', 'getfeed.php', {$_SGLOBAL['timestamp']}, {$_SGLOBAL['timestamp']}, -1, -1, -1, '2\t7\t12\t17\t22\t27\t32\t37\t42\t47\t52'", "1, 'system', '清理脚印和最新访客', 'cleantrace.php', {$_SGLOBAL['timestamp']}, {$_SGLOBAL['timestamp']}, -1, -1, 2, '3'"); $_SGLOBAL['db']->query("TRUNCATE TABLE " . tname('cron')); $_SGLOBAL['db']->query("INSERT INTO " . tname('cron') . " (available, type, name, filename, lastrun, nextrun, weekday, day, hour, minute) VALUES (" . implode('),(', $datas) . ")"); //用户任务 $datas = array(); $datas[] = "1, '更新一下自己的头像', '头像就是你在这里的个人形象。<br>设置好了可获得特别惊喜:<br>本站会自动寻找优秀的异性朋友推荐给您。<br>您不赶快试试?', 'avatar.php', 1, 0, 20, 'image/task/avatar.gif'"; $datas[] = "1, '将个人资料补充完整', '把自己的个人资料填写完整吧。<br>这样您会被更多的朋友找到的,系统也会帮您找到朋友。', 'profile.php', 2, 0, 20, 'image/task/profile.gif'"; $datas[] = "1, '发表自己的第一篇日志', '现在,就写下自己的第一篇日志吧。<br>与大家一起分享自己的生活感悟。', 'blog.php', 3, 0, 5, 'image/task/blog.gif'"; $datas[] = "1, '寻找并添加五位好友', '有了好友,您发的日志、图片等会被好友及时看到并传播出去;<br>您也会在首页方便及时的看到好友的最新动态。<br>这会让您在这里的生活变得丰富多彩。', 'friend.php', 4, 0, 50, 'image/task/friend.gif'"; $datas[] = "1, '验证激活自己的邮箱', '填写自己真实的邮箱地址并验证通过。<br>您可以在忘记密码的时候使用该邮箱取回自己的密码;<br>还可以及时接受站内的好友通知等等。<br>这对您十分有帮助和必要。', 'email.php', 5, 0, 10, 'image/task/email.gif'"; $datas[] = "1, '邀请10个新朋友加入', '邀请一下自己的QQ好友或者邮箱联系人,让亲朋好友一起来加入我们吧。', 'invite.php', 6, 0, 100, 'image/task/friend.gif'"; $datas[] = "1, '领取每日积分大礼包', '每天登录访问自己的主页,就可领取积分大礼包。<br>还可免费获赠本周《热门日志排行榜》导读一份。', 'gift.php', 99, 86400, 2, 'image/task/gift.gif'"; $_SGLOBAL['db']->query("TRUNCATE TABLE " . tname('task')); $_SGLOBAL['db']->query("INSERT INTO " . tname('task') . " (`available`, `name`, `note`, `filename`, `displayorder`, `nexttime`, `credit`, `image`) VALUES (" . implode('),(', $datas) . ")");
<?php //ランキング情報保存 if (file_exists("lock/lock")) { return null; } file_put_contents("lock/lock", "0"); setlocale(LC_ALL, 'ja_JP.UTF-8'); $list = $_GET['list']; $list = data_set($list); //リスト書き込み datawrite("gild", $list); unlink("lock/lock"); if ($flg_num) { header('location: index.htm'); exit; return TRUE; } return TRUE; // function data_set($data) { $id_a = explode("|,-|", $data); foreach ($id_a as $key => $val) { $dat = explode("|_-|", $val); if ($dat[0] == '') { continue; } $ret[$dat[0]] = $dat[1]; } return $ret;
[UCenter Home] (C) 2007-2008 Comsenz Inc. $Id: admincp_censor.php 8390 2008-08-06 05:50:42Z liguode $ */ if (!defined('IN_UCHOME') || !defined('IN_ADMINCP')) { exit('Access Denied'); } // Check Permissions if (!checkperm('managecensor')) { cpmessage('no_authority_management_operation'); } if (submitcheck('censorsubmit')) { $censorarr = explode("\n", $_POST['censor']); $newarr = array(); foreach ($censorarr as $censor) { list($newfind, $newreplace) = explode('=', $censor); $newfind = trim($newfind); if (strlen($newfind) >= 3) { $newreplace = trim($newreplace); if (strlen($newreplace) < 1) { $newreplace = '**'; } $newarr[] = "{$newfind}={$newreplace}"; } } data_set('censor', $newarr ? implode("\n", $newarr) : ''); include_once S_ROOT . './source/function_cache.php'; censor_cache(); cpmessage('do_success', 'admincp.php?ac=censor'); } $censor = data_get('censor'); $banflag = '{BANNED}';
/** * Set an item on an array or object using dot notation. * * @param mixed $target * @param string|array $key * @param mixed $value * @param bool $overwrite * @return mixed */ function data_set(&$target, $key, $value, $overwrite = true) { $segments = is_array($key) ? $key : explode('.', $key); if (($segment = array_shift($segments)) === '*') { if (!Arr::accessible($target)) { $target = []; } if ($segments) { foreach ($target as &$inner) { data_set($inner, $segments, $value, $overwrite); } } elseif ($overwrite) { foreach ($target as &$inner) { $inner = $value; } } } elseif (Arr::accessible($target)) { if ($segments) { if (!Arr::exists($target, $segment)) { $target[$segment] = []; } data_set($target[$segment], $segments, $value, $overwrite); } elseif ($overwrite || !Arr::exists($target, $segment)) { $target[$segment] = $value; } } elseif (is_object($target)) { if ($segments) { if (!isset($target->{$segment})) { $target->{$segment} = []; } data_set($target->{$segment}, $segments, $value, $overwrite); } elseif ($overwrite || !isset($target->{$segment})) { $target->{$segment} = $value; } } else { $target = []; if ($segments) { data_set($target[$segment], $segments, $value, $overwrite); } elseif ($overwrite) { $target[$segment] = $value; } } return $target; }
/** * setAttribute method * * @param $key * @param $value * * @return $this */ public function setAttribute($key, $value) { data_set($this->attributes, $key, $value); return $this; }
} if ($setarr) { $_SGLOBAL['db']->query("REPLACE INTO " . tname('data') . " (var, datavalue) VALUES " . implode(',', $setarr)); } //dataÉèÖà $datas = array(); foreach ($_POST['data'] as $var => $value) { $datas[$var] = trim(stripslashes($value)); } data_set('setting', $datas); //·¢ËÍÓʼþÉèÖà $mails = array(); foreach ($_POST['mail'] as $var => $value) { $mails[$var] = trim(stripslashes($value)); } data_set('mail', $mails); // Update Cache include_once S_ROOT . './source/function_cache.php'; config_cache(); cpmessage('do_success', 'admincp.php?ac=config'); } $configs = array(); $query = $_SGLOBAL['db']->query("SELECT * FROM " . tname('config')); while ($value = $_SGLOBAL['db']->fetch_array($query)) { $configs[$value['var']] = shtmlspecialchars($value['datavalue']); } if (empty($configs['feedfilternum']) || $configs['feedfilternum'] < 1) { $configs['feedfilternum'] = 1; } $datasets = $datas = $mails = array(); $query = $_SGLOBAL['db']->query("SELECT * FROM " . tname('data'));
$_POST['config']['seccode_register'] = 0; } //去除空的 $datas = array(); foreach ($_POST['data']['question'] as $key => $value) { $value = trim($value); $a_value = trim($_POST['data']['answer'][$key]); if ($value && $a_value) { $datas['question'][] = $value; $datas['answer'][] = $a_value; } } if (empty($datas['question']) && $_POST['config']['questionmode']) { $_POST['config']['questionmode'] = 0; } data_set('spam', $datas); $setarr = array(); foreach ($_POST['config'] as $var => $value) { $value = trim($value); $setarr[] = "('{$var}', '{$value}')"; } if ($setarr) { $_SGLOBAL['db']->query("REPLACE INTO " . tname('config') . " (var, datavalue) VALUES " . implode(',', $setarr)); } //更新缓存 include_once S_ROOT . './source/function_cache.php'; config_cache(); cpmessage('do_success', 'admincp.php?ac=spam'); } $configs = array(); $query = $_SGLOBAL['db']->query("SELECT * FROM " . tname('config'));
/** * Gather a copy of the attribute data filled with any missing attributes. * * @param string $attribute * @return array */ protected function initializeAttributeOnData($attribute) { $explicitPath = $this->getLeadingExplicitAttributePath($attribute); $data = $this->extractDataFromPath($explicitPath); if (!Str::contains($attribute, '*') || Str::endsWith($attribute, '*')) { return $data; } return data_set($data, $attribute, null, true); }
/** * 修改属性值 * @param $attribute * @param $value */ public function set($attribute, $value) { data_set($this->original, $attribute, $value); }