📄 leoboard.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/ 本论坛直通车
#
# *************************
# LB论坛推荐虚拟主机服务商:
# 雷傲科技: http://www.leoboard.com.cn
# 全面支持LB所有功能,拥有2年提供LB论坛空间的以及500多个LB用户的经验,可以做的更好
# **************************
#
#############################################################
BEGIN {
$start_time = (times)[0] + (times)[1];
$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";
eval
{
($0 =~ m,(.*)/[^/]+,) and unshift (@INC, "$1");
($0 =~ m,(.*)\\[^\\]+,) and unshift (@INC, "$1");
require "data/boardstats.cgi";
};
if ($@) {
open(FILE, "${lbdir}data/allforums.cgi");
flock(FILE, 1) if ($OS_USED eq "Unix");
@forums = <FILE>;
close(FILE);
$totle1 = 0; $totle2 = 0;
foreach $forum (@forums) {
chomp $forum;
next if ($forum eq "");
(my $tempno,my $no, $no, $no, $no, $no ,$no ,$no ,$no, $no ,$no ,$no, $threads, $posts, $no, $no, $no,$no,$no,$no) = split(/\t/,$forum);
next if ($tempno !~ /^[0-9]+$/);
$totle1 += $threads; $totle2 += $posts;
}
opendir (DIRS, "$lbdir");
my @memdir = readdir(DIRS);
closedir (DIRS);
@memdir = grep(/^members/i, @memdir);
my $memdir = $memdir[0];
opendir (DIR, "${lbdir}$memdir/old");
my @filedata = readdir(DIR);
closedir (DIR);
my @countvar = grep(/\.cgi$/i,@filedata);
$newtotalmembers = @countvar;
open(FILE, ">${lbdir}data/boardstats.cgi");
flock(FILE, 2) if ($OS_USED eq "Unix");
print FILE "\$lastregisteredmember = \'nodisplay\'\;\n";
print FILE "\$totalmembers = \'$newtotalmembers\'\;\n";
print FILE "\$totalthreads = \'$totle1\'\;\n";
print FILE "\$totalposts = \'$totle2\'\;\n";
print FILE "\n1\;";
close (FILE);
}
require "data/boardstats.cgi";
require "lb.lib.pl";
require "visitforum.lib.pl";
$|++; # Unbuffer the output
$thisprog = "leoboard.cgi";
require "imagead.cgi" if (($useimagead eq "1")||($useimagead1 eq "1"));
$query = new LBCGI;
if ($COOKIE_USED eq 1) {$cookiepath ="";}
else {
$boardurltemp =$boardurl;
$boardurltemp =~ s/http\:\/\/(\S+?)\/(.*)/\/$2/;
$cookiepath = $boardurltemp;
$cookiepath =~ s/\/$//;
# $cookiepath =~ tr/A-Z/a-z/;
}
&ipbanned; #封杀一些 ip
$action = $query->param('action');
$catlog = $query->param('catlog');
$catlog2= $catlog;
$te = "catlog".$catlog;
if ($catlog ne "") {
$catlog1=$query->cookie("$te");
if ($catlog1 ne "no") { $catlog1cookie = cookie(-name => "$te", -value => "no", -expires => "+30d", -path => "$cookiepath/"); }
else { $catlog1cookie = cookie(-name => "$te", -value => "yes", -expires => "+30d", -path => "$cookiepath/"); }
}
$inmembername = $query->cookie("amembernamecookie");
$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 ($action eq "delcookieall") {
$namecookie = cookie(-name => "amembernamecookie", -value => "", -path => "$cookiepath/");
$passcookie = cookie(-name => "apasswordcookie" , -value => "", -path => "$cookiepath/");
$onlineviewcookie = cookie(-name => "onlineview" , -value => "", -path => "$cookiepath/");
$advpostcookie = cookie(-name => "advpost" , -value => "", -path => "$cookiepath/");
$threadcookie = cookie(-name => "threadages" , -value => "", -path => "$cookiepath/");
$viewcookie = cookie(-name => "viewMode" , -value => "", -path => "$cookiepath/");
$nodisp = cookie(-name => "nodisp" , -value => "", -path => "$cookiepath/");
$freshtimecookie = cookie(-name => "freshtime" , -value => "", -path => "$cookiepath/");
$tanchumsgcookie = cookie(-name => "tanchumsg" , -value => "", -path => "$cookiepath/");
$cookie = cookie(-name => "lastvisit" , -value => "", -path => "$cookiepath/");
$tempcookie = cookie(-name => "templastvisit" , -value => "", -path => "$cookiepath/");
$catlogcookie = cookie(-name => "catlog" , -value => "", -path => "$cookiepath/");
$unioncookie = cookie(-name => "union" , -value => "", -path => "$cookiepath/");
$banfreshcookie = cookie(-name => "banfresh" , -value => "", -path => "$cookiepath/");
$treeviewcookie = cookie(-name => "treeview" , -value => "", -path => "$cookiepath/");
$tecookie = cookie(-name => "catlog" , -value => "", -path => "$cookiepath/");
print header(-cookie=>[$tecookie, $cookie,$tempcookie, $catlogcookie,$unioncookie,$banfreshcookie, $treeviewcookie, $onlineviewcookie,$advpostcookie,$threadcookie,$viewcookie, $nodisp, $freshtimecookie, $tanchumsgcookie, $namecookie,$passcookie], -charset=>gb2312);
print qq ~<script>location.href="$thisprog";</script>~;
exit;
}
if ($inmembername eq "") { $inmembername = "客人"; }
else {
# &getmember("$inmembername");
&getmembernolock("$inmembername");
&error("普通错误&密码与用户名不相符,请重新登录!") if ($inpassword ne $password);
&error("普通错误&此用户根本不存在!") if ($userregistered eq "no");
&getlastvisit;
}
$union = $query->cookie("union");
$union = 1 if ($union eq "");
$screenmode = $query->cookie("screenmode");
$screenmode = 8 if ($screenmode eq "");
$onlineview = 1 if ($onlineview eq "");
$catlog = $query->cookie("catlog") if ($catlog eq "");
$cpudisp = 1 if (($membercode eq "ad")||($membercode eq "smo")||($membercode eq "cmo")||($membercode eq "mo"));
$onlineview1 = $query->cookie("onlineview");
$onlineview = $onlineview1 if ($onlineview1 ne "");
$onlineview = 1 if ($onlineview eq "");
$timeadd = $timedifferencevalue*3600 + $timezone*3600;
$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"));
$currenttime = time;
$outputbutton= "";
$a = 0;
foreach $forum (@forums) {
$a = sprintf("%09d",$a);
chomp $forum;
next if ($forum eq "");
($forumid, $category, $categoryplace, $forumname, $forumdescription, $forummoderator ,$htmlstate ,$idmbcodestate ,$privateforum, $startnewthreads ,$lastposter ,$lastposttime, $threads, $posts, $forumgraphic,$tmp,$tmp,$forumpass,$hiddenforum,$indexforum,$teamlogo,$teamurl, $fgwidth, $fgheight, $miscadd3, $miscadd4, $miscad5) = split(/\t/,$forum);
next if ($forumid !~ /^[0-9]+$/);
if($category =~/^childforum-[0-9]+/){
$topforumno=$category;
$topforumno=~s/^childforum-//;
$threadadds[$topforumno]+=$threads;
$postadds[$topforumno]+=$posts;
($olastposttime,undef)=split(/\%\%\%/,$lastposttime[$topforumno]);
($clastposttime,undef)=split(/\%\%\%/,$lastposttime);
if(($clastposttime > $olastposttime || ($lastposttime[$topforumno] eq "" && $lastposter[$topforumno] eq "")) && $privateforum ne "yes" && (($hiddenforum eq "no")||($membercode eq "ad")||($membercode eq "smo"))) {
$lastposttime[$topforumno]=$lastposttime."%%%$forumid";
$lastposter[$topforumno]=$lastposter;
}
if (($hiddenforum eq "no")||($membercode eq "ad")||($membercode eq "smo")||($membercode eq "cmo")) {
$outputbutton .= qq~<option value="$forumid">| |- $forumname</option>~;
}
$lvisit .= "$forumid-$currenttime--";
}else{
$lastposttime[$forumid]=$lastposttime;
$lastposter[$forumid]=$lastposter;
$categoryplace = sprintf("%09d",$categoryplace);
$rearrange = ("$categoryplace\t$a\t$category\t$forumname\t$forumdescription\t$forummoderator\t$htmlstate\t$idmbcodestate\t$privateforum\t$startnewthreads\t$lastposter\t$lastposttime\t$threads\t$posts\t$forumgraphic\t$ratings\t$misc\t$forumpass\t$hiddenforum\t$indexforum\t$forumid\t$teamlogo\t$teamurl\t$fgwidth\t$fgheight\t$miscadd3\t$miscadd4\t$miscad5\t");
if (($hiddenforum eq "no")||($membercode eq "ad")||($membercode eq "smo")||($membercode eq "cmo")) {
push (@rearrangedforums, $rearrange);
$outputbutton .= qq~<option value="$forumid">|- $forumname</option>~;
$lvisit .= "$forumid-$currenttime--";
}
$a++;
}
}
if ($action eq "onlineview") { if ($onlineview == 1) { $onlineview=0; } else { $onlineview=1; } }
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -