📄 jinghua.cgi
字号:
flock(FILE, 2) if ($OS_USED eq "Unix");
@ontop = <FILE>;
close(FILE);
&winunlock($filetoopen) if (($OS_USED eq "Unix")||($OS_USED eq "Nt"));
}
else { undef @ontop; }
$topcount = @ontop;
$numberofpages = $topcount / 25;
if ($topcount > 25) {
$showmore = "yes";
if ($inshow eq "" || $inshow < 0) { $inshow = 0; }
if ($inshow > 0) { $startarray = $inshow; }
else { $startarray = 0; }
$endarray = $inshow + 25 - 1;
if ($endarray < ($topcount - 1)) { $more = "yes"; }
elsif (($endarray > (25 - 1)) && ($more ne "yes")) { $endarray = $topcount -1; }
}
else {
$showmore = "no";
$startarray = 0;
$topicpages = qq~<font color=$menufontcolor>本精华区只有一页</font>~;
$endarray = $topcount -1;
}
if ($showmore eq "yes") {
if (25 < $topcount) {
($integer,$decimal) = split(/\./,$numberofpages);
if ($decimal > 0) { $numberofpages = $integer + 1; }
$mypages=$numberofpages;
#分页
$intshow=$inshow/(12*25);
($intshow,$mydecimal) = split(/\./,$intshow);
$intshow = $intshow + 1;
$preshow=($intshow-1)*12*25-25;
$nextshow=$intshow*12*25;
$pages=qq~<a href="$thisprog?action=list&forum=$inforum&show=$preshow"><font color=$menufontcolor><b>←</b></font></a> ~ if ($intshow > 1);
if ($numberofpages > ($intshow*12)){
$numberofpages=($intshow*12);
$isnext=qq~<a href="$thisprog?action=list&forum=$inforum&show=$nextshow"><font color=$menufontcolor><b>→</b></font></a> ~;
}
$pagestart = ($intshow-1)*12*25;
$counter = ($intshow-1)*12;
while ($numberofpages > $counter) {
$counter++;
if ($inshow ne $pagestart) { $pages .= qq~<a href="$thisprog?action=list&forum=$inforum&show=$pagestart"><font color=$menufontcolor><b>$counter</b></font></a> ~; }
else { $pages .= qq~<font color=$fonthighlight><b>$counter</b></font> ~; }
$pagestart = $pagestart + 25;
}
$pages .= $isnext;
#分页end
}
$topicpages = qq~<font color=$menufontcolor><b>本精华区共有 <font color=$fonthighlight>$mypages</font> 页</b> [ $pages ]~;
}
if ($topcount > 0) {
for ($i=$startarray;$i<=$endarray;$i++) {
$id=$ontop[$i];
chomp $id;
$rr = &readthreadpl($inforum,$id);
if ($rr ne "") {push (@toptopic, $rr);}
}
}
else { undef @toptopic; }
$topiccount = 0;
foreach $topic (@toptopic) {
chomp $topic;
($lastpostdate, $topicid, $topictitle, $topicdescription, $threadstate, $threadposts, $threadviews, $startedby, $startedpostdate, $lastposter, $posticon, $posttemp) = split(/\t/,$topic);
next if ($topicid eq "");
if ($posticon ne "") {
$poll=0;
if ($posticon =~/<br>/i){
$posticon = int(rand(23));
$posticon = "0$posticon" if ($posticon<10);
$posticon = qq~<img src=$imagesurl/posticons/$posticon.gif border=0 alt="新闻方式浏览">~;
}
else{
$posticon = qq~<img src=$imagesurl/posticons/$posticon border=0 alt="新闻方式浏览">~;
}
}
else {
$posticon = int(rand(23));
$posticon = "0$posticon" if ($posticon<10);
$posticon = qq~<img src=$imagesurl/posticons/$posticon.gif border=0 alt="新闻方式浏览">~;
}
$topictitle =~ s/^*#!&*//;
$lastpostdatetemp=$lastpostdate;
$lastpostdate=$lastpostdatetemp;
$topcount = $threadposts + 1;
$topcount = $topcount / 12;
$counter = 0;
if ($topcount > 12) {
if (12 < $topcount) {
($integer,$decimal) = split(/\./,$topcount);
if ($decimal > 0) { $topcount = $integer + 1; }
$pagestart = 0;
while ($topcount > $counter) {
$counter++;
$threadpages .= qq~<a href=topic.cgi?forum=$inforum&topic=$topicid&start=$pagestart><font color=$fonthighlight><b>$counter</b></font></a> ~;
$pagestart = $pagestart + 12;
}
}
$pagestoshow = qq~<font color=$forumfontcolor> [第 $threadpages 页]</font>~;
}
if ($lastpostdate ne "") {
$lastpostdate = $lastpostdate + ($timedifferencevalue*3600) + ($timezone*3600);
$longdate = &dateformatshort("$lastpostdate");
$lastpostdate = qq~<font color=$fontcolormisc>$longdate</font>~;
}
else {
$lastpostdate = qq~<font color=$fontcolormisc>没有~;
$lastpoststamp = "";
}
$startedpostdate = $startedpostdate + ($timedifferencevalue*3600) + ($timezone*3600);
$startedlongdate = &shortdate("$startedpostdate");
$startedshorttime = &shorttime("$startedpostdate");
$startedpostdate = qq~<font color=$fontcolormisc>$startedlongdate</font>~;
$screenmode = $query->cookie("screenmode");
$topictitlemax = 54;
$topictitlemax = 84 if (($screenmode >=8)||($tablewidth > 770));
$posttemp = "(无内容)" if ($posttemp eq "");
if (length($topictitle)>$topictitlemax) { $topictitletemp = substr($topictitle,0,$topictitlemax-4)." ..."; }
else { $topictitletemp = $topictitle; }
$topictitle = qq~<ACRONYM TITLE="最后回复摘要:\n\n$posttemp"><a href=topic.cgi?forum=$inforum&topic=$topicid target=_blank>$topictitletemp</a></ACRONYM>~;
$startedbyfilename = $startedby;
$startedbyfilename =~ s/ /\_/isg;
$startedbyfilename =~ tr/A-Z/a-z/;
if ($startedby=~/\(客\)/) { $startedby=~s/\(客\)//isg; $startedby=qq~<font color=$postfontcolorone title="此为未注册用户">$startedby</font>~; } else { $startedby=qq~<a href=profile.cgi?action=show&member=~ . ($uri_escape eq "no" ? $startedbyfilename : uri_escape($startedbyfilename)) . qq~>$startedby</a>~; }
if (($threadstate eq "poll")||($threadstate eq "pollclosed")) { $outputtemp = qq~<td bgcolor=$forumcolortwo align=center width=63 rowspan=2><ACRONYM TITLE="回复数:$threadposts, 点击数:$threadviews">共 $size 票</ACRONYM></font></td>~; } else { $outputtemp = qq~<td bgcolor=$forumcolortwo align=center width=30><font color=$forumfontcolor>$threadposts</font></td><td bgcolor=$forumcolortwo align=center width=30><font color=$forumfontcolor>$threadviews</font></td>~; }
if ($lastposter) {
$lastposterfilename = $lastposter;
$lastposterfilename =~ s/ /\_/isg;
if ($lastposter=~/\(客\)/) {
$lastposter=~s/\(客\)//isg;
$lastposter = qq~<font color=$postfontcolorone title="此为未注册用户">$lastposter</font>~;
}
else {
$lastposter = qq~<a href=profile.cgi?action=show&member=~ . ($uri_escape eq "no" ? $lastposterfilename : uri_escape($lastposterfilename)) . qq~>$lastposter</a>~;
}
}
else {$lastposter = qq~<font color=$fontcolormisc>--------</a>~;}
$topicdescriptiontemp = $topicdescription;
$topicdescriptiontemp =~s/\s*(.*?)\s*\<a \s*(.*?)\s*\>\s*(.*?)\s*\<\/a\>/$3/isg;
$topicdescriptiontemp =~s/\<\/a\>//isg;
if (length($topicdescriptiontemp) > ($topictitlemax-4)) {
$topicdescriptiontemp = substr($topicdescriptiontemp,0, $topictitlemax-8) . " ...";
$topicdescription =~s/\<a \s*(.*?)\s*\>\s*(.*?)\s*\<\/a\>/\<a $1\>$topicdescriptiontemp\<\/a\>/isg;
}
if ($topicdescription) { $topicdescription = qq~<br> -=> $topicdescription~; }
if ($counter == 0) { $pagestoshowtemp1 = 0; }
else { $pagestoshowtemp1 =7;}
$totlelength = $counter*3.3 + $pagestoshowtemp1 + length($topictitletemp) + 4; #标题栏的总长度
undef $pagestoshowtemp1;
if (($membercode eq "ad") ||($membercode eq "smo") || ($inmembmod eq "yes")) {
$admini = qq~<DIV ALIGN=Right><font color=$titlecolor>|<a href=jinghua.cgi?action=del&forum=$inforum&topic=$topicid&checked=yes><font color=$titlecolor>除</font></a>|<a href=jinghua.cgi?action=add&forum=$inforum&topic=$topicid><font color=$titlecolor>提</font></a>|<a href=postings.cgi?action=lock&forum=$inforum&topic=$topicid&checked=yes><font color=$titlecolor>锁</font></a>|<a href=postings.cgi?action=unlock&forum=$inforum&topic=$topicid&checked=yes><font color=$titlecolor>解</font></a>|</font> </DIV>~;
}else{
$admini="";
}
$topicicon = "<img src=$imagesurl/images/jh.gif width=15 border=0>";
if (($threadstate eq "poll")||($threadstate eq "pollclosed")) {
$size = 0;
if (open(FILE, "${lbdir}forum$forumid/$topicid.poll.cgi")) {
my @allpoll = <FILE>;
close(FILE);
$size = @allpoll;
}
}
if (($threadstate eq "poll")||($threadstate eq "pollclosed")) { $outputtemp = qq~<td bgcolor=$forumcolortwo align=center width=63 rowspan=2><ACRONYM TITLE="回复数:$threadposts, 点击数:$threadviews">共 $size 票</ACRONYM></font></td>~; } else { $outputtemp = qq~<td bgcolor=$forumcolortwo align=center width=30><font color=$forumfontcolor>$threadposts</font></td><td bgcolor=$forumcolortwo align=center width=30><font color=$forumfontcolor>$threadviews</font></td>~; }
$topictitle=$topictitle."<BR>" if ($totlelength > $topictitlemax+5);
$output .=qq~
<table cellspacing=0 width=$tablewidth bordercolor=$tablebordercolor border=1><tr><td align=center width=30 bgcolor=$forumcolorone><a href=topic.cgi?forum=$inforum&topic=$topicid target=_blank>$topicicon</a></td>
<td width=* class=dp bgColor=$forumcolortwo onmouseover="this.bgColor='$forumcolorone';" onmouseout="this.bgColor='$forumcolortwo';"> <a href=view.cgi?forum=$inforum&topic=$topicid target=_blank>$posticon</a> <span id=forum>$topictitle$pagestoshow$topicdescription$admini</span></td>
<td align=center width=78 bgcolor=$forumcolorone>$startedby</td>$outputtemp<td width=193 bgcolor=$forumcolorone> $lastpostdate<font color=$fonthighlight> | </font>$lastposter</td></tr></table>
~;
$pagestoshow = undef;
$threadpages = undef;
$topiccount++;
}
$output .= qq~
</tr></table></td>
</tr></table></span>
<table cellpadding=0 cellspacing=2 border=0 width=$tablewidth align=center>
<tr height=4></tr>
<tr>
<td>$topicpages</td>
</tr></table>
</tr>
</table>
<br>
~;
}
sub accessneeded {
$output .= qq~<form action="forums.cgi" method=post>
<input type=hidden name="forum" value="$inforum">
<input type=hidden name="action" value="accessrequired">
<table cellpadding=0 cellspacing=0 border=0 width=$tablewidth bgcolor=$tablebordercolor align=center><tr><td>
<table cellpadding=3 cellspacing=1 border=0 width=100%>
<tr><td bgcolor=$miscbacktwo colspan=2 align=center><font color=$fontcolormisc><b>请输入您的名称、密码登录私有论坛</b></font></td></tr>
<tr><td bgcolor=$miscbackone colspan=2><font color=$fontcolormisc><br>每个浏览器只需要登录一次,同时请确认你已经打开了浏览器的 Cookies 选项!<br>只有经过管理员许可的用户才可以访问该论坛,如果你不能登录,请联系管理员!<br><br></td></tr>
<tr><td bgcolor=$miscbackone><font color=$fontcolormisc>请输入您的用户名</font></td>
<td bgcolor=$miscbackone><input type=text name="membername" value="$inmembername"> <font color=$fontcolormisc><span onclick="javascript:location.href='register.cgi?forum=$inforum'" style="cursor:hand">您没有注册?</span></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><font color=$fontcolormisc>请输入论坛访问密码</font></td>
<td bgcolor=$miscbackone><input type=password name="forumpassword" value="$forumpassword"> <font color=$fontcolormisc>如果你已经授权允许进入,则不必输入密码.</font></td></tr>
<tr height=28><td bgcolor=$miscbackone colspan=2 align=center><font color=$fontcolormisc>如果你确认输入了正确的密码,但还是无法登录的话,请刷新此页面(或者再次按登录键一次)。</td></tr>
<tr><td bgcolor=$miscbacktwo colspan=2 align=center><input type=submit name="submit" value="登 陆"></td></tr></table></td></tr></table>
</form>
~;
&output( -Title => "$forumname", -ToPrint => $output, -Version => $versionnumber );
exit;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -