📄 lb.lib.pl
字号:
if ($category =~ /childforum-[0-9]+/) {
my $tempforumno = $category;
$tempforumno =~ s/childforum-//;
my @thisparentforums = grep(/^$tempforumno\t/, @forums);
(undef, undef, undef, undef, undef, $fmod, undef) = split(/\t/, $thisparentforums[0]);
$fmod =~ s/\,\,/\,/ig;
$fmod =~ s/\, /\,/ig;
$fmod =~ s/ \,/\,/ig;
$fmod =~ s/\,$//ig;
$fmod =~ s/^\,//ig;
@forummodnames1 = split(/\,/, $fmod);
}
#分区版主获得
if (open(CATEFILE, "${lbdir}boarddata/catemod${categoryplace}.cgi")) {
$catemods = <CATEFILE>;
close(CATEFILE);
chomp($catemods);
$catemods =~ s/\, /\,/ig;
$catemods =~ s/ \,/\,/ig;
$catemods =~ s/\,\,/\,/ig;
$catemods =~ s/\,$//ig;
$catemods =~ s/^\,//ig;
@catemodnames = split(/\,/, $catemods);
}
my $cmodnumber = @catemodnames;
my $modnumber = @forummodnames;
my $modnumber1 = @forummodnames1;
if ($thisprog eq "forums.cgi") {
$modoutput = qq~<img src=$imagesurl/images/team2.gif width=19 height=19 align=absmiddle><select OnChange="surfto(this);"><option style="color: $fonthighlight">本版管理员列表</option>~ if ($modnumber > 0 || $modnumber1 > 0 || $cmodnumber > 0);
if ($cmodnumber > 0) {
$modoutput .= qq~<option style="background-color: $titlecolor">本分类区版主:</option>~;
foreach (@catemodnames) {
&getmodout($_);
}
}
if ($modnumber > 0) {
$modoutput .= qq~<option style="background-color: $titlecolor">本论坛版主:</option>~;
foreach (@forummodnames) {
&getmodout($_);
}
}
if ($modnumber1 > 0) {
$modoutput .= qq~<option style="background-color: $titlecolor">父论坛版主:</option>~;
foreach (@forummodnames1) {
&getmodout($_);
}
}
$modoutput .= "</select>\n" if ($modnumber > 0 || $modnumber1 > 0 || $cmodnumber > 0);
} else {
$forummodnamestemp = ",$forummoderator,$fmod,$catemods,";
$inmembmod = "yes" if ($forummodnamestemp =~ /\,$inmembername\,/i || (($membercode eq "cmo" || $membercode eq "mo") && ($forummodnamestemp =~ /,全体版主,/ || $forummodnamestemp =~ /,全体斑竹,/)));
}
undef $forummoderator; undef $fmod; undef $catemods; undef @catemodnames; undef @forummodnames; undef @forummodnames1;
return;
}
sub getmodout {
my $modname = shift;
return if ($modname eq "");
my $cleanedmodname = $modname;
$cleanedmodname =~ s/ /\_/g;
$inmembmod = "yes" if (lc($inmembername) eq lc($modname) || (($membercode eq "cmo" || $membercode eq "mo") && ($modname eq "全体版主" || $modname eq "全体斑竹")));
if ($modname =~ m/管理员/isg || m/诚聘中/isg || m/暂时空缺/isg || m/版主/isg || m/斑竹/isg || m/坛主/isg) {
$modoutput .= qq~<option>$modname</option>~;
} else {
$modoutput .= qq~<option value="~ . ($uri_escape eq "no" ? $cleanedmodname : uri_escape($cleanedmodname)) . qq~">$modname</option>~;
}
return;
}
sub getforum {
my $inforum = shift;
if ($#forums < 1) {
my $filetoopen = "$lbdir" . "data/allforums.cgi";
&winlock($filetoopen) if (($OS_USED eq "Unix")||($OS_USED eq "Nt"));
open(FILE, "$filetoopen");
flock(FILE, 1) if ($OS_USED eq "Unix");
@forums = <FILE>;
close(FILE);
&winunlock($filetoopen) if (($OS_USED eq "Unix")||($OS_USED eq "Nt"));
}
my @thisforums=grep(/^$inforum\t/,@forums);
($forumid, $category, $categoryplace, $forumname, $forumdescription, $forummoderator ,$htmlstate ,$idmbcodestate ,$privateforum, $startnewthreads ,$lastposter ,$lastposttime, $threads, $posts, $forumgraphic, $ratings, $misc,$forumpass,$hiddenforum,$indexforum,$teamlogo,$teamurl, $fgwidth, $fgheight, $miscadd3, $miscadd4, $miscad5) = split(/\t/,$thisforums[0]);
}
sub getmember {
my $nametocheck = shift;
$nametocheck =~ s/ /\_/g;
$nametocheck =~ tr/A-Z/a-z/;
$nametocheck =~ s/[\a\f\n\e\0\r\t\`\~\!\@\#\$\%\^\&\*\(\)\+\=\\\{\}\;\'\:\"\,\.\/\<\>\?]//isg;
$userregistered = "";
undef $filedata;
$nametocheck = &stripMETA($nametocheck);
my $filetoopen = "${lbdir}$memdir/$nametocheck.cgi";
$filetoopen = "${lbdir}$memdir/old/$nametocheck.cgi" if (!(-e $filetoopen));
if ((-e $filetoopen)&&($nametocheck !~ /^客人/)&&($nametocheck ne "")) {
&winlock($filetoopen) if (($OS_USED eq "Unix")||($OS_USED eq "Nt"));
open(FILE3,"$filetoopen");
flock(FILE3, 1) if ($OS_USED eq "Unix");
my $filedata = <FILE3>;
close(FILE3);
&winunlock($filetoopen) if (($OS_USED eq "Unix")||($OS_USED eq "Nt"));
chomp($filedata);
($membername, $password, $membertitle, $membercode, $numberofposts, $emailaddress, $showemail, $ipaddress, $homepage, $oicqnumber, $icqnumber ,$location ,$interests, $joineddate, $lastpostdate, $signature, $timedifference, $privateforums, $useravatar, $userflag, $userxz, $usersx, $personalavatar, $personalwidth, $personalheight, $rating, $lastgone, $visitno, $addjy, $meili, $mymoney, $postdel, $sex, $education, $marry, $work, $born, $chatlevel, $chattime, $jhmp, $useradd3,$useradd4,$onlinetime,$userquestion,$useradd6,$useradd7,$useradd8) = split(/\t/,$filedata);
$membercode = "me" if ($membercode eq "");
($signatureorigin, $signaturehtml) = split(/$signaturesplit/,$signature);
$signatureorigin =~ s/<br>/\n/g;
$timedifferencevalue = $timedifference;
($numberofposts, $numberofreplys) = split(/\|/,$numberofposts);
chomp $privateforums;
if($privateforums) {
@private = split(/&/,$privateforums);
foreach (@private) {
chomp $_;
($access, $value) = split(/=/,$_);
$allowedentry{$access} = $value;
}
}
}
else { $userregistered = "no"; $membercode =""; }
}
sub getmembernolock {
my $nametocheck = shift;
$nametocheck =~ s/ /\_/g;
$nametocheck =~ tr/A-Z/a-z/;
$nametocheck =~ s/[\a\f\n\e\0\r\t\`\~\!\@\#\$\%\^\&\*\(\)\+\=\\\{\}\;\'\:\"\,\.\/\<\>\?]//isg;
$userregistered = "";
undef $filedata;
$nametocheck = &stripMETA($nametocheck);
my $filetoopen = "${lbdir}$memdir/$nametocheck.cgi";
$filetoopen = "${lbdir}$memdir/old/$nametocheck.cgi" if (!(-e $filetoopen));
if ((-e $filetoopen)&&($nametocheck !~ /^客人/)&&($nametocheck ne "")) {
open(FILE6,"$filetoopen");
my $filedata = <FILE6>;
close(FILE6);
chomp($filedata);
($membername, $password, $membertitle, $membercode, $numberofposts, $emailaddress, $showemail, $ipaddress, $homepage, $oicqnumber, $icqnumber ,$location ,$interests, $joineddate, $lastpostdate, $signature, $timedifference, $privateforums, $useravatar, $userflag, $userxz, $usersx, $personalavatar, $personalwidth, $personalheight, $rating, $lastgone, $visitno, $addjy, $meili, $mymoney, $postdel, $sex, $education, $marry, $work, $born, $chatlevel, $chattime, $jhmp, $useradd3,$useradd4,$onlinetime,$userquestion,$useradd6,$useradd7,$useradd8) = split(/\t/,$filedata);
$membercode = "me" if ($membercode eq "");
($signatureorigin, $signaturehtml) = split(/$signaturesplit/,$signature);
$signatureorigin =~ s/<br>/\n/g;
$timedifferencevalue = $timedifference;
($numberofposts, $numberofreplys) = split(/\|/,$numberofposts);
chomp $privateforums;
if($privateforums) {
@private = split(/&/,$privateforums);
foreach (@private) {
chomp $_;
($access, $value) = split(/=/,$_);
$allowedentry{$access} = $value;
}
}
}
else { $userregistered = "no"; $membercode =""; }
}
sub error {
my $errorinfo = shift;
(my $where, my $errormsg,my $ismsg) = split(/\&/, $errorinfo);
print header(-charset=>gb2312);
if (! $inmembername) { $inmembername = cookie("amembernamecookie"); }
$inpassword = cookie("apasswordcookie");
$inmembername =~ s/[\a\f\n\e\0\r\t\`\~\!\@\#\$\%\^\&\*\(\)\+\=\\\{\}\;\'\:\"\,\.\/\<\>\?]//isg;
$inpassword =~ s/[\a\f\n\e\0\r\t\|\@\;\#\{\}\$]//isg;
if ($ismsg ne "msg") {
&title;
if ($boardlogo =~ /\.swf$/i) {$forumgraphic1 = 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 {$forumgraphic1 = qq~<img src=$imagesurl/myimages/$boardlogo border=0>~};
$output .= qq~<table cellpadding=0 cellspacing=0 border=0 width=$tablewidth align=center><tr><td width=30% rowspan=2 valign=top>$forumgraphic1</td><td valign=top>~;
if ($indexforum ne "no") { $output .= qq~<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> 错误: $where~; }
else { $output .= qq~<font color=$fontcolormisc><img src=$imagesurl/images/openfold.gif width=15 height=11> 错误: $where~; }
$output .= qq~</td></tr></table><p><table cellpadding=0 cellspacing=0 border=0 width=$tablewidth bgcolor=$tablebordercolor align=center><tr><td><table cellpadding=6 cellspacing=1 border=0 width=100%>~;
}
else { $versionnumber="msg"; }
$output .= qq~<tr><td bgcolor=$miscbacktwo align=center><font color=$fontcolormisc><b>错误: $where</b></font></td></tr>
<tr><td bgcolor=$miscbackone><font color=$fontcolormisc>
<b>关于$where错误的详细原因:</b>
<ul><li><b>$errormsg</b>
<li>您是否需要查看<span style="cursor:hand" onClick="javascript:openScript('help.cgi',500,400)">帮助文件</span>?
</ul><b>产生$where错误的可能原因:</b>
<ul><li>密码错误<li>用户名错误<li>您不是<a href="register.cgi" >注册</a>用户</ul>
<br><br><center><font color=$fontcolormisc> << <a href="javascript:history.go(-1)">返回上一页</a></center>
</tr></td></table></td></tr></table>
~;
&output( -Title => $boardname, -ToPrint => $output, -Version => $versionnumber );
exit;
}
sub uplogintime {
my($nametocheck,$visit) = @_;
my $nametochecktemp = $nametocheck;
$nametocheck =~ s/ /\_/g;
$nametocheck =~ tr/A-Z/a-z/;
$nametocheck =~ s/[\a\f\n\e\0\r\t\`\~\!\@\#\$\%\^\&\*\(\)\+\=\\\{\}\;\'\:\"\,\.\/\<\>\?]//isg;
$userregistered = "";
$nametocheck = &stripMETA($nametocheck);
my $filetoopen = "${lbdir}$memdir/$nametocheck.cgi";
$filetoopen = "${lbdir}$memdir/old/$nametocheck.cgi" if (!(-e $filetoopen));
if (-e $filetoopen) {
&winlock($filetoopen) if (($OS_USED eq "Unix")||($OS_USED eq "Nt"));
open(FILE6,"$filetoopen");
flock (FILE6, 1) if ($OS_USED eq "Unix");
my $filedata = <FILE6>;
close(FILE6);
chomp($filedata);
(my $membername, my $password, my $membertitle, my $membercode, my $numberofposts, my $emailaddress, my $showemail, my $ipaddress, my $homepage, my $oicqnumber, my $icqnumber ,my $location ,my $interests, my $joineddate, my $lastpostdate, my $signature, my $timedifference, my $privateforums, my $useravatar, my $userflag,my $userxz, my $usersx, my $personalavatar, my $personalwidth, my $personalheight, my $rating, my $lastgone, my $visitno,my $addjy,my $meili, my $mymoney, my $postdel, my $sex, my $education, my $marry, my $work, my $born, my $chatlevel,my $chattime, my $jhmp,my $useradd3,my $useradd4,my $onlinetime,my $userquestion,my $useradd6, my $useradd7, my $useradd8) = split(/\t/,$filedata);
if ($visit eq "T") {$visitno++;} else { $onlinetime = 0 if ($onlinetime =~ /[^0-9]/); $onlinetime = $onlinetime + $savedtime-$savedcometime; }
if (($membername ne "")&&($password ne "")) {
if (open(FILE6,">$filetoopen")) {
flock (FILE6, 2) if ($OS_USED eq "Unix");
$lastgone=time;
print FILE6 "$nametochecktemp\t$password\t$membertitle\t$membercode\t$numberofposts\t$emailaddress\t$showemail\t$ipaddress\t$homepage\t$oicqnumber\t$icqnumber\t$location\t$interests\t$joineddate\t$lastpostdate\t$signature\t$timedifference\t$privateforums\t$useravatar\t$userflag\t$userxz\t$usersx\t$personalavatar\t$personalwidth\t$personalheight\t$rating\t$lastgone\t$visitno\t$addjy\t$meili\t$mymoney\t$postdel\t$sex\t$education\t$marry\t$work\t$born\t$chatlevel\t$chattime\t$jhmp\t$useradd3\t$useradd4\t$onlinetime\t$userquestion\t$useradd6\t$useradd7\t$useradd8\t\n";
close(FILE6);
}
}
&winunlock($filetoopen) if (($OS_USED eq "Unix")||($OS_USED eq "Nt"));
}
}
sub numerically { $a <=> $b }
sub alphabetically { lc($a) cmp lc($b) }
sub whosonline {
my $instruct = shift;
(my $tempusername, my $where, my $method, my $where2) = split(/\t/, $instruct);
my $ipaddress = $ENV{'REMOTE_ADDR'};
$trueipaddress = $ENV{'HTTP_X_FORWARDED_FOR'};
$trueipaddress = $ipaddress if (($trueipaddress eq "")||($trueipaddress eq "unknown"));
my $trueipaddress1 = $ENV{'HTTP_CLIENT_IP'};
$trueipaddress = $trueipaddress1 if (($trueipaddress1 ne "")&&($trueipaddress1 ne "unknown"));
my $ipall = "$ipaddress=$trueipaddress";
my $tempusername1=$tempusername;
$tempusername = "客人($ipaddress)" if ($tempusername eq "客人");
$totleonlineall = 0;
$guests = 0;
$members = 0;
$onlineuserlist = "\_";
$onlineuserlisthidden = "\_";
undef @onlinedata;
undef @onlinedata1;
$currenttime = time;
$membergone = 5 if ($membergone< 5);
$membergone = 60 if ($membergone> 60);
my $userexpire = $currenttime - $membergone * 60;
my $memberprinted = "no";
$screenmode=8 if ($screenmode eq "");
my $filetoopen = "$lbdir" . "data/onlinedata.cgi";
my @fileinfo = stat("$filetoopen");
my $filelength1 = $fileinfo[7];
@fileinfo = stat("$filetoopen.cgi");
my $filelength2 = $fileinfo[7];
if ((($filelength1 <60)&&($filelength2 > 60)&&($currenttime-$fileinfo[9] <= 300))||(($currenttime-$fileinfo[9] <= 300)&&($filelength2-$filelength1>1200)&&($filelength2<3000))||(($currenttime-$fileinfo[9] <= 300)&&($filelength2 > $filelength1*2)&&($filelength2>3000)&&($filelength2<50000))||(($currenttime-$fileinfo[9] <= 300)&&($filelength2*2 > $filelength1*3)&&($filelength2>50000))) {
if (open(FILE5,"$filetoopen.cgi")) {
@onlinedata1 = <FILE5>;
close(FILE5);
$onlinedatanumber=@onlinedata1;
}
}
else {
&winlock($filetoopen) if (($OS_USED eq "Unix")||($OS_USED eq "Nt"));
if (open(FILE5,"$filetoopen")) {
flock (FILE5, 1) if ($OS_USED eq "Unix");
@onlinedata1 = <FILE5>;
close(FILE5);
$onlinedatanumber=@onlinedata1;
}
&winunlock($filetoopen) if (($OS_USED eq "Unix")||($OS_USED eq "Nt"));
}
foreach my $line (@onlinedata1) {
chomp $line;
local ($savedusername, $savedcometime, $savedtime, $savedwhere, $savedipaddress, $saveosinfo, $savebrowseinfo, $savedwhere2, $fromwhere, $savemembercode, $savehidden, $savesex) = split(/\t/, $line);
my ($lookfor, $no) = split(/\(/,$savedusername);
next if (((length($savedusername)>12)&&($lookfor ne "客人"))||($lookfor eq ""));
$fromwhere = "未知" if (length($fromwhere) > 30);
$saveosinfo = "未知" if (length($saveosinfo) > 15);
$savebrowseinfo = "未知" if (length($savebrowseinfo) > 28);
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -