📄 adminfunctions.php
字号:
<?php/*======================================================================*\|| #################################################################### |||| # VirtuaNews - 1.0.4 Pro License ID - [WDYL-WTN]|| # ---------------------------------------------------------------- # |||| # All code in this file is ?2002 VirtuaSystems . # |||| # This file may not be redistributed in whole or significant part. # |||| # --------------- VIRTUANEWS IS NOT FREE SOFTWARE ---------------- # |||| # http://www.virtuanews.co.uk # |||| # http://www.virtuanews.co.uk/license.php # |||| #################################################################### ||\*======================================================================*/function adminerror($title,$error) { global $pagetitle; $GLOBALS[errorcode] = urlencode($title); echohtmlheader(); echotableheader("错误 - $title",1); echotabledescription("<b>抱歉, $error</b>",1,1); echotabledescription("<b>".returnlinkcode("返回","javascript:history.back(1)")."</b>",1,1); echotablefooter(); echohtmlfooter(); exit;}function cleanlocation() { $location = getenv("REQUEST_URI"); $location .= iif(!getenv("QUERY_STRING"),"?"); $location = xss_clean($location); if (substr_count($location,"menu=")) { $location = preg_replace("/([^\"]*)menu=([^\"]*)&([^\"]*)/i","\\1&\\3",$location); $location = preg_replace("/([^\"]*)menu=([^\"]*)$/i","\\1",$location); $location = preg_replace("/([^\"]*)&&([^\"]*)/i","\\1&\\2",$location); if (substr($location,-1) == "&") { $location = substr($location,0,-1); } } if (substr_count($location,"useframes=")) { $location = preg_replace("/([^\"]*)useframes=([^\"]*)&([^\"]*)/i","\\1&\\3",$location); $location = preg_replace("/([^\"]*)useframes=([^\"]*)$/i","\\1",$location); $location = preg_replace("/([^\"]*)&&([^\"]*)/i","\\1&\\2",$location); if (substr($location,-1) == "&") { $location = substr($location,0,-1); } } return $location;}function echoadminredirect($redirect="") { if ($redirect) { $meta = "<meta http-equiv=\"refresh\" content=\"1; url=$redirect\">"; } echohtmlheader($meta); echotableheader("修改并保存",1); echotabledescription("你的修改现在已经保存.",1); echotabledescription("如果你的浏览器不能自动转向, 请点击 <a href=\"$redirect\">这</a>",1); echotablefooter(); echohtmlfooter();}function echodatecode($title,$prefix,$usedate=0,$width1="",$note="") { if ($width1) { $width2 = 100 - $width1; $width1 = " style=\"width:$width1%\""; $width2 = " style=\"width:$width2%\""; } echo " <tr>\n <td$width1>$title</td>\n <td$width2>\n"; $monthnames = array(1=> "一月", "二月", "三月", "四月", "五月", "六月", "七月", "八月", "九月", "十月", "十一月", "十二月"); echo " <select name=\"".$prefix."month\" class=\"form\">\n"; foreach ($monthnames AS $key => $val) { echo " <option value=\"$key\"".iif(intval(date("m",$usedate)) == $key," selected=\"selected\"","")."> $val </option>\n"; } echo " </select>\n"; echo " <select name=\"".$prefix."day\" class=\"form\">\n"; for ($i=1;$i<=31;$i++) { echo " <option value=\"$i\"".iif(intval(date("d",$usedate)) == $i," selected=\"selected\"","")."> $i </option>\n"; } echo " </select>\n"; echo " <select name=\"".$prefix."year\" class=\"form\">\n"; $startyear = date("Y",$usedate); for($i=$startyear-5;$i<=$startyear+5;$i++) { echo " <option value=\"$i\"".iif(intval(date("Y",$usedate)) == $i," selected=\"selected\"","")."> $i </option>\n"; } echo " </select>\n"; echo iif($note," $note",""); echo " </td>\n </tr>\n";}function echodeleteconfirm($what,$action,$id,$extratext="",$extraurl="",$do="delete") { echohtmlheader(); echotableheader(ucwords($do)." ".ucwords($what),1); echotabledescription("<b>Are you sure you want to continue and $do this $what? $extratext</b>",1); echotabledescription("<b><a href=\"admin.php?action=$action&id=$id$extraurl\">Yes</a> / <a href=\"javascript:history.back(1)\">No</a></b>",1,1); echotablefooter(); echohtmlfooter();}function echoformfooter($colspan=2,$value="Submit",$showpreview=0,$extra="") { global $formhiddenfields; echo " <tr> <td colspan=\"$colspan\" align=\"center\">$formhiddenfields <input type=\"submit\" name=\"submit\" value=\"$value\" class=\"form\" />$extra <input type=\"reset\" name=\"reset\" value=\"Reset\" class=\"form\" />\n"; if ($showpreview) { echo " <input type=\"submit\" name=\"preview\" value=\"Preview\" class=\"form\" />\n"; } echo " </td> </tr></table></form>\n";}function echoformheader($target,$title,$colspan=2,$uploadform=0,$formname="form") { global $action,$errorcode; if ($uploadform) { $enctype = " enctype=\"multipart/form-data\""; } $GLOBALS[formhiddenfields] = " <input type=\"hidden\" name=\"action\" value=\"$target\" />\n"; echo "<form action=\"admin.php\" method=\"post\" name=\"$formname\" id=\"$formname\"$enctype><table cellspacing=\"0\" cellpadding=\"2\" class=\"header\"> <tr> <td class=\"header\">$title</td> <td class=\"help\"><a href=\"javascript:newwindow('http://safeurl.de/?http://www.virtuanews.co.uk/main/modules.php?modname=help&adminaction=$action&errorcode=$errorcode')\"><span class=\"help\">帮助</span></a></td> </tr></table><table cellpadding=\"2\" cellspacing=\"2\" class=\"main\">\n";}function echohtmlfooter() { global $debug,$version,$action,$loggedin,$gzipoutput,$gziplevel,$adminnav,$db_query_time; if ($loggedin & ($adminnav == "page")) { echo "\n </td>\n </tr>\n</table>\n"; } if ($action != "misc_menu") { echo "<table width=\"100%\"> <tr> <td align=\"center\">VirtuaNews(牧野星空汉化)管理控制台 Version $version</td> </tr>\n"; if ($debug > 0) { global $pagestarttime,$db_query_count; $pageendtime = microtime(); $starttime = explode(" ",$pagestarttime); $endtime = explode(" ",$pageendtime); $totaltime = $endtime[0]-$starttime[0]+$endtime[1]-$starttime[1]; settype($db_query_count,"integer"); if ($debug > 2) { echo " <tr> <td align=\"center\">页面生成 $totaltime 秒 有 $db_query_count queries<br>".round((($db_query_time/$totaltime)*100),2)."% of the time doing MySQL things and ".round(((($totaltime-$db_query_time)/$totaltime)*100),2)."% doing PHP things</td> </tr>\n"; } else { echo " <tr> <td align=\"center\">页面生成 ".round($totaltime,4)." 秒,有 $db_query_count 个数据库查询</td> </tr>\n"; } } if ($debug == 3) { global $db_query_arr; if (!empty($db_query_arr)) { echo " <tr>\n <td>\n SQL Queries:<br />\n <pre>\n"; foreach ($db_query_arr AS $val) { $val = htmlspecialchars($val); $val = preg_replace("/^SELECT/i","<font style=\"color:red;font-weight:bold\">选择</font>",$val); $val = preg_replace("/^UPDATE/i","<font style=\"color:blue;font-weight:bold\">更新</font>",$val); $val = preg_replace("/^DELETE/i","<font style=\"color:orange;font-weight:bold\">删除</font>",$val); $val = preg_replace("/^INSERT/i","<font style=\"color:green;font-weight:bold\">插入</font>",$val); echo "$val\n"; } echo " </pre>\n </td>\n </tr>\n"; } } echo "</table>\n"; } echo "\n</div>\n</body></html>"; if ($gzipoutput) { $page = ob_get_contents(); ob_end_clean(); $page = gzipoutput($page,$gziplevel); header("Content-Length: ".strlen($page)); echo $page; }}function echohtmlheader($javascript="") { global $sitename,$loggedin,$gzipoutput,$action,$adminnav,$admindirectory; global $canpostnews,$userinfo,$use_forum,$newsallowlogoup,$adminmenu,$adminmenu,$browser,$location,$adminnav; if ($gzipoutput) { ob_start(); } if ($javascript == "qhtmlcode") { $javascript = "<script type=\"text/javascript\" src=\"$admindirectory/qhtmlcode.js\"></script>"; } elseif ($javascript == "adminjs") { $javascript = "<script type=\"text/javascript\" src=\"$admindirectory/adminjs.js\"></script>"; } echo "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\"><html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"en\" lang=\"en\"><head> <title>$sitename 管理控制台</title> <meta http-equiv=\"Content-Type\" content=\"text/html; charset=gb2312\" /> <link rel=\"stylesheet\" type=\"text/css\" href=\"$admindirectory/style.css\" /> $javascript <script type=\"text/javascript\"> <!-- function newwindow(windowurl) { window.open(windowurl); } --> </script>"; $GLOBALS[useragent] = getenv("HTTP_USER_AGENT"); $GLOBALS[browser] = getbrowser(); if ((($GLOBALS[browser] == "MSIE") & ($adminnav == "page") & $loggedin) | ($action == "misc_menu")) { echo "<script type=\"text/javascript\" src=\"$admindirectory/toggle.js\"></script>\n";
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -