📄 adminfunctions.php
字号:
$code .= "<table cellspacing=\"0\" cellpadding=\"2\" class=\"header\">\n <tr>\n <td class=\"header\">$title</td>\n <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>\n </tr>\n</table>\n<table cellpadding=\"2\" cellspacing=\"0\" class=\"main\">\n"; if ($addbr | !$addbr) { $code = ""; } return $code;}function echotablerow($title,$content,$height="",$width="") { if ($height) { $style = " style=\"height:$height"; } if ($width) { if ($style) { $style .= ";width:".$width."%\""; } else { $style = " style=\"width:$width%\""; } } elseif ($style) { $style .= "\""; } echo " <tr> <td$style>$title</td> <td>$content</td> </tr>\n";}function echotextareacode($title,$name,$value="",$rows=4,$cols=40,$optional=0,$width="") { global $browser; $htmlval = htmlspecialchars($value); if ($width) { $width = " style=\"width:$width%\""; } echo " <tr>\n <td$width>$title".iif($optional," <span class=\"red\">(可选)</span>")."</td>\n <td><textarea name=\"$name\" rows=\"$rows\" cols=\"$cols\" class=\"form\">$htmlval</textarea></td>\n </tr>\n";}function echouploadcode($title,$name,$maxfilesize=1000000,$size=40) { echo " <tr>\n <td>$title</td>\n <td>\n <input type=\"hidden\" name=\"MAX_FILE_SIZE\" value=\"$maxfilesize\" />\n <input type=\"file\" class=\"form\" name=\"$name\" size=\"$size\" />\n </td>\n </tr>\n";}function echoyesnocode($title,$name,$value=1,$yestext="Yes",$notext="No",$width1="") { if ($width1) { $width2 = 100 - $width1; $width1 = " style=\"width:$width1%\""; $width2 = " style=\"width:$width2%\""; } if ($value) { echo " <tr>\n <td$width1>$title</td>\n <td$width2>$yestext <input type=\"radio\" checked=\"checked\" name=\"$name\" value=\"1\" /> $notext <input type=\"radio\" name=\"$name\" value=\"0\" /></td>\n </tr>\n"; } else { echo " <tr>\n <td$width1>$title</td>\n <td$width2>$yestext <input type=\"radio\" name=\"$name\" value=\"1\" /> $notext <input type=\"radio\" checked=\"checked\" name=\"$name\" value=\"0\" /></td>\n </tr>\n"; }}function getmoddata() { static $moddata; if (isset($moddata)) { data_seek($moddata,0); } else { $moddata = query("SELECT id,name,text,options,enable,display FROM news_module"); } return $moddata;}function returncatoption($cat,$parentid=0,$value=0,$level=0,$showall=0) { global $userinfo,$cat_arr; if (($cat[parentid] == $parentid) & ($showall | $userinfo[canpost_.$cat[topid]])) { if ($level == 3) { $code = " <option value=\"$cat[id]\"".iif($value == $cat[id]," selected=\"selected\"","").">---- $cat[name]</option>\n"; } elseif ($level == 2) { $code = " <option value=\"$cat[id]\"".iif($value == $cat[id]," selected=\"selected\"","").">-- $cat[name]</option>\n"; $sub_arr = $cat_arr; foreach ($sub_arr AS $key => $val) { $val[id] = $key; $code .= returncatoption($val,$cat[id],$value,3,$showall); } unset($sub_arr); } else { $code = " <option value=\"$cat[id]\"".iif($value == $cat[id]," selected=\"selected\"","").">$cat[name]</option>\n"; $top_arr = $cat_arr; foreach ($top_arr AS $key => $val) { $val[id] = $key; $code .= returncatoption($val,$cat[id],$value,2,$showall); } unset($top_arr); } } return $code;}function returncheckboxcode($name,$value,$text,$checked=0) { if ($checked) { $code = " <input type=\"checkbox\" name=\"$name\" value=\"$value\" checked=\"checked\" /> $text<br />\n"; } else { $code = " <input type=\"checkbox\" name=\"$name\" value=\"$value\" /> $text<br />\n"; } return $code;}function returnlinkcode($text,$url,$newwindow=0) { if ($newwindow) { $url = "javascript:newwindow('$url')"; } return " <a href=\"".str_replace("&","&",$url)."\">$text</a>";}function returnminitable($text,$center=1,$width=50) { return " <table cellpadding=\"2\" cellspacing=\"0\"".iif($center," style=\"text-align:center\"","")." width=\"$width%\">\n$text </table>\n";}function returnminitablerow($column1="",$column2="",$column3="",$column4="",$column5="",$column6="",$column7="",$column8="",$column9="",$column10="") { $code = " <tr>\n"; $code .= iif($column1," <td>$column1</td>\n",""); $code .= iif($column2," <td>$column2</td>\n",""); $code .= iif($column3," <td>$column3</td>\n",""); $code .= iif($column4," <td>$column4</td>\n",""); $code .= iif($column5," <td>$column5</td>\n",""); $code .= iif($column6," <td>$column6</td>\n",""); $code .= iif($column7," <td>$column7</td>\n",""); $code .= iif($column8," <td>$column8</td>\n",""); $code .= iif($column9," <td>$column9</td>\n",""); $code .= iif($column10," <td>$column10</td>\n",""); $code .= " </tr>\n"; return $code;}function returnoptionrow($cell1="",$cell2="",$span=0,$highlight=0,$center=1) { $code = " <tr>\n"; if ($cell1) { $code .= " <td class=\"".iif($highlight==1,"menu_highlight","menu")."\" ".iif($span,"colspan=\"2\"".iif($center," align=\"center\"",""),"style=\"width:50%\"").">$cell1</td>\n"; } if ($cell2) { $code .= " <td class=\"".iif($highlight==2,"menu_highlight","menu")."\">$cell2</td>\n"; } $code .= " </tr>\n"; return $code;}function updateadminlog($extra_info="") { global $action,$staffid,$modname; $temp_action = explode("_",$action); if ($modname) { $script = $modname; } else { $script = $temp_action[0]; } unset($temp_action[0]); $script_action = join("_",$temp_action); $ipaddress = getenv("REMOTE_ADDR"); query("INSERT INTO news_adminlog VALUES (NULL,'$staffid','".time()."','$script','$script_action','$extra_info','$ipaddress')");}function updatehiddenvar($name,$value="") { $htmlval = htmlspecialchars($value); $GLOBALS[formhiddenfields] .= " <input type=\"hidden\" name=\"$name\" value=\"$htmlval\" />\n";}function writeallpages() { global $cat_arr,$timeoffset,$newsdate,$newsperpage,$forumpath,$version,$homeurl,$pagesetid,$themeid,$foruminfo; global $sitename,$defaultcategory; static $gettitles,$getmods; $old_themeid = $themeid; $old_pagesetid = $pagesetid; $get_tempsets = query("SELECT news_theme.id, news_pageset.id AS pagesetid FROM news_pageset LEFT JOIN news_theme ON news_pageset.id = news_theme.pagesetid WHERE news_theme.id <> '' GROUP BY news_theme.pagesetid"); while ($set_arr = fetch_array($get_tempsets)) { $GLOBALS[themeid] = $set_arr[id]; $GLOBALS[pagesetid] = $set_arr[pagesetid]; writeaboutus(); writearticles(); writesubpages(); foreach ($cat_arr AS $key => $val) { if ($val[displaymain]) { writeindex($key); } writecomment($key); } writepolls(); $catid = $defaultcategory; $cat_name = $cat_arr[$catid][name]; $info = getsitebits($catid); $announcement = $info[ann]; $forumoptions = $info[forumoptions]; $module_links = $info[mod_links]; $recentpost = $info[recentpost]; eval("\$menu = \"".returnpagebit("menu_$catid")."\";"); eval("\$header = \"$info[header]\";"); eval("\$footer = \"$info[footer]\";"); $moddata = getmoddata(); while ($mod_arr = fetch_array($moddata)) { $modname = $mod_arr[name]; $modid = $mod_arr[id]; if (file_exists("modules/$modname/writepages.php") & $mod_arr[enable]) { getmodoptions($modid,"",$mod_arr[options]); include("modules/$modname/writepages.php"); } } } $GLOBALS[themeid] = $old_themeid; $GLOBALS[pagesetid] = $old_pagesetid;}if (!function_exists("verifyid")) { function verifyid($table,$checkid,$fieldname="id") { settype($checkid,"integer"); if (empty($checkid)) { adminerror("无效ID","你指定了一个无效id."); } $checkid = query_first("SELECT COUNT($fieldname) AS count FROM $table WHERE $fieldname = $checkid"); if ($checkid[count] == 0) { adminerror("无效ID","你指定了一个无效id."); } }}/*======================================================================*\|| ####################################################################|| # VirtuaNews is not free software|| # Downloaded: [WDYL-WTN]|| # File: includes/adminfunctions.php|| ####################################################################\*======================================================================*/?>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -