📄 modfix.php
字号:
<?
/*
BMForum Plus! Bulletin Board Systems
Version : Plus!
This is a freeware, but don't change the copyright information.
A SourceForge Project - GNU Licence project.
Web Site: http://www.bmforum.com
Copyright (C) Bluview Technology
*/
$forumfile="datafile/forumdata.php";
require("datafile/config.php");
require("getskin.php");
if (empty($target) || !file_exists("{$idpath}forum$target")) {
$status="$gl[229]";
include("header.php");
navi_bar($gl[230],
"<a href=\"forums.php?forumid=$target\">$forum_name</a>",
"MA","no");
print_err();
include("footer.php");
exit;
}
$forumid=$target;
require("lang/$language/global.php");
get_forum_info();
$check_user=0;
if ($login_status==1 && $check_user==0 && file_exists("datafile/admin.php")) {
$adminlist=file("datafile/admin.php");
$admincount=count($adminlist);
for ($i=0; $i<$admincount; $i++) {
$detail=explode("|", str_replace("\n","", $adminlist[$i]));
if ($detail[0]==$forumid && $detail[1]==$username) $check_user=1;
if ($detail[0]==$forum_cid && $detail[1]==$username) $check_user=1;
if ($forum_upid!="" && $detail[0]==$forum_upid && $detail[1]==$username) $check_user=1;
}
}
if ($usertype[21]=="1") $check_user=1;
if ($usertype[22]=="1") $check_user=1;
if (!$modcenter_true) $check_user=0;
if ($check_user==0) {
$status=$gl[217];
include("header.php");
navi_bar($gl[230],
"<a href=\"forums.php?forumid=$forumid\">$forum_name</a>",
"MA","no");
print_err();
include("footer.php");
exit;
}
include("header.php");
navi_bar($gl[230],
"<a href=\"forums.php?forumid=$forumid\">$forum_name</a>",
"MA","no");
print <<<EOT
<table width=$tablewidth border=0 cellspacing=0 cellpadding=0 align=center bgcolor=$bordercolor>
<tr>
<td>
<table width=100% border=0 cellspacing=1 cellpadding=3>
<tr bgcolor=$titlecolor background=$header_tile>
<td bgcolor=$titlecolor background=$header_tile class=title>$gl[243]</td>
</tr>
<tr bgcolor=$backgroundcolor>
<td><Br>
EOT;
if (file_exists($forumfile)) {
$forumdata=file($forumfile);
}
$count=count($forumdata);
$t=time();
if (empty($action)) {
print <<<EOT
$gl[244] $gl[463]
$content<p><p><table align=center><< <a href=javascript:history.go(-1)>$gl[15]</a></table></td>
</tr>
<tr align=left bgcolor=$subcolor>
<td bgcolor=$titlecolor background=$header_tile > </td>
</tr>
</table>
</td>
</tr>
</table></body></html>
EOT;
include("footer.php");
exit;
}elseif ($action=="cleanup"){
if (($method=="byamount" && empty($limitnum)) || ($method=="bydate" && empty($limitdate))) {
print "<b>$gl[245]</b>
<br><b>$gl[246]</b><br><br>
>> <a href='javascript:history.go(-1)'>$gl[15]</a></table></table>";
include("footer.php");
exit;
}
if ($target=="all") {
for ($i=0; $i<$count; $i++) {
$detail=explode("|",$forumdata[$i]);
if ($detail[0]!="<?exit;?>category") clean_up_forum($detail[3]);
}
} else {
clean_up_forum($target);
}
update_sum();
}elseif ($action=="updatecount"){
if ($target=="all") {
for ($i=0; $i<$count; $i++) {
$detail=explode("|",$forumdata[$i]);
if ($detail[0]!="<?exit;?>category") update_count_forum($detail[3]);
}
} else {
update_count_forum($target);
}
update_sum();
}elseif ($action=="fixindex"){
fix_index($target);
//$newlist=readfromfile("{$idpath}forum$target/list.php");
//$newlist=push_heldtopics1($newlist);
// writetofile("{$idpath}forum$target/list.php",$newlist);
}
print "<b>$gl[247]</b>
<br><b>$gl[248]</b><br><br>
>> <a href='javascript:history.go(-1)'>$gl[15]</a></td></tr>
</td></tr></table></table>";
include("footer.php");
exit;
function clean_up_forum($id) {
//--------Clear the old posts in a forum-----------
global $method,$limitnum,$limitdate,$t,$idpath;
if (!file_exists("{$idpath}forum$id/last_mo.php")) return;
$listfile = "{$idpath}forum$id/list.php";
$lastmofile = "{$idpath}forum$id/last_mo.php";
$listdata = explode("\n",readfromfile($listfile));
$count = count($listdata);
$topictominus=0;
if ($method=="byamount") {
for ($i=$limitnum; $i<$count; $i++) {
if (empty($listdata[$i])) continue;
$detail = explode("|",$listdata[$i]);
unset($listdata[$i]);
unlink("{$idpath}forum$id/$detail[5]");
$topictominus=$topictominus+$detail[6]+1;
}
}elseif ($method=="bydate") {
$limitdate=$limitdate*86400;
for ($i=0; $i<$count; $i++) {
if (empty($listdata[$i])) continue;
$detail = explode("|",$listdata[$i]);
list($nouse1,$nouse2,$lasttime)=explode(",",$detail[8]);
if ($t-$lasttime>$limitdate) {
unset($listdata[$i]);
if (file_exists("{$idpath}forum$id/$detail[5]")) unlink("{$idpath}forum$id/$detail[5]");
if (file_exists("{$idpath}forum$id/$detail[5].buy")) unlink("{$idpath}forum$id/$detail[5].buy");
if (file_exists("{$idpath}forum$id/$detail[5].sta")) unlink("{$idpath}forum$id/$detail[5].sta");
$topictominus=$topictominus+$detail[6]+1;
}
}
}
writetofile($listfile, implode("\n",$listdata));
$temp=explode("|",readfromfile($lastmofile));
$temp[1]-=$topictominus;
writetofile($lastmofile,"$temp[0]|$temp[1]");
//----淇
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -