array ( 'name' => '我的勋章', 'url' => '/certs-manage/my' ), 'aboutme' => array ( 'name' => '自定义页面', 'url' => '/certs-manage/aboutme' ), 'songs' => array ( 'name' => '我要推歌', 'url' => '/certs-manage/songs' ), 'luogu' => array ( 'name' => 'Luogu 账号管理', 'url' => '/certs-manage/luogu' ) ); if (!isset($tabs_info[$cur_tab])) { become404Page(); } if ($_POST['certs'] != '') { $certs = DB::escape($_POST['certs']); $username = $myUser['username']; if (!in_array($certs, explode(',', $myUser['certslist']))) becomeMsgPage('
你好像没有这个勋章
'); DB::update("update user_info set certs = \"$certs\" where username = \"$username\""); becomeMsgPage("

成功切换!

"); } $aboutme_form = new UOJForm('aboutme_form'); $aboutme_form->addInput('blogid', 'text', '博客 ID', '', function ($x) { if (!validateUInt($x)) return 'ID 不合法'; if (!queryBlog($x)) return '博客不存在'; return ''; }, null); $aboutme_form->handle = function () { global $myUser; $id = $_POST['blogid']; DB::update("update user_info set aboutme_blogid = $id where username = '{$myUser['username']}'"); }; $aboutme_form->runAtServer(); $luogu_form = new UOJForm('luogu_form'); $luogu_form->addInput('luogu_uid', 'text', 'Luogu UID', '', function ($x) { if (!validateUInt($x)) return '不是整数'; return ''; }, null); $luogu_form->addInput('luogu_clientid', 'text', '__client_id(在 Cookie 中)', '', function ($x) { return ''; }, null); $luogu_form->handle = function () { global $myUser; $luid = DB::escape($_POST['luogu_uid']); $lcid = DB::escape($_POST['luogu_clientid']); $username = $myUser['username']; DB::update("update user_info set luogu_uid = '$luid', luogu_clientid = '$lcid' where username = '$username'"); }; $luogu_form->runAtServer(); $song_form = new UOJForm('songs_form'); $song_form->addInput('song_name', 'text', '歌名', '', function ($x) { if (strlen($x) > 200) return '歌名太长了'; return ''; }, null); $song_form->addInput('writer_name', 'text', '作者', '', function ($x) { if (strlen($x) > 200) return '作者名字太长了'; return ''; }, null); $song_form->addInput('album_name', 'text', '专辑', '', function ($x) { if (strlen($x) > 200) return '专辑名太长了'; return ''; }, null); $song_form->addInput('cover_url', 'text', '封面链接', '', function ($x) { if (strlen($x) > 256) return '封面链接过长'; return ''; }, null); $song_form->addInput('click_url', 'text', '歌曲链接', '', function ($x) { if (strlen($x) > 256) return '歌曲链接过长'; return ''; }, null); $song_form->handle = function () { global $myUser; $song_name = DB::escape(HTML::escape($_POST['song_name'])); $writer_name = DB::escape(HTML::escape($_POST['writer_name'])); $album_name = DB::escape(HTML::escape($_POST['album_name'])); $cover_url = DB::escape(HTML::escape($_POST['cover_url'])); $click_url = DB::escape(HTML::escape($_POST['click_url'])); $username = $myUser['username']; DB::insert("insert into songs (name, writer, album, cover, click, user) values " . "('$song_name', '$writer_name', '$album_name', '$cover_url', '$click_url', '$username')"); }; $song_form->runAtServer(); ?>

我的勋章

设置自定义页面

printHTML(); ?>

我要推歌!

printHTML(); ?>

Luogu 账号管理

printHTML(); ?>