📄 lb.lib.pl
字号:
}
}
if ($checkhidden==0) {
$members++;
my $spaces = "";
my $cleanmember = $savedusername;
$cleanmember =~ s/ /\_/g;
$cleanmember =~ tr/A-Z/a-z/;
my $spacetemp= 12 - length($cleanmember);
my $spacetemp1 = int($spacetemp/2);
$spaces .= " " if ($spacetemp ne $spacetemp1*2);
for (my $i=1;$i<=$spacetemp1;$i++) { $spaces .= " "; }
$lengthmark =$lengthmark+4+length($cleanmember);
$memberoutput .= qq~<a href="javascript:openScript('messanger.cgi?action=new&touser=$cleanmember',420,320)"><img src="$imagesurl/images/messages$mspic.gif" border=0 width=12 height=11 alt="给$savedusername发送一个短消息"></a><a href="$profileprog?action=show&member=$cleanmember" target=_blank nowarp TITLE=\"目前位置:$savedwhere\n目前动作:$savedwhere2\n来访时间:$savedcometime\n活动时间:$savedtime\n操作系统:$saveosinfo\n浏 览 器:$savebrowseinfo\nIP地址:$savedipaddress\n来源鉴定:$fromwhere\">$savedusername</a>$spaces ~;
if ($members == int($members/$screenmode)*$screenmode) {
$memberoutput .= qq~<br> ~;
}
}
}
$memberoutput1 = "" if (($members > 50)&&($guests > 20));
$memberoutput1 = "" if ($memberoutput1 eq " ");
$memberoutput = "" if ($memberoutput eq " ");
$memberoutput = "$memberoutput<BR>" if (($memberoutput ne "")&&($memberoutput1 ne ""));
$memberoutput = "$memberoutput$memberoutput1";
}
}
sub lbhz{
my($str,$maxlen) = @_;
if (length($str) <= $maxlen){ return $str; }
if (substr($str,0,$maxlen-4) =~ /^([\000-\177]|[\200-\377][\200-\377])*([\000-\177]|[\200-\377][\200-\377])$/ ){
return substr($str,0,$maxlen-4)." ...";
}else{
return substr($str,0,$maxlen-5)." ...";
}
}
sub cleaninput {
my $text = shift;
$text =~ s/\ / /g;
$text =~ s/\&/\&/g;
$text =~ s/<script>/\<script\>/g;
$text =~ s/"/\"/g;
$text =~ s/ / \ /g;
$text =~ s/</\</g;
$text =~ s/>/\>/g;
$text =~ s/\t//g;
$text =~ s/\r//g;
$text =~ s/ / /g;
$text =~ s/\n\n/<p>/g;
$text =~ s/\n/<br>/g;
return $text;
}
sub unclean {
my $text = shift;
$text =~ s/\&/\&/g;
$text =~ s/\"/"/g;
$text =~ s/ \ / /g;
return $text;
}
sub unHTML {
my $text = shift;
$text =~ s/<!--(.|\n)*-->//g;
$text =~ s/\&/\&/g;
$text =~ s/<script>/\<script\>/g;
$text =~ s/"/\"/g;
$text =~ s/ / \ /g;
$text =~ s/</\</g;
$text =~ s/>/\>/g;
return $text;
}
sub HTML {
my $text = shift;
$text =~ s/\&/\&/g;
$text =~ s/\"/"/g;
$text =~ s/ \ / /g;
$text =~ s/\</</g;
$text =~ s/\>/>/g;
return $text;
}
sub cleanarea {
my $text = shift;
$text =~ s/<!--(.|\n)*-->//g;
$text =~ s/\&/\&/g;
$text =~ s/<script>/\<script\>/g;
$text =~ s/"/\"/g;
$text =~ s/ / \ /g;
$text =~ s/</\</g;
$text =~ s/>/\>/g;
$text =~ s/\t//g;
$text =~ s/\r//g;
$text =~ s/ / /g;
$text =~ s/\n\n/<p>/g;
$text =~ s/\n/<br>/g;
return $text;
}
sub stripMETA {
my $file = shift;
$file =~ s/\&//g;
$file =~ s/\;//g;
$file =~ s/\`//g;
$file =~ s/\'//g;
$file =~ s/"//g;
$file =~ s/\|//g;
$file =~ s/\*//g;
$file =~ s/\?//g;
$file =~ s/<//g;
$file =~ s/>//g;
$file =~ s/\^//g;
$file =~ s/\(//g;
$file =~ s/\)//g;
$file =~ s/\[//g;
$file =~ s/\]//g;
$file =~ s/\{//g;
$file =~ s/\}//g;
$file =~ s/\$//g;
$file =~ s/\n//g;
$file =~ s/\r//g;
return $file;
}
sub dateformat {
my $time = shift;
(my $sec,my $min,my $hour,my $mday,my $mon,my $year,my $wday,my $yday,my $isdst) = localtime($time);
my @months = ('01','02','03','04','05','06','07','08','09','10','11','12');
$mon = $months[$mon];
my $ampm = "am";
if ($hour > 11) { $ampm = "pm"; }
if ($hour > 12) { $hour = $hour - 12; }
if ($hour < 10) { $hour = "0$hour"; }
if ($min < 10) { $min = "0$min"; }
if ($sec < 10) { $sec = "0$sec"; }
if ($mday < 10) { $mday = "0$mday"; }
$year = $year + 1900;
return "$year/$mon/$mday $hour:$min$ampm";
}
sub longdate {
my $time = shift;
(my $sec,my $min,my $hour,my $mday,my $mon,my $year,my $wday,my $yday,my $isdst) = localtime($time);
my @months = ('01','02','03','04','05','06','07','08','09','10','11','12');
$year = $year + 1900;
if ($mday < 10) { $mday = "0$mday"; }
return "$year年$months[$mon]月$mday日";
}
sub shortdate {
my $time = shift;
(my $sec,my $min,my $hour,my $mday,my $mon,my $year,my $wday,my $yday,my $isdst) = localtime($time);
$mon++;
if ($mon < 10) { $mon = "0$mon"; }
if ($mday < 10) { $mday = "0$mday"; }
$year = $year + 1900;
return "$year/$mon/$mday";
}
sub shorttime {
my $time = shift;
(my $sec,my $min,my $hour,my $mday,my $mon,my $year,my $wday,my $yday,my $isdst) = localtime($time);
$mon++;
my $ampm = "am";
if ($hour > 11) { $ampm = "pm"; }
if ($hour > 12) { $hour = $hour - 12; }
if ($hour < 10) { $hour = "0$hour"; }
if ($min < 10) { $min = "0$min"; }
if ($sec < 10) { $sec = "0$sec"; }
return "$hour:$min$ampm";
}
sub dateformatshort {
my $time = shift;
(my $sec,my $min,my $hour,my $mday,my $mon,my $year,my $wday,my $yday,my $isdst) = localtime($time);
my @months = ('01','02','03','04','05','06','07','08','09','10','11','12');
$mon = $months[$mon];
if ($hour < 10) { $hour = "0$hour"; }
if ($mday < 10) { $mday = "0$mday"; }
if ($min < 10) { $min = "0$min"; }
if ($sec < 10) { $sec = "0$sec"; }
$year = $year + 1900;
return "$year/$mon/$mday $hour:$min";
}
sub joineddate {
my $time = shift;
(my $sec,my $min,my $hour,my $mday,my $mon,my $year,my $wday,my $yday,my $isdst) = localtime($time);
my @months = ('01','02','03','04','05','06','07','08','09','10','11','12');
$year = $year + 1900;
if ($mday < 10) { $mday = "0$mday"; }
return " $year/$months[$mon]/$mday";
}
sub output {
my %args = (
-Title => "",
-ToPrint => "",
-Version => "",
@_,
);
my $title = $args{-Title};
my $output = $args{-ToPrint};
my $versionnumber = $args{-Version};
my $filetoopen = "$lbdir" . "data/template.cgi";
open(FILE,"$filetoopen") or die "没有找到 template.cgi 文件!";
my @templatedata = <FILE>;
close(FILE);
my $boardcopyright = qq(©\; $copyrightinfo) if $copyrightinfo;
$boardcopyright =~ s/</</g; $boardcopyright =~ s/>/>/g; $boardcopyright =~ s/"/\"/g;
my $copyright = qq~
<center>
~;
if ($thisprog eq $threadprog) {
$adscript = &HTML("$adscript");
$copyright .= $adscript;
}
$copyright .= qq~
<hr width=350 size=1>
<table width=80% align=center cellpadding=0 cellspacing=0>
<tr><td align=center>
~;
if ($thisprog eq $threadprog) {
$copyright .= qq~
<script>
var tc_user="cnleo";
var tc_class="2";
var tc_union="";
var tc_type="1";
_dw('<a href=http://www.textclick.com/viewmain.asp?name='+tc_user+' target=_blank><img WIDTH=0 EIGHT=0 src=http://ad.t2t2.com/scripts/stat.dll?default&user='+tc_user+'&refer='+escape(document.referrer)+'&cur=type2 border=0></a>');
function _dw(string) {document.write(string);}
</script>
~;
}
$copyright .= qq~
<font color=$fontcolormisc>
$boardcopyright 版本: <a href="http://www.leoboard.com/download.htm">$versionnumber</a>
</font>
</td></tr></table>
</center>
~;
foreach my $line (@templatedata) {
$line =~ s/\$lbbody/$lbbody/sg;
$line =~ s/\$page_title/$title/sg;
$line =~ s/\$imagesurl/$imagesurl\/images/sg;
$line =~ s/\$lbboard_main/$output\n\n$copyright\n/sg;
$coolwinn = $coolwin?"navigator.userAgent.indexOf('IE 5.5') > -1":"0";
$line =~ s/\$coolwin/$coolwinn/isg;
print $line;
}
exit;
}
sub helpfiles {
my $helptype = shift;
my $helpurl = qq~<a href="javascript:openScript('help.cgi?helpon=$helptype',500,400)">~;
return $helpurl;
}
sub getforum {
my $inforum = shift;
$filetoopen = "$lbdir" . "data/allforums.cgi";
&winlock($filetoopen);
open(FILE, "$filetoopen") or die "文件 allforums.cgi 不存在!";
flock(FILE, 1) if ($OS_USED eq "Unix");
@forums = <FILE>;
close(FILE);
&winunlock($filetoopen);
foreach my $forumline (@forums) {
chomp $forumline;
next if ($forumline eq "");
(my $tempno, my $trash) = split(/\t/,$forumline);
if ($inforum eq $tempno) {
($forumid, $category, $categoryplace, $forumname, $forumdescription, $forummoderator ,$htmlstate ,$idmbcodestate ,$privateforum, $startnewthreads ,$lastposter ,$lastposttime, $threads, $posts, $forumgraphic, $ratings, $misc,$forumpass,$hiddenforum,$indexforum) = split(/\t/,$forumline);
}
}
}
sub rebuildLIST {
my %IN = (
-Forum => "",
@_,
);
$dirtoopen = "$lbdir" . "forum$IN{-Forum}";
opendir (DIR, "$dirtoopen");
my @dirdata = readdir(DIR);
closedir (DIR);
my @entry = grep(/\.thd\.cgi$/,@dirdata);
foreach (@entry) {
(my $id, my $tr) = split(/\./,$_);
my $file = "$lbdir" . "forum$IN{-Forum}/$id.pl";
open (TMP, "$file");
(my $topicid, my $topictitle, my $topicdescription, my $threadstate, my $threadposts, my $threadviews, my $startedby, my $startedpostdate, my $lastposter, my $lastpostdate, my $posticon1,my $inposttemp) = split (/\t/,<TMP>);
close (TMP);
$posticon =~ s/\s//isg;
if ($posticon =~/<br>/i) {
$posticon=~s/<br>/\t/ig;
@temppoll = split(/\t/, $posticon);
$temppoll = @temppoll;
if ($temppoll >1) {
$posticon = "<br>";
}
else {
$posticon = "";
}
}
my $file1 = "$lbdir" . "forum$IN{-Forum}/$id.thd.cgi";
if (($topictitle eq "")||($startedby eq "")||($startedpostdate eq "")||($threadposts eq "")){
open (TMP1, "$file1");
my @tmp = <TMP1>;
close (TMP);
my $tmp = @tmp;
$tmp --;
my $tmp1 = $tmp[-1];
my $tmp2 = $tmp[0];
(my $membername, $topictitle, my $postipaddress, my $showemoticons, my $showsignature, my $postdate, my $post, my $posticon) = split(/\t/,$tmp2);
(my $membername1, my $topictitle1, my $postipaddress1, my $showemoticons1, my $showsignature1, my $postdate1, my $post1, $posticon1) = split(/\t/,$tmp1);
chomp $posticon;
chomp $posticon1;
$membername1 = "" if ($tmp eq 0);
$threadviews = ($tmp+1) * 8;
$postdate1 = $lastpostdate if ($lastpostdate ne "");
$inposttemp = $post1;
$inposttemp =~ s/\[这个贴子最后由(.+?)编辑\]\n//isg;
$inposttemp =~ s/\[quote\](.*)\[quote\](.*)\[\/quote](.*)\[\/quote\]//isg;
$inposttemp =~ s/\[quote\]\s*(.*?)\s*\[\/quote\]//isg;
$inposttemp =~ s/\[\s*(.*?)\s*\]\s*(.*?)\s*\[\s*(.*?)\s*\]/$2\n/isg;
$maxsmailtemp = $maxsmail;
$maxsmail = 0;
$inposttemp = &doemoticons("$inposttemp");
$maxsmail = $maxsmailtemp;
$inposttemp =~ s/\<img\s*(.*?)\s*\>//isg;
$inposttemp =~ s/\n//isg;
$inposttemp =~ s/( )+$//isg;
$inposttemp =~ s/^( )+//isg;
$inposttemp =~ s/<(.|\n)+?>//g;
$inposttemp =~ s/\[.+?\]//g;
$posticon =~ s/\s//isg;
if ($posticon =~/<br>/i) {
$posticon=~s/<br>/\t/ig;
@temppoll = split(/\t/, $posticon);
$temppoll = @temppoll;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -