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

📄 post.cgi

📁 一个linux论坛
💻 CGI
📖 第 1 页 / 共 2 页
字号:
$helpurl = qq~$helpurl<img src=$imagesurl/images/help_b.gif border=0></a>~;

my %Mode = (
    'new'        => \&newthread,
    'addnew'     => \&addnewthread,
    'reply'      => \&reply,
    'addreply'   => \&addreply,
    'replyquote' => \&replyquote,
    'copy1'      => \&copy1
);

    if ($arrawpostpic eq "on")      { $postpicstates = "允许";}      else { $postpicstates = "禁止";}
    if ($arrawpostflash eq "on")    { $postflashstates = "允许";}    else { $postflashstates = "禁止";}
    if ($arrawpostfontsize eq "on") { $postfontsizestates = "允许";} else { $postfontsizestates = "禁止";}
    if ($arrawpostsound eq "on")    { $postsoundstates = "允许";}    else { $postsoundstates = "禁止";}

    if ($postjf eq "yes")    { $postjfstates = "允许";}    else { $postjfstates = "禁止";}
    if ($hidejf eq "yes")    { $hidejfstates = "允许";}    else { $hidejfstates = "禁止";}

    if ($Mode{$action}) { $Mode{$action}->(); }
    else { &error("普通&请以正确的方式访问本程序!"); }

&output( -Title => "$boardname - 在$forumname内发帖", -ToPrint => $output, -Version => $versionnumber );
exit;

sub newthread {
#&getoneforum("$inforum");
    &moderator("$inforum");
    $tempaccess = "forumsallowed". "$inforum";
    $testentry = $query->cookie("$tempaccess");

    if ((($testentry eq $forumpass)&&($testentry ne ""))||($allowedentry{$inforum} eq "yes")||($membercode eq "ad")||($membercode eq 'smo')||($inmembmod eq "yes")) { $allowed = "yes"; }
    if (($privateforum eq "yes") && ($allowed ne "yes")) { &error("发表&对不起,您没有在此论坛中发表的权利!"); }

    if ($postopen eq "no") { &error("发表主题&对不起,本论坛不允许发表主题!"); }

    my $filetoopens = "$lbdir" . "data/onlinedata.cgi";
    $filetoopens = &lockfilename($filetoopens);
    if (!(-e "$filetoopens.lck")) {
	if ($privateforum ne "yes") { &whosonline("$inmembername\t$forumname\tnone\t发表新主题\t"); }
	                       else { &whosonline("$inmembername\t$forumname(密)\tnone\t发表新的保密主题\t"); }
    }
    if ((($onlinetime + $onlinetimeadd) < $onlinepost)&&($onlinepost ne "")&&($membercode ne "ad")&&($membercode ne "smo")&&($membercode ne "cmo")&&($membercode ne "mo")&&($membercode ne "rz"))     {  $onlinetime = $onlinetime + $onlinetimeadd; &error("发表新主题&对不起,本论坛不允许在线时间少于 $onlinepost 秒的用户发表主题!你目前已经在线 $onlinetime 秒!"); }

    &mischeader("发表新主题");

    if ($emailfunctions eq "on") {
	if ($innotify eq "yes") { $requestnotify = " checked"; } else { $requestnotify = ""; }
	$requestnotify = qq~<input type=checkbox name="notify" value="yes"$requestnotify>有回复时使用邮件通知您?<br>~;
    }

    if ($startnewthreads eq "no")        { $startthreads = "在此论坛中新的主题和帖子回复只能由坛主、版主发表!"; }
    elsif ($startnewthreads eq "follow") { $startthreads = "在此论坛中新的主题只能由坛主、版主发表!普通会员只可以跟帖!"; }
    elsif ($startnewthreads eq "all")    { $startthreads = "任何人均可以发表和回复主题,未注册用户发帖密码请留空!"; }
    elsif ($startnewthreads eq "cert")   { $startthreads = "在此论坛中新的主题只能由坛主、版主、认证的会员发表!"; }
    else { $startthreads = "所有注册会员均可以发表和回复主题!"; }

    if ($emoticons eq "on") {
	$emoticonslink = qq~<li><a href="javascript:openScript('misc.cgi?action=showsmilies',300,350)">允许<B>使用</B>表情字符转换</a>~;
	$emoticonsbutton =qq~<input type=checkbox name="inshowemoticons" value="yes" checked>您是否希望<b>使用</b>表情字符转换在您的文章中?<br>~;
    }

    if (($advpost == 1)&&($emoticons eq "on")){
	$output .= qq~<script language="javascript">function smilie(smilietext) {smilietext=' :'+smilietext+': ';if (document.FORM.inpost.createTextRange && document.FORM.inpost.caretPos) {var caretPos = document.FORM.inpost.caretPos;caretPos.text = caretPos.text.charAt(caretPos.text.length - 1) == ' ' ? smilietext + ' ' : smilietext;document.FORM.inpost.focus();} else {document.FORM.inpost.value+=smilietext;document.FORM.inpost.focus();}}</script>~;
    }
    if ($htmlstate eq "on")     { $htmlstates = "可用"; }     else { $htmlstates = "不可用"; }
    if ($idmbcodestate eq "on") { $idmbcodestates = "可用"; } else { $idmbcodestates = "不可用"; }
    if ($advpost == 1) { $advpostmt="[<a href=$thisprog?action=new&forum=$inforum&advpost=0>简洁模式</a>]"; }
                  else { $advpostmt="[<a href=$thisprog?action=new&forum=$inforum&advpost=1>高级模式</a>]"; $insidejs = ""; }

    $intopictitle =~ s/^*#!&*//;
    $output .= qq~<script>
function storeCaret(textEl) {if (textEl.createTextRange) textEl.caretPos = document.selection.createRange().duplicate();}
function HighlightAll(theField) {
var tempval=eval("document."+theField)
tempval.focus()
tempval.select()
therange=tempval.createTextRange()
therange.execCommand("Copy")}
function DoTitle(addTitle) {
var revisedTitle;var currentTitle = document.FORM.intopictitle.value;revisedTitle = addTitle+currentTitle;document.FORM.intopictitle.value=revisedTitle;document.FORM.intopictitle.focus();
return;}
</script>
<form action="$thisprog" method=post name="FORM" enctype="multipart/form-data">
<input type=hidden name="action" value="addnew">
<input type=hidden name="forum" value="$inforum">
<table cellpadding=0 cellspacing=0 border=0 width=$tablewidth bgcolor=$tablebordercolor align=center>
<tr><td><table cellpadding=3 cellspacing=1 border=0 width=100%>
<tr><td bgcolor=$titlecolor colspan=2><font color=$titlefontcolor><b>谁可以发表?</b> $startthreads $advpostmt</td></tr>
<tr><td bgcolor=$miscbackone><font color=$fontcolormisc><b>主题标题</b></font> 
<select name=font onchange=DoTitle(this.options[this.selectedIndex].value)>
<OPTION selected value="">选择话题</OPTION> <OPTION value=[原创]>[原创]</OPTION><OPTION value=[转帖]>[转帖]</OPTION><OPTION value=[灌水]>[灌水]</OPTION><OPTION value=[讨论]>[讨论]</OPTION><OPTION value=[求助]>[求助]</OPTION><OPTION value=[推荐]>[推荐]</OPTION><OPTION value=[公告]>[公告]</OPTION><OPTION value=[注意]>[注意]</OPTION><OPTION value=[贴图]>[贴图]</OPTION><OPTION value=[建议]>[建议]</OPTION><OPTION value=[下载]>[下载]</OPTION><OPTION value=[分享]>[分享]</OPTION>
</SELECT></td><td bgcolor=$miscbackone><input type=text size=60 maxlength=80 name="intopictitle" value="$intopictitle"> 不得超过 40 个汉字</td></tr>$nowaterpost
    ~;
    &posttable;
}

sub addnewthread {
#&getoneforum("$inforum");
    &moderator("$inforum");
    $timeadd  = ($timedifferencevalue + $timezone)*3600;
    if (($floodcontrol eq "on") && ($membercode ne "ad")&&($membercode ne 'smo')&&($membercode ne 'cmo') && ($inmembmod ne "yes")) {
	($lastpost, $posturl, $posttopic) = split(/\%\%\%/,$lastpostdate);
	$lastpost = $lastpost + $floodcontrollimit;
	if ($lastpost > $currenttime)  {
	    &error("发表新主题&灌水预防机制已经使用,您必须等待 $floodcontrollimit 秒钟才能再次发表!");
	}
    }
    if (($inhiddentopic eq "yes") && ($userregistered eq "no")) { &error("发表主题&未注册用户无权进行威望加密!"); }

    &error("发表或回复主题&对不起,本论坛不允许发表或回复超过 <B>$maxpoststr</B> 个字符的文章!") if ((length($inpost) > $maxpoststr)&&($maxpoststr ne "")&&($membercode ne "ad")&&($membercode ne 'smo') && ($membercode ne "mo") && ($membercode ne "cmo") && ($membercode ne "rz") && ($inmembmod ne "yes"));

    if ($postopen eq "no") { &error("发表或回复主题&对不起,本论坛不允许发表或回复主题!"); }

    my $filetoopens = "$lbdir" . "data/onlinedata.cgi";
    $filetoopens = &lockfilename($filetoopens);
    if (!(-e "$filetoopens.lck")) {
	if ($privateforum ne "yes") { &whosonline("$inmembername\t$forumname\tnone\t发表新主题\t"); }
	                       else { &whosonline("$inmembername\t$forumname(密)\tnone\t发表新的保密主题\t"); }
    }

    if ((($onlinetime + $onlinetimeadd) < $onlinepost)&&($onlinepost ne "")&&($membercode ne "ad")&&($membercode ne "smo")&&($membercode ne "cmo")&&($membercode ne "mo")&&($membercode ne "rz"))     { $onlinetime = $onlinetime + $onlinetimeadd; &error("回复主题&对不起,本论坛不允许在线时间少于 $onlinepost 秒的用户回复主题!你目前已经在线 $onlinetime 秒!"); }

    if (($userregistered eq "no")&&(length($inmembername) > 12)) { &error("发表新主题&您输入的用户名太长,请控制在6个汉字内!");   }
    if (($userregistered eq "no")&&($inmembername =~ /^客人/)) { &error("发表新主题&请不要在用户名的开头中使用客人字样!");   }
    if ($inmembername eq "客人") { &error("发表新主题&请不要在用户名的开头中使用客人字样!");   }
    if (($userregistered eq "no")&&($startnewthreads ne "all")) { &error("发表新主题&您没有注册!");   }
    elsif ((($inpassword ne $password)&&($userregistered ne "no"))||(($inpassword ne "")&&($userregistered eq "no"))) { &error("发表新主题&您的密码错误!"); }
    elsif (($membercode eq "banned")||($membercode eq "masked"))      { &error("发表新主题&您被禁止发言或者发言已经被屏蔽,请联系坛主以便解决!"); }
    elsif ($intopictitle eq "*#!&*") { &error("发表新主题&必须输入主题标题!"); }
    elsif (length($intopictitle) > 92)   { &error("发表新主题&主题标题过长!"); }
    else  {
#	@allforums = @forums;
	$intopictitle =~ s/\(无内容\)$//;
	if (($inpost eq "")&&($addme eq "")) { $intopictitle.=" (无内容)"; }
        $intopictitle =~ s/()+//isg;
	my $tempintopictitle = $intopictitle;
	$tempintopictitle =~ s/ //g;
	$tempintopictitle =~ s/\&nbsp\;//g;
        $tempintopictitle =~ s/ //isg;
        $tempintopictitle =~ s/

⌨️ 快捷键说明

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