星星博客's Archiver

zx 发表于 2004-10-17 20:56

lb.lib.pl文件

#######################################################
#  LB5000MX 源程序版权所有:CGI编程者之家 (CGIer.com)
#
#  程序编写:山鹰糊 (Shining Hu)、花无缺 (Ifairy Han)
#
#  程序修改:BigJim (94Cool.Net)
#######################################################
$versionnumber = "LB5000MX 2.08";
$hackversion = "SuperLB Gold Final";
$maxweiwang = 5 if ($maxweiwang < 5 || $maxweiwang eq "");
$imagesurl1 ||= $imagesurl;
$ENV{"REMOTE_ADDR"} = $ENV{"HTTP_X_FORWARDED_FOR"} if ($ENV{"REMOTE_ADDR"} eq "127.0.0.1" && $ENV{"HTTP_X_FORWARDED_FOR"} ne "" && $ENV{"HTTP_X_FORWARDED_FOR"} ne "unknow");
&getdir;
sub checkifsearch
{
my $useragent = $ENV{';HTTP_USER_AGENT';};
my @allowsearchs = split(/\s+/, $allowsearch);
foreach my $eachsearch (@allowsearchs)
{
return 0 if ($useragent =~ /$eachsearch/i);
}
return 1;
}
sub title
{
my $newmail = "<p>";
&InMaintenance if ($mainoff == 1 || $mainonoff == 1);
if ($inmembername eq "" || $inmembername eq "客人")
{
$inmembername = "客人";
$loggedinas = qq~<b>客人</b>: <a href=loginout.cgi?forum=$inforum title="从这里开始进入论坛">登录</a> | <a href=register.cgi?forum=$inforum title="注册了才能发表文章哦!">注册</a> | <a href=profile.cgi?action=lostpassword title="好惨啊,忘记密码登录不了" style="cursor: help">忘记密码</a> | <a href=search.cgi?forum=$inforum title="按关键字、作者来搜寻">搜索</a> | <span style="cursor: hand" OnClick="javascript:openScript(';help.cgi';, 500, 400)" title="常见问题的解答">帮助</span>~;
if ($regaccess eq "on" && &checkifsearch && $thisprog ne "loginout.cgi" && $thisprog ne "register.cgi" && $thisprog ne "profile.cgi" && $thisprog ne "viewavatars.cgi")
{
print header(-charset=>gb2312);
print qq~<script language="JavaScript">document.location.href = "loginout.cgi?forum=$inforum";</script>~;
exit;
}
if (($regpuonoff eq "ontop" && $thisprog eq "leoboard.cgi") || ($regpuonoff eq "oneach" && $thisprog ne "loginout.cgi" && $thisprog ne "register.cgi"))
{
$forumgraphic1 = $boardlogo =~ /\.swf$/i ? 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>~ : "<img src=$imagesurl/myimages/$boardlogo border=0>" unless ($forumgraphic1);
$popupmsg = "请先注册以避免此视窗出现" unless($popupmsg);
$popupmsg = &HTML($popupmsg);
$loggedinas .= qq~\n<script language="JavaScript" src=$imagesurl1/images/lbpopup.js></script><div id=lbplocation style="position: absolute; visibility: hidden; height: 1; width: 1; top: 100; left: 50"><table width=520 height=320 bgcolor=$titleborder style="border: 1 outset $miscbackone"><tr><td><table width=490 height=290 bgcolor=$menubackground align=center style="border: 1 inset $miscbacktwo"><tr><td align=center valign=middle><a href=leoboard.cgi>$forumgraphic1</a><br>$popupmsg<br><br><b><a href=register.cgi title="按这里进行注册"><u>注 册</u></a>  <a href=loginout.cgi?forum=$inforum title="从这里开始进入论坛"><u>登 入</u></a></b><p>(此视窗将于 5 秒后自动关闭)</td></tr></table></td></tr></table></div>~;
}
}
else
{
if ($loginip ne "")
{
$loginip =~ s/,/,/sg;
$loginip =~ s/ //sg;
my @userallowips = split(/,/, $loginip);
my $allowlogin = "no";
foreach (@userallowips)
{
s/[^0-9\.]//sg;
if ($trueipaddress =~ /^$_/)
{
$allowlogin = "yes";
last;
}
}
if ($allowlogin ne "yes")
{
$loginip = ""; &#35;防止死循环调用
&error("禁止从此 IP 登录&本用户 ID 不允许从当前 IP 地址访问论坛!");
}
}
if ($thisprog eq "leoboard.cgi" || $thisprog eq "forums.cgi")
{
my $memberfilename = $inmembername;
$memberfilename =~ s/ /\_/g;
$memberfilename =~ tr/A-Z/a-z/;
if (open(MSGIN, "${lbdir}${msgdir}/in/${memberfilename}_msg.cgi"))
{
$readdisktimes++;
sysread(MSGIN, $allmessages, (stat(MSGIN))[7]);
close(MSGIN);
@allmessages = split($/, $allmessages);
}
my @newmessages = grep(/^(.+)\tno\t/, @allmessages);
$unread = @newmessages;
my $intanchumsg = $query->cookie("tanchumsg");
my $pmpercent = @allmessages * 5;
my $popnew = $pmpercent >= 75 && $membercode ne "ad" && $membercode ne "smo" && $membercode ne "cmo" && $membercode ne "mo" ? "<script>alert(';短消息存储量已经达到$pmpercent%,请及时清理!\\n';);</script>" : ';';;
$popnew .= qq~<script>if (confirm("你有 $unread 条新的短消息,是否打开收件箱查看?")) openScript("messanger.cgi?action=inbox",420,320);</script>~ if (($newmsgpop eq "on" || $newmsgpop eq "popup") && $intanchumsg eq "");
my $lightnew = qq~<script language="JavaScript">pmBox.bgColor="Lightblue"; setInterval("Timer()", 500); x = 1; function Timer() {set = 1; if (x == 0 && set == 1) {pmBox.bgColor = "Lightblue"; x = 1; set = 0;} if (x == 1 && set == 1) {pmBox.bgColor = ""; x = 0; set = 0;}}</script>~ if ($newmsgpop eq "on" || $newmsgpop eq "light");
$newmail = qq~<table width=$tablewidth cellPadding=2 cellSpacing=0 align=center><tr><td width=*></td><td align=right id=pmBox width=215><bgSound src=$imagesurl1/images/mail.wav border=0>$lightnew$popnew<span style="cursor: hand" OnClick="javascript:openScript(';messanger.cgi?action=inbox';, 420, 320)"><img src=$imagesurl1/images/newmail.gif border=0><font color=$fonthighlight>你有 <b>$unread</b> 条新的短信息,请注意查收</font></span></td></tr></table>~ if ($unread);
}
eval(';require "cache/skincache.pl";';);
require "addplugin.pl" if ($@ ne ';';);
$loggedinas = qq~$pluginadd\n$inmembername:<a href=loginout.cgi?forum=$inforum>重登录</a>|<span style="cursor: hand" OnClick="javascript:openScript(';messanger.cgi?action=inbox';, 420, 320)" title="悄悄话短讯息中心">消息</span>|<span style="cursor: hand" OnClick="javascript:openScript(';friendlist.cgi';, 420, 320)">好友</span>|<a href=profile.cgi?action=modify title="编辑您的个人资料">资料</a>|<a href=search.cgi?forum=$inforum title="按关键字、作者来搜寻">搜索</a>|<a href=http://www.difeng.net/cgi-bin/announcements.cgi&#35;title1 title="本站公告">公告|</a><a href=soccer.cgi action=logout title="博彩">|<font color=&#35;ff0033$fonthighlight>赌球</font></a>|<a href=Http://www.spbo.com action=logout title="关心我的比赛">比分</a>|<a href=xwin.cgi action=logout title="拳王大比拼">猜拳</a>|<a href=ebank.cgi?action=logout title="看看我的资金!"><font color=&#35;ff0000$fonthighlight>叶行</font></a>|<a href=prison.cgi?action=logout title="扰乱论坛秩序者天堂!">监狱</font></a>|<a href=loginout.cgi?action=logout title="在公众的地方上网记得要按退出哦"><font color=$fonthighlight>退出</font></a> ~;
$loggedinas .= qq~| <a href=admincenter.cgi target=_blank>管理中心</a>~ if ($membercode eq "ad" || $membercode eq "smo");
}
undef $output;
if ($usesuperannounce eq "1" && ($thisprog eq "leoboard.cgi" || $thisprog eq "forums.cgi" || $thisprog eq "topic.cgi" || $thisprog eq "ebank.cgi" || $thisprog eq "soccer.cgi"))
{
require "superannounce.pl";
$sann = qq~<font style="cursor:hand; color:&#35;d56f2b" onClick=displayfadeinbox();><b>★ 超级公告</b></font> ~;
}
if ($thisprog eq "leoboard.cgi")
{
$headmark = "$headmark1$headmark";
$footmark = "$footmark1$footmark";
}
if ($headmark ne "")
{
$headmark = &HTML($headmark);
$headmark =~ s/\n/<BR>/isg;
$headmark =~ s/\$imagesurl/$imagesurl/isg;
$headmark =~ s/\[br\]/\n/isg;
}
if ($footmark ne "")
{
$footmark = &HTML($footmark);
$footmark =~ s/\n/<BR>/isg;
$footmark =~ s/\$imagesurl/$imagesurl/isg;
$footmark =~ s/\[br\]/\n/isg;
}
$menubackpic = "background=$imagesurl/myimages/$menubackpic" if ($menubackpic ne "");
$output .= qq~<table width=$tablewidth align=center cellSpacing=0 cellPadding=1 border=0 bgcolor=$titleborder><tr><td><table width=100% cellSpacing=0 cellPadding=4 border=0><tr><td bgcolor=$menubackground $menubackpic><font color=$menufontcolor>>> 欢迎您,$loggedinas </td><td bgcolor=$menubackground align=right $menubackpic>$sann<a href=$homeurl target=_blank><img src=$imagesurl1/images/gohome.gif width=48 height=16 border=0></a> </td></tr></table></td></tr></table>$newmail<center>$headmark</center>~;
$output .= qq~<base OnMouseOver="window.status=';$statusbar';; return true;">~ if ($statusbar ne "");
if ($forumlastvisit)
{
my $fulldate = &fulldatetime($forumlastvisit + ($timezone + $timedifferencevalue) * 3600);
$lastvisitdata = qq~ 最近访问论坛时间: $fulldate~;
}
else
{
$lastvisitdata = qq~>> $forumname欢迎您的到来 <<~;
}
my $readstr = &uri_escape("阅读标记");
$uservisitdata = qq~<tr><td valign=bottom align=right><font color=$menufontcolor><a href=forums.cgi?forum=$inforum&action=resetposts>标记论坛所有内容为已读</a>  <img src=$imagesurl1/images/help_b.gif border=0 style="cursor: hand" OnClick="javascript:openScript(';help.cgi?helpon=$readstr';, 500, 400)"> <br>$lastvisitdata </td></tr>~;
return;
}
sub mischeader
{
my $misctype = shift;
open(FILE, "${lbdir}forum${inforum}/foruminfo.cgi");
$readdisktimes++;
my $forums = <FILE>;
close(FILE);
($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/, $forums);
$forumgraphic = $forumgraphic ? $forumgraphic : $boardlogo;
$forumgraphic1 = $forumgraphic =~ /\.swf$/i ? qq~<param name=play value=true><param name=loop value=true><param name=quality value=high><embed src=$imagesurl/myimages/$forumgraphic quality=high width=$fgwidth height=$fgheight pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash"></embed>~ : "<img src=$imagesurl/myimages/$forumgraphic border=0>";
&title;
if ($category =~ /childforum-[0-9]+/)
{
$tempforumno = $category;
$tempforumno =~ s/childforum-//;
open(FILE, "${lbdir}forum${tempforumno}/foruminfo.cgi");
$readdisktimes++;
$forums = <FILE>;
close(FILE);
(undef, undef, undef, $tempforumname, undef) = split(/\t/, $forums);
$addlink = qq~<br> <img src=$imagesurl1/images/bar.gif width=15 height=15><img src=$imagesurl1/images/closedfold.gif width=14 height=14> <a href=forums.cgi?forum=$tempforumno>$tempforumname</a>~;
$addspace = " ";
}
$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=$imagesurl1/images/closedfold.gif width=15 height=11> <a href=leoboard.cgi>$boardname</a>$addlink<br>$addspace <img src=$imagesurl1/images/bar.gif width=15 height=15><img src=$imagesurl1/images/closedfold.gif width=15 height=11> <a href=forums.cgi?forum=$inforum>$forumname</a><br>$addspace   <img src=$imagesurl1/images/bar.gif width=15 height=15><img src=$imagesurl1/images/openfold.gif width=15 height=11> $misctype~;
}
else
{
$output .= qq~<font color=$fontcolormisc><img src=$imagesurl1/images/closedfold.gif width=15 height=11> <a href=forums.cgi?forum=$inforum>$forumname</a><br><img src=$imagesurl1/images/bar.gif width=15 height=15><img src=$imagesurl1/images/openfold.gif width=15 height=11> $misctype~;
}
$output .= qq~</td></tr></table><p>~;
return;
}
sub whosonline
{
my $instruct = shift;
my ($tempusername, $where, $method, $where2) = split(/\t/, $instruct);
my $ipaddress = $ENV{';REMOTE_ADDR';};
$trueipaddress = $ENV{"HTTP_CLIENT_IP"};
$trueipaddress = $ENV{"HTTP_X_FORWARDED_FOR"} if ($trueipaddress eq "" || $trueipaddress eq "unknown");
$trueipaddress = $ipaddress if ($trueipaddress eq "" || $trueipaddress eq "unknown");
my $ipall = "$ipaddress=$trueipaddress";
my $tempusername1 = $tempusername;
$tempusername = "客人($ipaddress)" if ($tempusername eq "客人");
my $totleonlineall = 0;
my $guests = 0;
my $members = 0;
$onlineuserlist = ';_';;
$onlineuserlisthidden = ';_';;
undef @onlinedata;
undef @onlinedata1;
undef @onlineadmins;
$currenttime = time;
$membergone = 5 if ($membergone< 5);
&#35;$membergone = 60 if ($membergone> 60);
my $userexpire = $currenttime - ($membergone * 60);
my $memberprinted = ';no';;
my $firstcome = ';yes';;
$screenmode = 8 if ($screenmode eq "");
my $filetoopen = "${lbdir}data/onlinedata.cgi";
my @fileinfo = stat($filetoopen);
$readdisktimes++;
my $filelength1 = $fileinfo[7];
@fileinfo = stat("$filetoopen.cgi");
$readdisktimes++;
my $filelength2 = $fileinfo[7];
if (($filelength1 < 60 && $filelength2 > 60) || ($filelength2 - $filelength1 > 1200 && $filelength2 < 3000) || ($filelength2 > $filelength1 * 2 && $filelength2 >3000 && $filelength2 < 50000) || ($filelength2 > $filelength1 * 2.5 && $filelength2 > 50000 && $filelength2 < 500000) || ($filelength2 > $filelength1 * 3.5 && $filelength2 > 500000))
{
if (open(FILE5, "$filetoopen.cgi"))
{
$readdisktimes++;
sysread(FILE5, my $onlinedata1, (stat(FILE5))[7]);
close(FILE5);
@onlinedata1 = split($/, $onlinedata1);
$onlinedatanumber = @onlinedata1;
}
}
else
{
&winlock($filetoopen) if ($OS_USED eq "Nt" || $OS_USED eq "Unix");
if (open(FILE5, $filetoopen))
{
$readdisktimes++;
flock (FILE5, 1) if ($OS_USED eq "Unix");
sysread(FILE5, my $onlinedata1, (stat(FILE5))[7]);
close(FILE5);
@onlinedata1 = split($/, $onlinedata1);
$onlinedatanumber = @onlinedata1;
}
&winunlock($filetoopen) if ($OS_USED eq "Nt" || $OS_USED eq "Unix");
}
my @onlinefr = ();
my $onlineprompt = $query->cookie(';onlineprompt';) if (defined($query));
foreach my $line (@onlinedata1)
{
chomp($line);
local ($savedusername, $savedcometime, $savedtime, $savedwhere, $savedipaddress, $saveosinfo, $savebrowseinfo, $savedwhere2, $fromwhere, $savemembercode, $savehidden, $savesex) = split(/\t/, $line);
push(@onlineadmins, $savedusername) if (($savemembercode eq "ad" || $savemembercode eq "smo") && $thisprog eq "prison.cgi");
my ($lookfor, $no) = split(/\(/, $savedusername);
next if ((length($savedusername) > 20 && $lookfor ne "客人") || $lookfor eq "");
$fromwhere = "未知" if (length($fromwhere) > 60);
$saveosinfo = "未知" if (length($saveosinfo) > 40);
$savebrowseinfo = "未知" if (length($savebrowseinfo) > 40);
$lookfor =~ s/[\a\f\n\e\0\r\t\`\~\!\@\&#35;\$\%\^\&\*\(\)\+\=\\\{\}\;\';\:\"\,\.\/\<\>\?\[\]]//isg;
$savedusername =~ s/\_/ /g;
$tempusername =~ s/\_/ /g;
if ($userexpire <= $savedtime)
{
if ($thisprog eq "topic.cgi" || $thisprog eq "team.cgi" || $thisprog eq "friendlist.cgi" || $thisprog eq "blocklist.cgi")
{
if ($savedusername !~ /^客人/)
{
if ($savehidden ne 1)
{
$onlineuserlist .= "$savedusername\_";
}
else
{
$onlineuserlisthidden .= "$savedusername\_";
}
}
}
if (lc($savedusername) eq lc($tempusername) || ($savedusername eq "客人($ipaddress)" && $ipall eq $savedipaddress && ($tempusername =~ /^客人/ || ($where eq "论坛登录" && $where2 eq "登录论坛" && $action eq "login"))))
{
if ($currenttime - $savedtime <= $banfreshtime - 1 && $savedwhere eq $where && $savedwhere2 eq $where2 && $membercode ne "ad" && $thisprog ne "messanger.cgi")
{
print header(-charset=>gb2312);
print "<br>服务器忙,请 $banfreshtime 秒后按刷新键继续。<br><br>出错原因:你刷新页面过快,或者你打开了过多窗口来浏览本网站。";
exit;
}
$savedcometime = $currenttime if (lc($savedusername) ne lc($tempusername));
if ($memberprinted eq "no")
{
$savehidden = $hidden if ($hidden ne "");
$tempdata = "$tempusername\t$savedcometime\t$currenttime\t$where\t$ipall\t$saveosinfo\t$savebrowseinfo\t$where2\t$fromwhere\t$membercode\t$savehidden\t$sex" ;
$osinfo = $saveosinfo;
$browseinfo = $savebrowseinfo;
$tempdata =~ s/[\a\f\n\e\0\r]//isg;
$fromwhere1 = $fromwhere;
push(@onlinedata, $tempdata);
$memberprinted = ';yes';;
$firstcome = ';no'; if (lc($savedusername) eq lc($tempusername));
$onlinetimeadd = $currenttime - $savedcometime if ($thisprog eq "post.cgi" || $thisprog eq "poll.cgi" || $thisprog eq "messanger.cgi");
}
}
else
{
$line =~ s/[\a\f\n\e\0\r]//isg;
push(@onlinedata, $line);
if ($tempusername !~ /^客人/ && $friendonlinepop ne ';no';)
{
if ($onlineprompt =~ /,$savedusername,/i)
{
push(@onlinefr, $savedusername);
$onlineprompt =~ s/,$savedusername,/,/isg;
}
}
}
}
else
{
if ($savedusername !~ /^客人/)
{
$savedusername =~ s/[\a\f\n\e\0\r\t\`\~\!\@\&#35;\$\%\^\&\*\(\)\+\=\\\{\}\;\';\:\"\,\.\/\<\>\?]//isg;
$savedusername =~ s/ /_/g;
$savedusername =~ tr/A-Z/a-z/;
&uplogintime($savedusername);
my $firstletter = substr($savedusername, 0, 2);
$firstletter =~ s/\.//sg;
$firstletter = ';0'; if ($firstletter eq ';';);
unlink("${lbdir}cache/id/$firstletter/$savedusername.cgi");
}
}
}
if ($tempusername !~ /^客人/ && $friendonlinepop ne ';no';)
{
if ($firstcome ne ';yes';)
{
if (@onlinefr)
{
my $onlinefriend = join(';  ';, @onlinefr);
$onlinepopup = "你下面这些好友刚刚上线了!<p>$onlinefriend";
require ';onlinepop.pl';;
}
$onlineprompt = uri_escape($onlineprompt);
$output .= qq~<script>var exp = new Date(); exp.setTime(exp.getTime() + ($membergone*60*1000)); documents&#46;cookie="onlineprompt=$onlineprompt; expires=" + exp.toGMTString();</script>~;
}
else
{
my $temptempuser = $tempusername;
$temptempuser =~ s/ /\_/g;
$temptempuser =~ tr/A-Z/a-z/;
$temptempuser =~ s/[\a\f\n\e\0\r\t\`\~\!\@\&#35;\$\%\^\&\*\(\)\+\=\\\|\{\}\;\';\:\"\,\.\/\<\>\?]//isg;
if (open(FRD, "${lbdir}memfriend/$temptempuser.cgi"))
{
$readdisktimes++;
sysread(FRD, my $friendlist, (stat(FRD))[7]);
close(FRD);
my @friendlist = split($/, $friendlist);
my @noonlinefr = ();
my @onlinefr = ();
foreach my $friend (@friendlist)
{
$friend =~ s/^*#!&*//;
$friend =~ s/[\r\n]*$//;
next if ($friend eq ';';);
if (grep(/^$friend\t/i, @onlinedata) > 0)
{
push(@onlinefr, $friend);
}
else
{
push(@noonlinefr, $friend);
}
}
if (@onlinefr)
{
my $onlinefriend = join(';  ';, @onlinefr);
$onlinepopup = "你下面这些好友正在线上!<p>$onlinefriend";
require ';onlinepop.pl';;
}
if (@noonlinefr)
{
my $onlineprompt = join(';,';, @noonlinefr);
$onlineprompt = uri_escape($onlineprompt);
$output .= qq~<script>var exp = new Date(); exp.setTime(exp.getTime() + ($membergone*60*1000)); documents&#46;cookie="onlineprompt=,$onlineprompt,; expires=" + exp.toGMTString();</script>~;
}
}
}
}
if ($memberprinted eq "no")
{
if ($onlinedatanumber >= $arrowonlinemax && $arrowonlinemax > 0 && $membercode ne "ad" && $membercode ne "cmo" && $membercode ne "smo" && $membercode ne "mo")
{
print header(-charset=>gb2312);
print "<br>服务器忙,已经超出论坛允许的最大在线人数。<br><br>目前论坛在线 $onlinedatanumber 人,最大允许同时在线 $arrowonlinemax 人。";
exit;
}
eval("use testinfo qw(ipwhere osinfo browseinfo);");
$osinfo = &osinfo;
$browseinfo = &browseinfo;
my $fromwhere = &ipwhere($trueipaddress);
my $tempdata = "$tempusername\t$currenttime\t$currenttime\t$where\t$ipall\t$osinfo\t$browseinfo\t$where2\t$fromwhere\t$membercode\t$hidden\t$sex";
$fromwhere1 = $fromwhere;
&uplogintime($tempusername, "T") if ($tempusername !~ /^客人/);
$tempdata =~ s/[\a\f\n\e\0\r]//isg;
push(@onlinedata, $tempdata);
}
my $filetoopen = "${lbdir}data/onlinedata.cgi";
$filetoopens = &lockfilename($filetoopen);
unless (-e "${filetoopens}.lck")
{
&winlock($filetoopen) if ($OS_USED eq "Nt" || $OS_USED eq "Unix");
my $onlinedata = join("\n", @onlinedata);
if (open(FILE4, ">$filetoopen"))
{
$writedisktimes++;
flock(FILE4, 2) if ($OS_USED eq "Unix");
print FILE4 $onlinedata;
close(FILE4);
}
&winunlock($filetoopen) if ($OS_USED eq "Nt" || $OS_USED eq "Unix");
if ($currenttime - $fileinfo[9] >= 90)
{
if (open(FILE4, ">$filetoopen.cgi"))
{
$writedisktimes++;
print FILE4 $onlinedata;
close(FILE4);
}
}
}
if ($thisprog eq "leoboard.cgi" || $thisprog eq "forums.cgi")
{
my $filetomake = "${lbdir}data/counter.cgi";
my @fileinfo = stat($filetomake);
my $filelength1 = $fileinfo[7];
@fileinfo = stat("$filetomake.cgi");
my $filelength2 = $fileinfo[7];
if ($filelength2 > $filelength1)
{
open(FILE, "$filetomake.cgi");
flock(FILE, 1) if ($OS_USED eq "Unix");
$count = <FILE>;
close(FILE);
}
else
{
open(FILE, $filetomake);
$count = <FILE>;
close(FILE);
}
$readdisktimes++;
$onlinemax = @onlinedata;
chomp($count);
($count1, $count2, $onlinemax1, $onlinemaxtime1) = split(/\t/, $count);
$onlinemaxtime1 ||= $currenttime;
$count2++;
$count1++ if ($memberprinted eq "no");
if ($onlinemax < $onlinemax1)
{
$onlinemax = $onlinemax1;
$onlinemaxtime = $onlinemaxtime1;
}
else
{
$onlinemaxtime = $currenttime;
}
if ($count1 > 0 && $count2 > 0 && $onlinemax > 0 && $onlinemax < 10000)
{
if (open(FILE, ">$filetomake"))
{
$writedisktimes++;
print FILE "$count1\t$count2\t$onlinemax\t$onlinemaxtime";
close(FILE);
}
if ($currenttime - $fileinfo[9] >= 5000)
{
if ($count1 > 100 && $onlinemax >= 5)
{
open(FILE, ">$filetomake.cgi");
flock(FILE, 2) if ($OS_USED eq "Unix");
$writedisktimes++;
print FILE "$count1\t$count2\t$onlinemax\t$onlinemaxtime";
close(FILE);
}
}
}
}
undef @onlinedata1;
if ($method ne "none")
{
$memberoutput = qq~<script language="JavaScript">
function OLO(img, name, name1, place, action, time, time1, os, browser, ip, where, xa, xb) {document.write("<td width=12 align=center><img src=$imagesurl/images/" + img + " border=0 width=12 align=absmiddle alt=';发送一个短消息给 " + name + "'; OnClick=\\"javascript:openScript(';messanger.cgi?action=new&touser=" + name1 + "';, 420, 320)\\" style=';cursor: hand';></td><td width=108><span OnClick=\\"javascript:O9(';" + name1 + "';)\\" nowarp title=\\"目前位置:" + place + "\\n目前动作:" + action + "\\n来访时间:" + time + "\\n活动时间:" + time1 + "\\n操作系统:" + os + "\\n浏 览 器:" + browser + "\\nIP地址:" + ip + "\\n来源鉴定:" + where + "\\" style=';cursor: hand';>" + xa + name + xb + "</span></td>");}
function OHO(time, time1, ip, where, xa, xb) {document.write("<td width=12 align=center><img src=$imagesurl1/images/messages2.gif width=12 align=absmiddle alt=';请勿打扰!';></td><td width=108><a href=&#35; nowarp title=\\"来访时间:" + time + "\\n活动时间:" + time1 + "\\nIP地址:" + ip + "\\n来源鉴定:" + where + "\\">" + xa + "隐身会员" + xb + "</a></td>");}~;
$memberoutput1 = qq~
<script language="JavaScript">
function OGO(place, action, time, time1, os, browser, ip, where, xa, xb) {document.write("<td width=12 align=center><img src=$imagesurl1/images/messages2.gif border=0 width=12 align=absmiddle alt=';快注册呀!';></td><td width=108><a href=&#35; nowarp title=\\"目前位置:" + place + "\\n目前动作:" + action + "\\n来访时间:" + time + "\\n活动时间:" + time1 + "\\n操作系统:" + os + "\\n浏 览 器:" + browser + "\\nIP地址:" + ip + "\\n来源鉴定:" + where + "\\">" + xa + "客人" + xb + "</a></td>");}~;
foreach my $line (@onlinedata)
{
chomp($line);
$line =~ s/*#!&*//;
my ($savedusername, $savedcometime, $savedtime, $savedwhere, $postipaddresstemp, $saveosinfo, $savebrowseinfo, $savedwhere2, $fromwhere, $memcod, $hiddened, $savesex) = split(/\t/, $line);
if ($memcod eq "ad") {$mspic = "messages0.gif";}
elsif ($memcod eq "smo") {$mspic = "messages6.gif";}
elsif ($memcod eq "cmo") {$mspic = "messages3.gif";}
elsif ($memcod eq "mo") {$mspic = "messages4.gif";}
elsif ($memcod =~ /^rz/) {$mspic = $memcod eq "rz1" && $defrz1 ne "" && $defrzonline1 ne "" ? $defrzonline1 : $memcod eq "rz2" && $defrz2 ne "" && $defrzonline2 ne "" ? $defrzonline2 : $memcod eq "rz3" && $defrz3 ne "" && $defrzonline3 ne "" ? $defrzonline3 : $memcod eq "rz4" && $defrz4 ne "" && $defrzonline4 ne "" ? $defrzonline4 : $memcod eq "rz5" && $defrz5 ne "" && $defrzonline5 ne "" ? $defrzonline5 : "messages5.gif";}
else {$mspic = "messages1.gif";}
my ($lookfor, $no) = split(/\(/, $savedusername);
next if ($lookfor =~ m/[\(\)\*]/ || $lookfor eq "");
($savedipaddress, $truepostipaddress) = split(/\=/, $postipaddresstemp);
$totleonlineall++;
$fromwhere = "已设置保密" unless ($pvtip eq "on" || $membercode eq "ad" || ($membercode eq ';smo'; && $smocanseeip eq "no"));
if ($membercode eq "smo")
{
$savedipaddress = "已设置保密" unless ($pvtip eq "on" || $smocanseeip eq "no");
}
elsif ($membercode eq "cmo" || $membercode eq "mo")
{
if ($pvtip eq "on")
{
my ($ip1, $ip2, $ip3, $ip4) = split(/\./, $savedipaddress);
$savedipaddress = "$ip1.$ip2.$ip3.*";
}
else
{
$savedipaddress = "已设置保密";
}
}
elsif ($membercode ne "ad")
{
if ($pvtip eq "on" && $inmembername ne "客人")
{
my ($ip1, $ip2, $ip3, $ip4) = split(/\./, $savedipaddress);
$savedipaddress = "$ip1.$ip2.*.*";
}
else
{
$savedipaddress = "已设置保密";
}
}
my $savedcometime = &dateformatshort($savedcometime + ($timezone + $timedifferencevalue) * 3600);
my $savedtime = &dateformatshort($savedtime + ($timezone + $timedifferencevalue) * 3600);
$savedwhere2 =~ s/\<a \s*(.*?)\s*\>\s*(.*)/“$2”/isg;
$savedwhere2 =~ s/\<\/a\>//isg;
$savedwhere2 =~ s/\<b\>//isg;
$savedwhere2 =~ s/\<\/b\>//isg;
$savedwhere2 =~ s/\"/\\\"/;
my $wherebaomi = $method . "(密)";
if ($savedwhere eq $method || $savedwhere eq $wherebaomi || $method eq "both")
{
if ((($hiddened eq 1 && $membercode ne "ad") || ($savedusername =~ /^客人/)) && (lc($savedusername) ne lc($inmembername)))
{
$XA = $XB = "";
if (lc($savedusername) eq lc($inmembername) || $savedusername eq "客人($trueipaddress)")
{
$XA = "<font color=$onlineselfcolor>";
$XB = "</font>";
}
if ($hiddened eq 1)
{
$members++;
$memberoutput .= qq~\nOHO("$savedcometime", "$savedtime", "$savedipaddress", "$fromwhere", "$XA", "$XB")~;
$memberoutput .= "\n</script></tr><tr>\n<script>" if ($members == int($members / $screenmode) * $screenmode);
}
else
{
$guests++;
$memberoutput1 .= qq~\nOGO("$savedwhere", "$savedwhere2", "$savedcometime", "$savedtime", "$saveosinfo", "$savebrowseinfo", "$savedipaddress", "$fromwhere", "$XA", "$XB")~;
$memberoutput1 .= "\n</script></tr><tr>\n<script>" if ($guests == int($guests / $screenmode) * $screenmode);
}
}
else
{
$members++;
my $cleanmember = $savedusername;
$cleanmember =~ s/ /\_/g;
$cleanmember = &uri_escape($cleanmember);
$XA = $XB = "";
$XA = "<font color=$mcolor>" if ($savesex eq "m");
$XA = "<font color=$fcolor>" if ($savesex eq "f");
if (lc($savedusername) eq lc($inmembername))
{
$XA = "<font color=$onlineselfcolor>";
$XB = "</font>";
}
$hiddeninfo = $hiddened eq 1 ? "\\n-=> 目前处于隐身状态 <=-" : "";
$memberoutput .= qq~\nOLO("$mspic", "$savedusername", "$cleanmember", "$savedwhere", "$savedwhere2", "$savedcometime", "$savedtime", "$saveosinfo", "$savebrowseinfo", "$savedipaddress", "$fromwhere$hiddeninfo", "$XA", "$XB")~;
$memberoutput .= "\n</script></tr><tr>\n<script>" if ($members == int($members / $screenmode) * $screenmode);
}
}
}
$memberoutput .= "\n</script>\n";
$memberoutput1 .= "\n</script>\n";
$memberoutput1 = "" if ($dispguest eq 3 || ($dispguest ne 2 && $members > 50 && $guests > 20));
$memberoutput = "$memberoutput</tr><tr>" if ($memberoutput ne "" && $memberoutput1 ne "");
$memberoutput .= $memberoutput1;
undef $memberoutput1;
my $totleonline = $members + $guests;
$membertongji = $method eq "both" ? "目前总共有 <a href=whosonline.cgi><b>$totleonlineall</b></a> 人在线。其中注册用户 <b>$members</b> 人,访客 <b>$guests</b> 人。" : " 目前论坛总在线 <b>$totleonlineall</b> 人,本分论坛共有 <b>$totleonline</b> 人在线。其中注册用户 <b>$members</b> 人,访客 <b>$guests</b> 人。";
}
undef @onlinedata unless ($thisprog eq "whosonline.cgi");
return;
}
sub numerically
{
return $a <=> $b;
}
sub alphabetically
{
return lc($a) cmp lc($b);
}
1;
这个是我修改的  基于final版本,论坛的还没测试,我感觉论坛编的怎么好像麻烦啊

cnangel 发表于 2004-10-17 21:02

lb.lib.pl文件

你修改了什么?

zx 发表于 2004-10-17 21:04

lb.lib.pl文件

基本还没有 我放在这 怕弄丢了   

zx 发表于 2004-10-17 21:04

lb.lib.pl文件

感觉论坛的相对烦琐  

cnangel 发表于 2004-10-17 21:11

lb.lib.pl文件

论坛不烦琐,一个验证码函数和一个控制面版菜单输出,其余是RoyRoy写函数,做其他用,比如:getfile.cgi文件需要用到的等等。

页: [1]

Powered by Discuz! Archiver 7.0.0  © 2001-2009 Comsenz Inc.