📄 printpage.cgi
字号:
#!/usr/bin/perl
#############################################################
# LeoBoard ver.5000 / LB5000 / 雷傲超级论坛 ver.5000
#
# 版权所有: 雷傲工作室(原蓝宝石软件工作室)
#
# 制作人 : 山鹰糊 (Shining Hu)
# 花无缺 (Ifairy Han)
#
# 主页地址: http://www.CGIer.com/ CGI 编程者之家
# http://www.LeoBoard.com/ 雷傲论坛支持主页
# http://www.leoBBS.com/ 本论坛直通车
#
#############################################################
BEGIN {
$LBPATH = '.';
my $pgm = $0;
$pgm =~s/\\/\//g;
$pgm =~s/^.*\/([^\/]+)$/$1/g;
unless (-e $LBPATH.'/'.$pgm) {
foreach ($0, $ENV{'SCRIPT_FILENAME'}, $ENV{'PATH_TRANSLATED'}) {
s!\\!/!g; s/^(.*)\/[^\/]+$/$1/g;
if (-e $_ . '/' .$pgm) { $LBPATH = $_; last; }
}
}
unshift (@INC, "$LBPATH");
}
use LBCGI;
$LBCGI::POST_MAX=2000;
$LBCGI::DISABLE_UPLOADS = 1;
$LBCGI::HEADERS_ONCE = 1;
require "code.cgi";
require "data/boardinfo.cgi";
require "data/styles.cgi";
require "lb.lib.pl";
require "visitforum.lib.pl";
$|++; # Unbuffer the output
$thisprog = "printpage.cgi";
$query = new LBCGI;
&ipbanned; #封杀一些 ip
$inforum = $query -> param('forum');
$intopic = $query -> param('topic');
print header(-charset=>gb2312);
&error("打开文件&老大,别乱黑我的程序呀!") if (($intopic) && ($intopic !~ /^[0-9]+$/));
&error("打开文件&老大,别乱黑我的程序呀!") if (($inforum) && ($inforum !~ /^[0-9]+$/));
if (-e "${lbdir}data/style${inforum}.cgi") { require "${lbdir}data/style${inforum}.cgi"; }
if (! $inmembername) { $inmembername = $query->cookie("amembernamecookie"); }
if (! $inpassword) { $inpassword = $query->cookie("apasswordcookie"); }
$inmembername =~ s/[\a\f\n\e\0\r\t\`\~\!\@\#\$\%\^\&\*\(\)\+\=\\\{\}\;\'\:\"\,\.\/\<\>\?]//isg;
$inpassword =~ s/[\a\f\n\e\0\r\t\|\@\;\#\{\}\$]//isg;
if ($inmembername eq "" || $inmembername eq "客人" ) {
$inmembername = "客人";
$myrating = -1;
if ($regaccess eq "on") {
print header(-cookie=>[$namecookie, $passcookie], -charset=>gb2312);
print "<script language='javascript'>document.location = 'loginout.cgi?forum=$inforum'</script>";
exit;
}
}
else {
# &getmember("$inmembername");
&getmembernolock("$inmembername");
$mymembercode=$membercode;
$myrating=$rating;
&error("普通错误&密码与用户名不相符,请重新登录!") if ($inpassword ne $password);
&error("普通错误&此用户根本不存在!") if ($userregistered eq "no");
&getoneforum("$inforum");
# &moderator("$inforum");
$myinmembmod = $inmembmod;
if (($allowedentry{$inforum} eq "yes")||($membercode eq "ad")||($membercode eq 'smo')||($inmembmod eq "yes")) { $allowed = "yes"; } else { $allowed = "no"; }
&getlastvisit;
$forumlastvisit = $lastvisitinfo{$inforum};
$currenttime = time;
&setlastvisit("$inforum,$currenttime");
}
# &getoneforum("$inforum");
$filetoopen = "$lbdir" . "forum$inforum/$intopic.thd.cgi";
&winlock($filetoopen) if ($OS_USED eq "Nt");
open(FILE, "$filetoopen");
flock(FILE, 1) if ($OS_USED eq "Unix");
@threads = <FILE>;
close(FILE);
&winunlock($filetoopen) if ($OS_USED eq "Nt");
($trash, $topictitle, $trash) = split(/\t/, @threads[0]);
$topictitle =~ s/^*#!&*//;
$postdate = &dateformat($postdate + ($timedifferencevalue*3600) + ($timezone*3600));
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("进入论坛&你一般会员不允许进入此论坛!"); }
if (($privateforum eq "yes") && ($allowed ne "yes")) {
&error("进入私密论坛&对不起,你无权访问这个论坛!");
}
else {
my $filetoopens = "$lbdir" . "data/onlinedata.cgi";
$filetoopens = &lockfilename($filetoopens);
if (!(-e "$filetoopens.lck")) {
if ($privateforum ne "yes") {
&whosonline("$inmembername\t$forumname\tnone\t浏览<a href=\"topic.cgi?forum=$inforum&topic=$intopic\"><b>$topictitle</b></a>(文本方式)\t");
}
else {
&whosonline("$inmembername\t$forumname(密)\tnone\t浏览保密贴子(文本方式)\t");
}
}
}
if (($dofilter eq "no")||($dofilter eq "all")) {
$topictitle = &postwordfilter("$topictitle");
}
if($category=~/childforum-[0-9]+/){
$tempforumno=$category;
$tempforumno=~s/childforum-//;
$filetoopen = "${lbdir}forum$tempforumno/foruminfo.cgi";
open(FILE, "$filetoopen");
$forums = <FILE>;
close(FILE);
(undef, undef, undef, $tempforumname, undef) = split(/\t/,$forums);
$addlink=qq~\n <b>-- $tempforumname</b> ($boardurl/forums.cgi?forum=$tempforumno)<br>~;
$addspace="-";
}
$output .= qq~
<html><head><title>$boardname</title>
<style>
A:visited { TEXT-DECORATION: none }
A:active { TEXT-DECORATION: none }
A:hover { TEXT-DECORATION: underline overline }
A:link { text-decoration: none;}
A:visited { text-decoration: none;}
A:active { TEXT-DECORATION: none;}
A:hover { TEXT-DECORATION: underline overline}
.t { LINE-HEIGHT: 1.4 }
BODY { FONT-FAMILY: 宋体; FONT-SIZE: 9pt }
TD { FONT-FAMILY: 宋体; FONT-SIZE: 9pt }
SELECT { FONT-FAMILY: 宋体; FONT-SIZE: 9pt; }
INPUT { FONT-FAMILY: 宋体; FONT-SIZE: 9pt; height:22px; }
TEXTAREA{ FONT-FAMILY: 宋体; FONT-SIZE: 9pt; }
DIV { FONT-FAMILY: 宋体; FONT-SIZE: 9pt }
FORM { FONT-FAMILY: 宋体; FONT-SIZE: 9pt }
OPTION { FONT-FAMILY: 宋体; FONT-SIZE: 9pt }
P { FONT-FAMILY: 宋体; FONT-SIZE: 9pt }
TD { FONT-FAMILY: 宋体; FONT-SIZE: 9pt }
BR { FONT-FAMILY: 宋体; FONT-SIZE: 9pt }
</style>
</head>
<body topmargin=10 leftmargin=0 onload="window.print()">
<table cellpadding=0 cellspacing=0 border=0 width=90% align=center>
<tr>
<td>
<p><b>以文本方式查看主题</b><p>
<b>- $boardname</b> ($boardurl/leoboard.cgi)<br>$addlink
<b>$addspace-- $forumname</b> ($boardurl/forums.cgi?forum=$inforum)<br>
<b>$addspace--- $topictitle</b> ($boardurl/forums.cgi?forum=$inforum&topic=$intopic)
</tr>
</table>
<p><p><p>
<table cellpadding=0 cellspacing=0 border=0 width=90% align=center>
<tr><td>
~;
if ($mymembercode eq "ad" or $mymembercode eq "smo" or $myinmembmod eq "yes") {
$viewhide = 1;
}
else {
$viewhide = 0;
if ($hidejf eq "yes" ) {
my @viewhide=grep(/^$inmembername\t/i,@threads);
$viewhide=@viewhide;
$viewhide=1 if($viewhide >= 1);
}
}
$StartCheck=$numberofposts+$numberofreplys;
$rn = 1;
foreach $line (@threads) {
($membername, $topictitle, $postipaddress, $showemoticons, $showsignature, $postdate, $post) = split(/\t/,$line);
# $post = "(密)" if ($post=~/LBHIDDEN\[(.*?)\]LBHIDDEN/sg);
# $post =~ s/(\[hide\])(.+?)(\[\/hide\])/(本部分内容已经隐藏)/isg;
# $post =~s/\[post=(.+?)\](.+?)\[\/post\]/(本内容已被隐藏)/isg;
if ($wwjf ne "no") {
if ($post=~/LBHIDDEN\[(.*?)\]LBHIDDEN/sg) {
if (($inmembername eq $membername)||($mymembercode eq "ad") || ($mymembercode eq 'smo') || ($myinmembmod eq "yes")|| ($myrating >= $1) ){
}else{
$post=qq~<FONT COLOR=$fonthighlight><B>[Hidden Post: Rating $1]</B></FONT> <BR> <BR> <FONT COLOR=$posternamecolor>(您没有权限看这个帖子,您的威望至少需要 <B>$1<\/B>)</FONT><BR> <BR> ~;
$addme="附件保密!<br>";
}
$post=~s/LBHIDDEN\[(.*?)\]LBHIDDEN/<font color=$fonthighlight>(此贴只有威望大于等于 <B>$1<\/B> 的才能察看)<\/font><br>/sg;
}
}
else { $post=~s/LBHIDDEN\[(.*?)\]LBHIDDEN//; }
if ($hidejf eq "yes" ) {
if ($viewhide ne "1") {
$post =~ s/(\[hide\])(.+?)(\[\/hide\])/<blockquote><font color=$posternamecolor>隐藏: <hr noshade size=1><font color=$fonthighlight>本部分内容已经隐藏,必须回复后,才能查看<\/font><hr noshade size=1><\/blockquote><\/font><\/blockquote>/isg;
}
else {
$post =~ s/\[hide\](.*)\[hide\](.*)\[\/quote](.*)\[\/hide\]/<blockquote><font color=$posternamecolor>隐藏: <hr noshade>$1<blockquote><hr noshade size=1>$2<hr noshade size=1><\/blockquote>$3<\/font><hr noshade><\/blockquote>/isg;
$post =~ s/\[hide\]\s*(.*?)\s*\[\/hide\]/<blockquote><font color=$posternamecolor>隐藏: <hr noshade size=1>$1<hr noshade size=1><\/blockquote><\/font>/isg;
}
}
if ($postjf eq "yes") {
if ($post =~m/\[post=(.+?)\](.+?)\[\/post\]/isg){
$viewusepost=$1;
if ($StartCheck >= $viewusepost) { $Checkpost='ok'; } else { $Checkpost='not'; }
if(($Checkpost eq 'ok')||($mymembercode eq "ad")||($mymembercode eq "smo")||($myinmembmod eq "yes")||($membername eq $inmembername)){
$post =~s/\[post=(.+?)\](.+?)\[\/post\]/<blockquote><font color=$posternamecolor>文章内容:(发言总数须有 <B>$viewusepost<\/B> 才能查看本贴) <hr noshade size=1>$2<hr noshade size=1><\/font><\/blockquote>/isg;
}else{
$post =~s/\[post=(.+?)\](.+?)\[\/post\]/<blockquote><font color=$posternamecolor>文章内容: <hr noshade size=1><font color=$fonthighlight>本内容已被隐藏 , 发言总数须有 <B>$viewusepost<\/B> 才能查看<\/font><hr noshade size=1><\/font><\/blockquote>/isg;
}
}
}
# $post = &lbcode("$post");
$postdate = &dateformat($postdate + ($timedifferencevalue*3600) + ($timezone*3600));
if (($dofilter eq "no")||($dofilter eq "all")) {
$post = &postwordfilter("$post");
}
$output .= qq~
<p>
<hr><p>
-- 作者: $membername<BR>
-- 发布时间: $postdate<p>
$post
<p><p>
~;
$rn ++;
}
my $boardcopyright = qq(©\; $copyrightinfo) if $copyrightinfo;
$boardcopyright =~ s/</</g; $boardcopyright =~ s/>/>/g; $boardcopyright =~ s/"/\"/g;
$output .= qq~
</td></tr></table><center><hr width=90%><font color=$fontcolormisc>
$boardcopyright 版本: <a href="http://www.leoboard.com/download.htm">$versionnumber</a>
</font></center>
</body></html>
~;
print $output;
exit;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -