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'; } }
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; }