📄 jinghua.cgi
字号:
close (LIST);
$listall = @listall;
if ($listall >= 200) {
if (open (LIST, ">$file")) {
flock (LIST, 2) if ($OS_USED eq "Unix");
foreach (@inforumwrite) {
chomp $_;
print LIST "$_\n" if ($_ ne "");
}
foreach (@listall) {
chomp $_;
print LIST "$_\n" if ($_ ne "");
}
close (LIST);
}
&winunlock($file) if (($OS_USED eq "Unix")||($OS_USED eq "Nt"));
}
else {
&winunlock($file) if (($OS_USED eq "Unix")||($OS_USED eq "Nt"));
rebuildLIST(-Forum=>"$movetoid");
}
$newthreadnumber ++;
if (open(FILE, ">${lbdir}boarddata/lastnum$movetoid.cgi")) {
print FILE $newthreadnumber;
close(FILE);
}
$filetoopen = "$lbdir" . "data/allforums.cgi";
&winlock($filetoopen) if ($OS_USED eq "Nt");
open(FILE, "$filetoopen");
flock(FILE, 2) if ($OS_USED eq "Unix");
@allforums = <FILE>;
close(FILE);
if (open(FILE, ">$filetoopen")) {
flock(FILE, 2) if ($OS_USED eq "Unix");
foreach (@allforums) {
chomp $_;
next if ($_ eq "");
($forumid, $category, $categoryplace, $forumname, $forumdescription, $forummoderator ,$htmlstate ,$idmbcodestate ,$privateforum, $startnewthreads ,$lastposter1 ,$lastposttime1, $threads, $posts, $forumgraphic, $ratings, $misc,$forumpass,$hiddenforum,$indexforum,$teamlogo,$teamurl, $fgwidth, $fgheight, $miscadd3, $miscadd4, $miscad5) = split(/\t/,$_);
if ($movetoid eq $forumid) {
$threads = $alloldposts + $threads;
$posts = $posts + $alloldthreadposts;
$lastposter = $startedby if ($lastposter eq "");
$topictitle =~ s/^*#!&*//;
my $newthreadnumber = $newthreadnumber - 1;
$lastposttime = "$currenttime\%\%\%$newthreadnumber\%\%\%$topictitle";
print FILE "$forumid\t$category\t$categoryplace\t$forumname\t$forumdescription\t$forummoderator\t$htmlstate\t$idmbcodestate\t$privateforum\t$startnewthreads\t$lastposter\t$lastposttime\t$threads\t$posts\t$forumgraphic\t$ratings\t$misc\t$forumpass\t$hiddenforum\t$indexforum\t$teamlogo\t$teamurl\t$fgwidth\t$fgheight\t$miscadd3\t$miscadd4\t$miscad5\t\n";
}
else { print FILE "$_\n"; }
}
close(FILE);
}
&winunlock($filetoopen) if ($OS_USED eq "Nt");
$filetomake = "${lbdir}data/boardstats.cgi";
require "$filetomake";
$totalthreads = $totalthreads + $alloldposts;
$totalposts = $totalposts + $alloldthreadposts;
&winlock($filetomake) if ($OS_USED eq "Nt");
if (open(FILE, ">$filetomake")) {
flock(FILE, 2) if ($OS_USED eq "Unix");
print FILE "\$lastregisteredmember = \'$lastregisteredmember\'\;\n";
print FILE "\$totalmembers = \'$totalmembers\'\;\n";
print FILE "\$totalthreads = \'$totalthreads\'\;\n";
print FILE "\$totalposts = \'$totalposts\'\;\n";
print FILE "\n1\;";
close (FILE);
}
&winunlock($filetomake) if ($OS_USED eq "Nt");
}
$output .= qq~<table cellpadding=0 cellspacing=0 border=0 width=$tablewidth bgcolor=$tablebordercolor align=center><tr><td>
<table cellpadding=6 cellspacing=1 border=0 width=100%>
<tr><td bgcolor=$miscbacktwo align=center><font color=$fontcolormisc><b>标记精华贴子成功</b></font></td></tr>
<tr><td bgcolor=$miscbackone><font color=$fontcolormisc>具体情况:<ul>
<li><a href="jinghua.cgi?action=list&forum=$inforum">返回精华区</a>
<li><a href="forums.cgi?forum=$inforum">返回论坛</a>
<li><a href="leoboard.cgi">返回论坛首页</a>
</ul></tr></td></table></td></tr></table>
<meta http-equiv="refresh" content="3; url=forums.cgi?forum=$inforum">
~;
}
else {
$inmembername =~ s/\_/ /g;
open(FILE, "${lbdir}data/allforums.cgi");
my @forums = <FILE>;
close(FILE);
$jumphtml .= "<option value=\"\">选择一个论坛\n</option><option value=\"\">不做任何拷贝\n</option>";
$a = 0;
foreach (@forums) {
chomp $_;
next if ($_ eq "");
$a = sprintf("%09d",$a);
($movetoforumid, $category, $categoryplace, $forumname, $forumdescription, $noneed ,$noneed ,$noneed ,$noneed, $startnewthreads ,$noneed ,$noneed, $noneed, $noneed, $noneed, $ratings, $noneed,$forumpass,$hiddenforum,$indexforum,$teamlogo,$teamurl, $fgwidth, $fgheight, $miscadd3, $miscadd4, $miscad5) = split(/\t/,$_);
$categoryplace = sprintf("%09d",$categoryplace);
$rearrange = ("$categoryplace\t$a\t$category\t$forumname\t$forumdescription\t$movetoforumid\t$forumgraphic\t$startnewthreads\t$ratings\t$misc\t$forumpass\t$hiddenforum\t$indexforum\t$teamlogo\t$teamurl\t$fgwidth\t$fgheight\t$miscadd3\t$miscadd4\t$miscad5\t");
push (@rearrangedforums, $rearrange);
$a++;
}
@finalsortedforums = sort (@rearrangedforums);
foreach (@finalsortedforums) {
($categoryplace,my $a, $category, $forumname, $forumdescription, $movetoforumid, $forumgraphic, $startnewthreads,$ratings, $misc,$forumpass,$hiddenforum,$indexforum,$teamlogo,$teamurl, $fgwidth, $fgheight, $miscadd3, $miscadd4, $miscad5) = split(/\t/,$_);
if ((($startnewthreads eq "no")||($startnewthreads eq "cert"))&&($movetoforumid ne $inforum)) {
$jumphtml .= "<option value=\"$movetoforumid\">$forumname\n</option>";
}
}
$output .= qq~<table cellpadding=0 cellspacing=0 border=0 width=$tablewidth bgcolor=$tablebordercolor align=center>
<tr><td><table cellpadding=6 cellspacing=1 border=0 width=100%>
<tr><td bgcolor=$miscbacktwo colspan=2 align=center>
<form action="$thisprog" method="post">
<input type=hidden name="action" value="add">
<input type=hidden name="checked" value="yes">
<input type=hidden name="forum" value="$inforum">
<input type=hidden name="topic" value="@intopic">
<font color=$fontcolormisc><b>请输入您的用户名、密码进入版主模式 [标记精华贴子]</b></font></td></tr>
<tr><td bgcolor=$miscbackone><font color=$fontcolormisc>请输入您的用户名</font></td>
<td bgcolor=$miscbackone><input type=text name="membername" value="$inmembername"></td></tr>
<tr><td bgcolor=$miscbackone><font color=$fontcolormisc>请输入您的密码</font></td>
<td bgcolor=$miscbackone><input type=password name="password" value="$inpassword"> <font color=$fontcolormisc><a href="profile.cgi?action=lostpass" style="cursor:help">忘记密码?</a></font></td></tr>
<tr><td bgcolor=$miscbackone valign=top><font color=$fontcolormisc><b>拷贝一份至精华区:</b></font></td>
<td bgcolor=$miscbackone valign=top><font color=$fontcolormisc><select name="movetoid">$jumphtml</select></font></td></tr>
<tr><td bgcolor=$miscbacktwo colspan=2 align=center><input type=submit name="submit" value="登 陆"></td></form></tr></table></td></tr></table>
</table></td></tr></table>
~;
}
}
sub del {
&mischeader("取消精华贴子");
$cleartoedit = "no";
if (($membercode eq "ad") && ($inpassword eq $password)) { $cleartoedit = "yes"; }
if (($membercode eq "smo") && ($inpassword eq $password)) { $cleartoedit = "yes"; }
if (($inmembmod eq "yes") && ($inpassword eq $password)) { $cleartoedit = "yes"; }
unless ($cleartoedit eq "yes") { $cleartoedit = "no"; }
if ($cleartoedit eq "no") { &error("取消精华贴子&您不是本论坛坛主或版主,或者您的密码错误!"); }
if (($cleartoedit eq "yes") && ($checked eq "yes")) {
my $file = "$lbdir" . "boarddata/jinghua$inforum.cgi";
if (-e $file) {
open (ENT, $file);
@toptopic = <ENT>;
close (ENT);
if (open (ENT, ">$file")) {
foreach (@toptopic) {
chomp $_;
if ($_ ne $intopic) {
print ENT "$_\n" if ((-e "${lbdir}forum$inforum/$_.thd.cgi")&&($_ ne ""));
}
}
close (ENT);
}
}
$output .= qq~<table cellpadding=0 cellspacing=0 border=0 width=$tablewidth bgcolor=$tablebordercolor align=center><tr><td>
<table cellpadding=6 cellspacing=1 border=0 width=100%>
<tr><td bgcolor=$miscbacktwo align=center><font color=$fontcolormisc><b>取消精华贴子成功</b></font></td></tr>
<tr><td bgcolor=$miscbackone><font color=$fontcolormisc>具体情况:<ul>
<li><a href="jinghua.cgi?action=list&forum=$inforum">返回精华区</a>
<li><a href="forums.cgi?forum=$inforum">返回论坛</a>
<li><a href="leoboard.cgi">返回论坛首页</a>
</ul></tr></td></table></td></tr></table>
<meta http-equiv="refresh" content="3; url=forums.cgi?forum=$inforum">
~;
}
else {
$inmembername =~ s/\_/ /g;
$output .= qq~<table cellpadding=0 cellspacing=0 border=0 width=$tablewidth bgcolor=$tablebordercolor align=center><tr><td>
<table cellpadding=6 cellspacing=1 border=0 width=100%>
<tr><td bgcolor=$miscbacktwo colspan=2 align=center>
<form action="$thisprog" method="post">
<input type=hidden name="action" value="del">
<input type=hidden name="checked" value="yes">
<input type=hidden name="forum" value="$inforum">
<input type=hidden name="topic" value="$intopic">
<font color=$fontcolormisc><b>请输入您的用户名、密码进入版主模式 [取消精华贴子]</b></font></td></tr>
<tr><td bgcolor=$miscbackone><font color=$fontcolormisc>请输入您的用户名</font></td>
<td bgcolor=$miscbackone><input type=text name="membername" value="$inmembername"></td></tr>
<tr><td bgcolor=$miscbackone><font color=$fontcolormisc>请输入您的密码</font></td>
<td bgcolor=$miscbackone><input type=password name="password" value="$inpassword"> <font color=$fontcolormisc><a href="profile.cgi?action=lostpass" style="cursor:help">忘记密码?</a></font></td></tr>
<tr><td bgcolor=$miscbacktwo colspan=2 align=center><input type=submit name="submit" value="登 陆"></td></form></tr></table></td></tr></table>
</table></td></tr></table>
~;
}
}
sub list {
&mischeader("本版精华贴子");
if ("$privateforum" eq "yes"){
if ($inmembername eq "客人") {
print "<script language='javascript'>document.location = 'loginout.cgi?forum=$inforum'</script>";
exit;
}
$testentry = cookie("forumsallowed$inforum");
if ((($testentry eq $forumpass)&&($testentry ne ""))||(($userregistered ne "no")&&($allowedentry{$inforum} eq "yes"))||($membercode eq "ad")||($membercode eq 'smo')||($inmembmod eq "yes")) {
if ($inpassword ne $password) { &error("进入论坛&密码错误,你不允许进入该论坛!"); }
} else { &accessneeded; }
}
if (($startnewthreads eq "cert")&&(($membercode ne "ad" && $membercode ne "smo" && $membercode ne "cmo" && $membercode ne "mo" && $membercode ne "rz")||($inmembername eq "客人"))&&($userincert eq "no")) { &error("进入论坛&一般会员不允许进入此论坛!"); }
my $filetoopens = "$lbdir" . "data/onlinedata.cgi";
$filetoopens = &lockfilename($filetoopens);
if (!(-e "$filetoopens.lck")) {
if ($privateforum ne "yes") {
&whosonline("$inmembername\t$forumname\tnone\t查看论坛上的精华贴子\t");
}
else {
&whosonline("$inmembername\t$forumname(密)\tnone\t查看保密论坛上的精华贴子\t");
}
}
$output.=qq~
<style>
TABLE {BORDER-TOP: 0px; BORDER-LEFT: 0px; BORDER-BOTTOM: 1px; }
TD {BORDER-RIGHT: 0px; BORDER-TOP: 0px; color: $fontcolormisc; }
.ha {color: $fonthighlight; font: bold;}
.hb {color: $menufontcolor; font: bold;}
.dp {padding: 4px 0px;}
</style>
<span id=forum>
<table cellspacing=0 width=$tablewidth bgcolor=$tablebordercolor align=center>
<tr><td height=1></td></tr></table><center>
<table cellpadding=0 cellspacing=0 width=$tablewidth height=24 bordercolor=$tablebordercolor border=1>
<tr><td bgcolor=$titlecolor width=32 align=center $catbacks><font color=$titlefontcolor><b>状态</b></td>
<td bgcolor=$titlecolor width=* align=center $catbacks><font color=$titlefontcolor><b>主 题</b> (点心情符为新闻方式阅读)</td>
<td bgcolor=$titlecolor align=center width=80 $catbacks><font color=$titlefontcolor><b>作 者</b></td>
<td bgcolor=$titlecolor align=center width=32 $catbacks><font color=$titlefontcolor><b>回复</b></td>
<td bgcolor=$titlecolor align=center width=32 $catbacks><font color=$titlefontcolor><b>点击</b></td>
<td bgcolor=$titlecolor width=195 align=center $catbacks><font color=$titlefontcolor><b> 最后更新 | 最后回复人</b></td>
</tr></table>
~;
$icon_num = int(rand(10));
$topcount = 0;
$filetoopen = "$lbdir" . "boarddata/jinghua$inforum.cgi";
if (-e $filetoopen) {
&winlock($filetoopen) if (($OS_USED eq "Unix")||($OS_USED eq "Nt"));
open(FILE, "$filetoopen");
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -