⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 pag.cgi

📁 一个linux论坛
💻 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=1024*150;
$LBCGI::DISABLE_UPLOADS = 1;
$LBCGI::HEADERS_ONCE = 1;
require "code.cgi";
require "data/boardinfo.cgi";
require "data/styles.cgi";
require "lb.lib.pl";
require "lbmail.lib.pl";
require "visitforum.lib.pl";
$|++;
$thisprog = "pag.cgi";
$query = new LBCGI;
&ipbanned; #封杀一些 ip

$inforum        = $query -> param('forum');
$intopic        = $query -> param('topic');
$email        = $query -> param('email');

print header(-charset=>gb2312);
&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"; }
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 = "客人";
	    if ($regaccess eq "on") {
	    	print header(-cookie=>[$namecookie, $passcookie], -charset=>gb2312);
	    	print "<script language='javascript'>document.location = 'loginout.cgi?forum=$inforum'</script>";
	    	exit;
	    }
}
else {
#    &getmember("$inmembername");
    &getmembernolock("$inmembername");
    &error("普通错误&此用户根本不存在!") if ($userregistered eq "no");
    if (($allowedentry{$inforum} eq "yes")||($membercode eq "ad")||($membercode eq 'smo')) { $allowed = "yes"; } else { $allowed = "no"; }
#        &getmemberstime("$inmembername");
        &getlastvisit;
        $forumlastvisit = $lastvisitinfo{$inforum};
        $currenttime = time;
        &setlastvisit("$inforum,$currenttime");
    }

    &getoneforum("$inforum");

    $filetoopen = "$lbdir" . "forum$inforum/$intopic.thd.cgi";
    &winlock($filetoopen) if ($OS_USED eq "Nt");
    open(FILE, "$filetoopen");
    flock(FILE, 1) if ($OS_USED eq "Unix");
    @threads = <FILE>;
    close(FILE);
    &winunlock($filetoopen) if ($OS_USED eq "Nt");
    ($trash, $topictitle, $trash) = split(/\t/, @threads[0]);
    $topictitle =~ s/^*#!&*//;
    $postdate = &dateformat($postdate + ($timedifferencevalue*3600) + ($timezone*3600));

if (($startnewthreads eq "cert")&&(($membercode ne "ad" && $membercode ne "smo" && $membercode ne "cmo" && $membercode ne "mo" && $membercode ne "rz")||($inmembername eq "客人"))&&($userincert eq "no")) { &error("进入论坛&你一般会员不允许进入此论坛!"); }

    if (($privateforum eq "yes") && ($allowed ne "yes")) {
        &error("进入私密论坛&对不起,你无权访问这个论坛!");
    }
    else {
      my $filetoopens = "$lbdir" . "data/onlinedata.cgi";
      $filetoopens = &lockfilename($filetoopens);
      if (!(-e "$filetoopens.lck")) {
        if ($privateforum ne "yes") {
            &whosonline("$inmembername\t$forumname\tnone\t打包邮递贴子<a href=\"topic.cgi?forum=$inforum&topic=$intopic\"><b>$topictitle</b></a>\t");
        }
        else {
            &whosonline("$inmembername\t$forumname(密)\tnone\t打包邮递贴子保密贴子\t");
        }
      }
    }
if ($emailfunctions eq "off") { &error("打包邮递&非常抱歉,论坛的发送邮件功能已经关闭!");  }

	if (($dofilter eq "no")||($dofilter eq "all")) {
	    $topictitle = &postwordfilter("$topictitle");
	}

    if ($email){
        if ($email !~ /^.+\@(\[?)[a-zA-Z0-9\-\.]+\.([a-zA-Z]{2,3}|[0-9]{1,3})(\]?)$/) { &error("打包邮递&错误的邮件地址!"); }
        $email =~ s/[\a\f\n\e\0\r\t\`\~\!\$\%\^\&\*\(\)\=\+\\\{\}\;\'\:\"\,\/\<\>\?\|]//isg;
        $output .= qq~
        <html><head><title>$boardname</title>
	<style>
		A:visited {	TEXT-DECORATION: none	}
		A:active  {	TEXT-DECORATION: none	}
		A:hover   {	TEXT-DECORATION: underline overline	}
		A:link 	  {	text-decoration: none;}

	        A:visited {	text-decoration: none;}
	        A:active  {	TEXT-DECORATION: none;}
	        A:hover   {	TEXT-DECORATION: underline overline}

		.t     {	LINE-HEIGHT: 1.4					}
		BODY   {	FONT-FAMILY: 宋体; FONT-SIZE: 9pt	}
		TD	   {	FONT-FAMILY: 宋体; FONT-SIZE: 9pt	}
		SELECT {	FONT-FAMILY: 宋体; FONT-SIZE: 9pt;	}
		INPUT  {	FONT-FAMILY: 宋体; FONT-SIZE: 9pt; height:22px;	}
		TEXTAREA{	FONT-FAMILY: 宋体; FONT-SIZE: 9pt;	}
		DIV    {	FONT-FAMILY: 宋体; FONT-SIZE: 9pt	}
		FORM   {	FONT-FAMILY: 宋体; FONT-SIZE: 9pt	}
		OPTION {	FONT-FAMILY: 宋体; FONT-SIZE: 9pt	}
		P	   {	FONT-FAMILY: 宋体; FONT-SIZE: 9pt	}
		TD	   {	FONT-FAMILY: 宋体; FONT-SIZE: 9pt	}
		BR	   {	FONT-FAMILY: 宋体; FONT-SIZE: 9pt	}
	</style>
    </head>
    <body topmargin=10 leftmargin=0>
    <table cellpadding=0 cellspacing=0 border=0 width=90% align=center>
        <tr>
            <td>
            <p><b>从$boardname打包的主题</b><p>
            <b>论 坛 名- $boardname</b> ($boardurl/leoboard.cgi)<br>
            <b>讨论区名-- $forumname</b> ($boardurl/forums.cgi?forum=$inforum)<br>
            <b>贴子标题--- $topictitle</b> ($boardurl/forums.cgi?forum=$inforum&topic=$intopic)
        </tr>
    </table>
    <p><p><p>
    <table cellpadding=0 cellspacing=0 border=0 width=90% align=center>
        <tr>
            <td>

    ~;
    foreach $line (@threads) {
        ($postermembername, $topictitle, $postipaddress, $showemoticons, $showsignature, $postdate, $post) = split(/\t/,$line);
        $post =~ s/\[hide\](.*)\[\/hide\]/<font color=red>隐藏内容不能打包<\/font>/isg; 
		$post="<font color=red>加密贴子不能打包<\/font>" if ($post=~/LBHIDDEN\[(.*?)\]LBHIDDEN/isg);
		$post =~ s/\[post=(.+?)\](.+?)\[\/post\]/<font color=red>加密贴子不能打包<\/font>/isg;

		$post = &lbcode("$post");

        $post =~ s/&lt\;/\</g;
        $post =~ s/&gt\;/\>/g;
        $post =~ s/&quot\;/\"/g;
        $postdate = &dateformat($postdate + ($timedifferencevalue*3600) + ($timezone*3600));

	if (($dofilter eq "no")||($dofilter eq "all")) {
	    $post = &postwordfilter("$post");
	}

        $output .= qq~ 
        <hr><br>
        -- 发布人: $postermembername<BR>
        -- 发布时间: $postdate<br>
        $post      
        ~;
    }
    $output .= qq~
        </td></tr></table><center><hr><b>$boardname<br>&copy; 2000 cgier.com</b></center>
        </body></html>
    ~;
$subject = "从$boardname打包邮递过来的贴子";
if ($SEND_MAIL ne ""&& $emailtype eq "send_mail") {
$output.= "<br>LB5000 论坛 技术支持:http://www.leoBBS.com/<br>";
        $output.= "中文版权:CGI 编程者之家  http://www.CGIer.com/<br>";
	    open (MAIL,"| $SEND_MAIL -t");
	    print MAIL "To: $email\n";
	    print MAIL "From: $adminemail_out\n";
	    print MAIL "X-Mailer: LeoBoard Sendmail Mail Sender!\n";
	    print MAIL "Subject: $subject\n";
	    print MAIL "Content-Type: text/html;charset=gb2312\n";
 	    print MAIL "$output";
	    print MAIL "\n.\n";
	    close(MAIL);
}
else{
	 $output=~s/\n//isg;
	 &sendmail($adminemail_out, $adminemail_in, $email, $subject, $output);
}
    print "<center><br><b>邮递贴子完毕!</b><br><br><a href=javascript:top.window.close()>关闭窗口</a><script>top.window.close()</script></center>";
    exit;
}else {
    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=460 align=center>
    <tr>
        <td width=30% rowspan=2 valign=top>$forumgraphic</td>
        <td align=left><font color=$fontcolormisc>
         <img src=$imagesurl/images/closedfold.gif border=0> <a href=leoboard.cgi>$boardname</a><br>
         <img src=$imagesurl/images/bar.gif border=0><img src=$imagesurl/images/openfold.gif border=0> 打包邮递
        </td>
    </tr>
    </table>
    <p>
    <table cellpadding=0 cellspacing=0 border=0 width=460 bgcolor=$tablebordercolor align=center>
    <tr><td>
    <table cellpadding=6 cellspacing=1 border=0 width=100%>
    <form action="$thisprog" method=post>
    <tr>
    <td bgcolor=$miscbacktwo colspan=2 align=center>
    <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 colspan=2><font color=$fontcolormisc>
    <b>把本贴 <a href=topic.cgi?forum=$inforum&topic=$intopic>$topictitle</a> 打包邮递。</b><br>请正确输入你要邮递的邮件地址!
    </td></tr><tr>
    <td bgcolor=$miscbacktwo><font color=$fontcolormisc><b>邮递的 Email 地址:</b></td>
    <td bgcolor=$miscbacktwo><input type=text size=40 name="email"></td>
    </tr><tr>
    <td colspan=2 bgcolor=$miscbacktwo align=center><input type=submit value="发 送" name="Submit"></table></td></form></tr></table>
    ~;
    &output(
	-Title   => $boardname,
	-ToPrint => $output,
	-Version => $versionnumber
    );
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -