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

📄 poll.cgi

📁 一个linux论坛
💻 CGI
📖 第 1 页 / 共 2 页
字号:
        $emoticonsbutton =qq~ <input type=checkbox name="inshowemoticons" value="yes" checked>您是否希望<b>使用</b>表情字符转换在您的文章中?<br>~;
    }

    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 (($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 ($arrawpostflash eq "on") { $postflashstates = "允许";} else {$postflashstates = "禁止";}
    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 = ""; }
    $maxpoststr = "(帖子中最多包含 <B>$maxpoststr</B> 个字符)" if ($maxpoststr ne "");
    $Selected[25]=" selected";
    foreach(2..25){
        $canpolllist.=qq~<option value="$_"$Selected[$_]>$_</option>~;
    }

    $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 = currentTitle+addTitle; 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"> 不得超过 40 个汉字</td></tr>$nowaterpost
<tr><td bgcolor=$miscbackone><font color=$fontcolormisc><b>用户名</b></font></td>
<td bgcolor=$miscbackone> <input type=text name="membername" value="$inmembername">  <font color=$fontcolormisc><span onclick="javascript:location.href='register.cgi?forum=$inforum'" style="cursor:hand">您没有注册?</span></td>
</tr><tr>
<td bgcolor=$miscbackone><font color=$fontcolormisc><b>密 码</b></font></td>
<td bgcolor=$miscbackone> <input type=password name="password" value="$inpassword">  <font color=$fontcolormisc><a href="profile.cgi?action=lostpass" style="cursor:help">忘记密码?</a></font></td>
</tr>
<tr><td bgcolor=$miscbacktwo valign=top><font color=$fontcolormisc><b>投票项目</b><br><li>每行一个投票项目,最多 <B>25</b> 项<BR><li>超过自动作废,空行自动过滤<BR><li>如果投票需要多选,请在选择中打钩</font></td>
<td bgcolor=$miscbacktwo valign=top>
 <TEXTAREA cols=58 name=posticon rows=6 wrap=soft >$posticon</TEXTAREA><BR>
 <input type=checkbox name="inshowsignature" value="yes">最多可投<select name="canpoll">$canpolllist</select>项  <input type=checkbox name="hidepoll" value="yes">是否必须投票后才可查看结果?<br>
</td></tr>
<td bgcolor=$miscbackone valign=top><font color=$fontcolormisc><b>内容</b> $maxpoststr<p>在此论坛中:<br>
<li>HTML  标签: <b>$htmlstates</b><li><a href="javascript:openScript('misc.cgi?action=lbcode',300,350)">LB5000 标签</a>: <b>$idmbcodestates</b><li>帖图标签  : <b>$postpicstates</b><li>Flash 标签 : <b>$postflashstates</b><li>音乐标签  : <b>$postsoundstates</b><li>文字大小  : <b>$postfontsizestates</b><li>积分标签  : <b>$postjfstates</b><li>保密标签  : <b>$hidejfstates</b>$emoticonslink</font></td>
<td bgcolor=$miscbackone>
    ~;
    $output .= qq~$insidejs<TEXTAREA cols=80 name=inpost rows=8 wrap="soft" onkeydown=ctlent() onselect="storeCaret(this);" onclick="storeCaret(this);" onkeyup="storeCaret(this);">$inpost</TEXTAREA><br>~;
    if ($advpost == 1){ $output .= qq~&nbsp; 模式:<input type="radio" name="mode" value="help" onClick="thelp(1)"> 帮助 <input type="radio" name="mode" value="prompt" CHECKED onClick="thelp(2)"> 完全 <input type="radio" name="mode" value="basic"  onClick="thelp(0)"> 基本     >> <a href=javascript:HighlightAll('FORM.inpost')>复制到剪帖板</a> | <a href=javascript:checklength(document.FORM);>查看文章长度</a> <<~; }
    $output .= qq~</td></tr></tr>~;
    
    if (($advpost == 1)&&($emoticons eq "on")){
	$output .= qq~<tr><td bgcolor=$miscbackone valign=top colspan=2><font color=$fontcolormisc><b>点击表情图即可在帖子中加入相应的表情(帖子中每个表情最多同时显示 3 次)</B></font><br>&nbsp;~;
	if (open (FILE, "${lbdir}data/lbemot.cgi")) {
	    @emoticondata = <FILE>;
	    close (FILE);
	    chomp @emoticondata;
	}
       	foreach (@emoticondata) {
		my $smileyname = $_;
		$smileyname =~ s/\.gif$//ig;
		$output .= qq~<img src=$imagesurl/emot/$_ border=0 onClick="smilie('$smileyname');FORM.inpost.focus()" style="cursor:hand"> ~;
	}
    	$output .= qq~</td></tr>~;
    }
    $output .= qq~<tr><td bgcolor=$miscbacktwo valign=top><font color=$fontcolormisc><b>选项</b><p>$helpurl</font></td>
<td bgcolor=$miscbacktwo><font color=$fontcolormisc> <input type=checkbox name="uselbcode" value="yes" checked>使用 LB5000 标签?<br>$requestnotify$emoticonsbutton$weiwangoptionbutton<BR></td></tr>
<tr><td bgcolor=$miscbacktwo colspan=2 align=center><input type=Submit value="发 布" name=Submit"  onClick="return clckcntr();">   <input type="reset" name="Clear" value="清 除"></td></form></tr>
</table></tr></td></table>
    ~;
}

sub addnewthread {
#&getoneforum("$inforum");
    &moderator("$inforum");
    if (($floodcontrol eq "on") &&($membercode ne 'smo') &&($membercode ne 'cmo') && ($membercode ne "ad") && ($inmembmod ne "yes")) {
	($lastpost, $posturl, $posttopic) = split(/\%\%\%/,$lastpostdate);
	$lastpost = ($lastpost + $floodcontrollimit);
	if ($lastpost > $currenttime)  {
           &error("发表新投票&灌水预防机制已经使用,您必须等待 $floodcontrollimit 秒钟才能再次发表!");
	}
    }

    &error("发表新投票&对不起,本论坛不允许发表超过 <B>$maxpoststr</B> 个字符的文章!") if ((length($inpost) > $maxpoststr)&&($maxpoststr ne "")&&($membercode ne "ad")&&($membercode ne 'smo')&&($membercode ne 'cmo') && ($membercode ne "mo") && ($membercode ne "rz") && ($inmembmod ne "yes"));
    if ($pollopen 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("发表新主题&请不要在用户名的开头中使用客人字样!");   }

    $inposticon=~s/<p>/<BR>/isg;
    $inposticon=~s/<BR><BR>/<BR>/isg;
    $inposticon =~ s/(.*)<BR>$/$1/i;
    $inposticon =~ s/^<BR>(.*)/$1/i;
    $inposticon =~ s/<BR>(\s*)/<BR>/i;
    $inposticon =~ s/(\s*)<BR>/<BR>/i;

    $inposticontemp = $inposticon;
    $inposticontemp=~s/<br>/\t/ig;
    @temppoll = split(/\t/, $inposticontemp);
    $temppoll = @temppoll;

    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("发表新投票&主题标题过长!"); }
    elsif ($inposticon !~ m/<br>/i)	{ &error("发表新投票&投票选项太少!"); }
    elsif ($temppoll > 25 )	{ &error("发表新投票&投票选项过多,不能超过 25 项!(您此次投票的选项有 $temppoll 项)"); }
    else  {
	if ($startnewthreads eq "no") {
          unless ($membercode eq "ad" || $membercode eq 'smo'|| $inmembmod eq "yes") { &error("发表新投票&在此论坛中只能由坛主或者版主发表新投票!"); }
    	}
	elsif (($startnewthreads eq "follow") &&($action eq "addnew")) {
	   unless ($membercode eq "ad" ||$membercode eq 'smo'|| $inmembmod eq "yes") { &error("发表新投票&在此论坛中只能由坛主或者版主发表新投票!"); }
	}
	elsif ($startnewthreads eq "cert") {
            unless ($membercode eq "ad" ||$membercode eq 'smo'|| $inmembmod eq "yes"||$membercode eq 'mo'||$membercode eq 'rz') { &error("发表新投票&在此论坛中只能由坛主、版主和认证会员发表新投票!"); }
	}
	elsif (($startnewthreads eq "all")&&($userregistered eq "no")) {
	    $inmembername = "$inmembername(客)";
	}

	$intopictitle =~ s/\(无内容\)$//;
        $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 + -