function Channel(&$channelKey, $force = 0, $time = 1800) { global $Channel, $db, $mastername; if ($force == 1) { @unlink(ONEZ_ROOT . './onezdata/cache/channel/' . $channelKey . '.php'); } if (!$channelKey || time() - @filemtime(ONEZ_ROOT . './onezdata/cache/channel/' . $channelKey . '.php') > $time) { if (!$db) { include_once ONEZ_ROOT . './include/db_mysql.class.php'; db_local(); $db = new onez_db(); } $Table = $db->record("channel", "*", "id='{$channelKey}'", 1); if (!$Table) { $Table = $db->record("channel", "*", "ifdefault=1", 1); if (!$Table) { $arr = array('name' => '官方默认群', 'username' => $mastername, 'level' => '-1', 'maxusr' => '-1', 'allowguest' => '0', 'forumid' => '0', 'forumname' => '', 'addtime' => time(), 'exptime' => '-1', 'ifdefault' => '1', 'ifonly' => '0', 'notice' => '', 'theme' => 'QQ2009'); $db->insert("channel", $arr); $Table = $db->record("channel", "*", "ifdefault=1", 1); } } $Channel = $Table[0]; $Channel['links'] = $db->record("links", "adpos,icon,title,linkurl", "(endtime<1 or endtime>" . time() . ") and cid='{$Channel['id']}' order by id desc"); $channelKey = $Channel['id']; if (!$channelKey) { exit('INIT ERROR!'); } mkdirs(ONEZ_ROOT . './onezdata/cache/channel'); writeover(ONEZ_ROOT . './onezdata/cache/channel/' . $channelKey . '.php', '<?php $Channel=' . var_export($Channel, true) . '; ?>'); } else { include ONEZ_ROOT . './onezdata/cache/channel/' . $channelKey . '.php'; } }
foreach ($credititems as $value) { $outextcredits[$value['appiddesc'] . '|' . $value['creditdesc']] = array('creditsrc' => $value['creditsrc'], 'title' => $value['title'], 'unit' => $value['unit'], 'ratio' => $value['ratio'], 'ratiosrc' => $value['ratiosrc'], 'ratiodesc' => $value['ratiodesc'], 'ratio' => $value['ratio']); } } } @writeover("../onezdata/creditsettings.php", "<?\n\$outextcredits=" . var_export($outextcredits, true) . "?>"); exit(API_RETURN_SUCCEED); } elseif ($action == 'updatecredit') { //接收积分兑换通知 $credit = intval($get['credit']); $amount = intval($get['amount']); $uid = intval($get['uid']); require_once '../include/common.inc.php'; if (!$db) { include_once ONEZ_ROOT . './include/db_mysql.class.php'; $db = new onez_db(); } $db->query("UPDATE {$tbl}users SET extcredits{$credit}=extcredits{$credit}+{$amount} WHERE uid='{$uid}'"); exit(API_RETURN_SUCCEED); } elseif ($action == 'updateapps') { //应用程序列表 $post = uc_unserialize(file_get_contents('php://input')); $appid = array(); foreach ($post as $id => $v) { if ($id != 'UC_API' && $id != UC_APPID) { $appid[] = $id; } } writeover('../onezdata/apps.php', "<?\n\$apps=" . var_export($post, true) . ";\n\$appid=array(" . implode(',', $appid) . ");\n?>"); exit(API_RETURN_SUCCEED); } else {
function API_UserList($uids = '') { global $db; if (!$db) { include_once ONEZ_ROOT . './include/db_mysql.class.php'; $db = new onez_db(); } $Users = $db->record("member m left join gxw_member_info i on m.userid=i.userid", "*", '1=1 order by status desc', '0,20'); // print_r($Users); // die; foreach ($Users as $k => $rs) { $faceIndex++; if ($rs['gender'] == '1') { $rs['sex'] = 'man'; } elseif ($user['gender'] == '2') { $rs['sex'] = 'woman'; } else { $rs['sex'] = ''; } // print_r($Users); $faceIndex = $faceIndex % 4; $Users[$k] = array('uid' => $rs['userid'], 'username' => $rs['nickname'], 'face' => $rs['basic_logo'] ? $rs['basic_logo'] : 'images/face/' . $faceIndex . '.png', 'sex' => 20, 'readme' => $rs['basic_com_intruduce']); } return $Users; }
<?php @(include_once "../include/common.inc.php"); include_once "../include/db_mysql.class.php"; $db = new onez_db(); foreach (API_Config() as $k => $v) { ${$k} = $v; } if ($mastername != $username) { ero('您不是本站管理员,不能进行此项操作', '../'); } $T = $db->record("channel", "id,name", "ifdefault=1"); $Menu = array(array('常规设置', array('main' => '管理首页', 'config' => '基本设置', 'api' => '整合接口设置', 'sec' => '间隔设置')), array('频道管理', array('channels' => '全部频道列表', 'addchannel' => '添加新频道', 'editchannel&id=' . $T[0]['id'] => '<font color=blue>' . $T[0]['name'] . '</font>')), array('机器人管理', array('robots' => '机器人列表')), array('<font color=red>最新版本</font>', 'http://www.onez.cn/'), array('<font color=red>帮助中心</font>', 'http://www.onez.cn/thread.php?fid=10'));
function API_UserList($uids = '') { global $db; if (!$db) { include_once ONEZ_ROOT . './include/db_mysql.class.php'; $db = new onez_db(); } $Users = $db->record("users", "uid,username,sex", $uids ? "uid in ({$uids})" : ''); foreach ($Users as $k => $rs) { if ($rs['sex'] == '1') { $rs['sex'] = 'man'; } elseif ($user['sex'] == '2') { $rs['sex'] = 'woman'; } else { $rs['sex'] = ''; } $Users[$k] = array('uid' => $rs['uid'], 'username' => $rs['username'], 'face' => UC_API . '/avatar.php?uid=' . $rs['uid'] . '&size=small', 'sex' => $rs['sex'], 'readme' => '暂无简介'); } return $Users; }
AddMsg_User($uid, "\n3\t�ܱ�Ǹ�����ѱ�ϵͳ����Ա�Ƴ���Ⱥ��30�����ڲ������ٴν���\tlogout"); exit('1'); break; case 'addmaster': if (!$ChannelId) { exit('Channel Error!'); } $uid = Char_Cv('uid'); $user = API_Info($userid); if ($Channel['username'] != $username) { exit('-1'); } if (!$db) { include_once ONEZ_ROOT . './include/db_mysql.class.php'; db_local(); $db = new onez_db(); $masters = explode(',', $Channel['masters']); if (!in_array($username, $masters)) { $masters[] = $username; $masters = implode(',', $masters); $db->update("channel", array('masters' => $masters), "id='{$ChannelId}'"); Channel($ChannelId, 1); } } AddMsg_Public("5\t{$uid}", $ChannelId); exit('1'); break; case 'addfriend': $uid = Char_Cv('uid'); $A = explode(',', API_LsFriend()); if (in_array($uid, $A)) {
exit('<script>top.location.href="login.php?channel=' . $Channel['id'] . '";</script>'); } if ($Channel['maxusr'] != -1 && Online($channelid) >= $Channel['maxusr']) { API_Logout(); exit('<script>alert("本群人数已满"); if(top!==self)top.location.reload();</script>'); } $today = date('Ymd'); if ($Channel['forumid'] && $Channel['lastday'] != $today) { $api = API_Pub($bbsTitle, $bbsContent); list($tid, $url) = $api; $arr = array('lasttid' => $tid, 'lastday' => $today); if (!$db) { include_once ONEZ_ROOT . './include/db_mysql.class.php'; db_local(); $db = new onez_db(); } $db->reset(); $db->update("channel", $arr, "id='{$Channel['id']}'"); if ($Conn) { $Conn->reset(); } @unlink('onezdata/cache/channel/' . $Channel['id'] . '.php'); } if ($Channel['username'] == $username) { $grade = 28; } elseif (in_array($username, explode(',', $Channel['masters']))) { $grade = 2; } elseif ($username) { $grade = 1; } else {