📄 fav.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 "data/boardinfo.cgi";
require "data/styles.cgi";
require "code.cgi";
require "lb.lib.pl";
$|++; # Unbuffer the output
$thisprog = "fav.cgi";
$query = new LBCGI;
&ipbanned; #封杀一些 ip
$inshow = $query -> param('show');
$inshow = &stripMETA("$inshow");
for ('forum','topic','membername','password','action','checked','member') {
next unless defined $_;
next if $_ eq 'SEND_MAIL';
$tp = $query->param($_);
$tp = &cleaninput("$tp");
${$_} = $tp;
}
srand;
$inforum = $forum;
$intopic = $topic;
$inmembername = $membername;
$inpassword = $password;
&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"; }
print header(-charset=>gb2312);
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 = "客人";
}
else {
# &getmember("$inmembername");
&getmembernolock("$inmembername");
&error("普通错误&此用户根本不存在!") if ($userregistered eq "no");
}
$inmembername =~ s/ /_/g;
$inmembername =~ tr/A-Z/a-z/;
my %Mode = (
'add' => \&add,
'del' => \&del,
);
if($Mode{$action}) {
$Mode{$action}->();
}
elsif (($member ne "")&&($action eq "show")) { &list; }
else { &error("普通&请以正确的方式访问本程序"); }
&output(
-Title => $boardname,
-ToPrint => $output,
-Version => $versionnumber
);
sub add {
if (($intopic eq "")&&($inforum eq "")){&error("加入个人收藏&没有指定贴子ID和论坛ID");exit;}
# &getmember("$inmembername");
if ($userregistered eq "no") { &error("加入个人收藏&你没有注册!"); exit; }
elsif ($inpassword ne $password) { &error("加入个人收藏&你的密码错误."); exit; }
elsif ($inmembername eq "") { &error("加入个人收藏&你没有个人收藏."); exit; }
elsif ($inmembername eq "客人") { &error("加入个人收藏&你没有个人收藏."); exit; }
&mischeader("加入个人收藏");
if ($checked eq "yes") {
my $file = "$lbdir" . "memfav/$inmembername.cgi";
if (-e $file) {
open (ENT, $file);
@toptopic = <ENT>;
close (ENT);
open (ENT, ">$file");
print ENT "$intopic\t$inforum\t\n";
foreach $topic (@toptopic) {
chomp $topic;
($topic,$forum)=split(/\t/,$topic);
if (($topic eq $intopic)&&($forum eq $inforum)) {
}else{
print ENT "$topic\t$forum\t\n";
}
}
close (ENT);
}
else {
open (ENT, ">$file");
print ENT "$intopic\t$inforum\t\n";
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="fav.cgi?action=show&member=$inmembername">返回我的收藏</a>
<li><a href="forums.cgi?forum=$inforum">返回论坛</a>
<li><a href="leoboard.cgi">返回论坛首页</a>
</ul>
</tr>
</td>
</table></td></tr></table>
~;
} # end if clear to edit
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="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=$miscbacktwo colspan=2 align=center><input type=submit name="submit" value="登 陆"></td></form></tr></table></td></tr></table>
</table></td></tr></table>
~;
}
} # end
sub del {
if (($intopic eq "")&&($inforum eq "")){&error("删除个人收藏&没有指定贴子ID和论坛ID");exit;}
# &getmember("$inmembername");
if ($userregistered eq "no") { &error("删除个人收藏&你没有注册!"); exit; }
elsif ($inpassword ne $password) { &error("删除个人收藏&你的密码错误."); exit; }
elsif ($inmembername eq "") { &error("删除个人收藏&你没有个人收藏."); exit; }
elsif ($inmembername eq "客人") { &error("删除个人收藏&你没有人收藏."); exit; }
&mischeader("删除个人收藏");
if ($checked eq "yes") {
my $file = "$lbdir" . "memfav/$inmembername.cgi";
if (-e $file) {
open (ENT, $file);
@toptopic = <ENT>;
close (ENT);
open (ENT, ">$file");
foreach $topic (@toptopic) {
chomp $topic;
($topic,$forum)=split(/\t/,$topic);
if (($topic ne $intopic)||($forum ne $inforum)) {
print ENT "$topic\t$forum\t\n";
}
}
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="fav.cgi?action=show&member=$inmembername">返回我的收藏</a>
<li><a href="forums.cgi?forum=$inforum">返回论坛</a>
<li><a href="leoboard.cgi">返回论坛首页</a>
</ul>
</tr>
</td>
</table></td></tr></table>
~;
} # end if clear to edit
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>
~;
}
} # end
sub list
{
$member =~ s/ /_/g;
$member =~ tr/A-Z/a-z/;
&error("普通错误&老大,别乱黑我的程序呀!") if (($member =~ m/\//)||($member =~ m/\\/)||($member =~ m/\.\./));
$member =~ s/\///g;
$member =~ s/\.\.//g;
$member =~ s/\\//g;
if ($member eq ""){&error("查看个人收藏&没有指定会员");}
if ((!(-e "${lbdir}$memdir/$member.cgi"))&&(!(-e "${lbdir}$memdir/old/$member.cgi"))) {&error("查看个人收藏&没有该会员!");}
# &getmember("$inmembername");
if ($userregistered eq "no") { &error("查看个人收藏&你没有注册!"); exit; }
elsif ($inpassword ne $password) { &error("查看个人收藏&你的密码错误."); exit; }
elsif ($inmembername eq "") { &error("查看个人收藏&你没有权力查看该用户的个人收藏."); exit; }
elsif ($inmembername eq "客人") { &error("查看个人收藏&你没有权力查看该用户的个人收藏."); exit; }
$cleartoedit = "no";
if (($membercode eq "ad") || ($membercode eq 'smo')|| ($member eq $inmembername)) { $cleartoedit = "yes"; }
unless ($cleartoedit eq "yes") { $cleartoedit = "no"; }
if ($cleartoedit eq "no") { &error("查看个人收藏&该个人收藏设定保密中,只有他本人可以看!"); }
my $filetoopens = "$lbdir" . "data/onlinedata.cgi";
$filetoopens = &lockfilename($filetoopens);
if (!(-e "$filetoopens.lck")) {
&whosonline("$inmembername\tnone\tnone\t查看个人收藏\t");
}
&title;
if ($boardlogo =~ /\.swf$/i) {$forumgraphic = qq~<PARAM NAME=PLAY VALUE=TRUE><PARAM NAME=LOOP VALUE=TRUE><PARAM NAME=QUALITY VALUE=HIGH><embed src=$imagesurl/myimages/$boardlogo quality=high width=$boardlogow height=$boardlogoh pluginspage="http:\/\/www.macromedia.com\/shockwave\/download\/index.cgi?P1_Prod_Version=ShockwaveFlash" type="application\/x-shockwave-flash"><\/embed>~}
else {$forumgraphic = qq~<img src=$imagesurl/myimages/$boardlogo>~};
$output .= qq~
<table cellpadding=0 cellspacing=0 border=0 width=$tablewidth align=center>
<tr>
<td width=30% rowspan=2 valign=top>$forumgraphic
</td>
<td valign=top>
<font color=$fontcolormisc>
<font color=$fontcolormisc>
<img src=$imagesurl/images/closedfold.gif width=15 height=11> <a href=leoboard.cgi>$boardname</a><br>
<img src=$imagesurl/images/bar.gif width=15 height=15><img src=$imagesurl/images/openfold.gif width=15 height=11> 查看个人收藏
</td>
</tr>
</tr>
</table>
<br>
<style>
.drb { border: $tablebordercolor solid; border-width: 0px 1px 1px 0px}
</style>
<span id=forum>
<table cellspacing=0 border=0 width=$tablewidth bgcolor=$tablebordercolor align=center>
<tr><td height=1></td></tr>
</table>
<table cellpadding=0 cellspacing=0 width=$tablewidth align=center>
<tr>
<td bgcolor=$tablebordercolor width=1 height=24></td>
<td bgcolor=$titlecolor width=32 align=center><font color=$titlefontcolor><b>状态</b></td>
<td bgcolor=$tablebordercolor width=1></td>
<td bgcolor=$titlecolor width=* align=center><font color=$titlefontcolor><b>主 题</b> (点心情符为新闻方式浏览)</td>
<td bgcolor=$tablebordercolor width=1></td>
<td bgcolor=$titlecolor align=center width=80><font color=$titlefontcolor><b>作 者</b></td>
<td bgcolor=$tablebordercolor width=1></td>
<td bgcolor=$titlecolor align=center width=32><font color=$titlefontcolor><b>回复</b></td>
<td bgcolor=$tablebordercolor width=1></td>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -