📄 poll.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 "lbmail.lib.pl";
require "lb.lib.pl";
require "rebuildlist.pl";
$|++; # Unbuffer the output
$thisprog = "poll.cgi";
$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/;
}
$addme=$query->param('addme');
for ('forum','topic','membername','password','action','inshowsignature',
'notify','inshowemoticons','intopictitle','intopicdescription','myChoice',
'inpost','posticon','threadname','inhiddentopic','postweiwang','hidepoll','canpoll','uselbcode','inwater') {
next unless defined $_;
next if $_ eq 'SEND_MAIL';
$tp = $query->param($_);
$tp = &cleaninput("$tp");
${$_} = $tp;
}
$intopictitle = "*#!&*$intopictitle";
$inforum = $forum;
$intopic = $topic;
&error("打开文件&老大,别乱黑我的程序呀!") if (($intopic) && ($intopic !~ /^[0-9]+$/));
&error("打开文件&老大,别乱黑我的程序呀!") if (($inforum) && ($inforum !~ /^[0-9]+$/));
&error("普通&请以正确的方式访问本程序!") if (($postweiwang > $maxweiwang)&&($inhiddentopic eq "yes"));
$inmembername = $membername;
$inpassword = $password;
$innotify = $notify;
$currenttime = time;
$postipaddress = &myip();
$inposticon = $posticon;
$inpost =~ s/LBHIDDEN/LBHIDD\&\#069\;N/sg;
$inpost =~ s/\[DISABLELBCODE\]/\[DISABLELBCOD\&\#069\;\]/sg;
$inpost .=($uselbcode eq "yes")?"":"[DISABLELBCODE]" if($action eq "addnew");
$inmembername = &stripMETA($inmembername);
&ipbanned; #封杀一些 ip
if (!(-e "${lbdir}boarddata/list$inforum.cgi")) { &error ("发表新主题&对不起,这个论坛不存在!如果确定分论坛号码没错,那么请进入管理区修复论坛一次!"); }
if (-e "${lbdir}data/style${inforum}.cgi") { require "${lbdir}data/style${inforum}.cgi"; }
$advpost=$query->param('advpost');
if ($advpost eq "") {$advpost = $query->cookie("advpost");}
$advpost=0 if ($advpost eq "");
if ($inshowemoticons ne "yes") { $inshowemoticons eq "no"; }
if ($innotify ne "yes") { $innotify eq "no"; }
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 = "客人";
$userregistered = "no";
} else {
&getmember("$inmembername");
&error("普通错误&此用户根本不存在!") if ($inpassword ne "" && $userregistered eq "no");
&error("普通错误&密码与用户名不相符,请重新登录!") if ($inpassword ne $password);
}
require "postjs.cgi" if ($advpost == 1);
if ($mainonoff == 1) { &InMaintenance; }
$maxpoststr = "" if ($maxpoststr eq 0);
$maxpoststr = 100 if (($maxpoststr < 100)&&($maxpoststr ne ""));
$advcookie = cookie(-name => "advpost", -value => "$advpost", -expires => "+30d", -path => "$cookiepath/" );
print header(-cookie =>[$advcookie],-charset=>gb2312);
if ($wwjf ne "no") {
for (my $i=0;$i<$maxweiwang;$i++) {
$weiwangoption.=qq~<option value=$i>$i</option>~;
}
$weiwangoptionbutton=qq~ <input type=checkbox name="inhiddentopic" value="yes" >加密此帖,只对部分用户可见,用户威望至少需要 <select name=postweiwang>$weiwangoption</select><br>~;
} else {
undef $weiwangoptionbutton;
}
if ($nowater eq "on") {
$nowaterpost =qq~<tr><td bgcolor=$miscbackone><font color=$fontcolormisc><b>灌水限制</b></font></td><td bgcolor=$miscbackone> <input type="radio" class=1 name="inwater" value="no"> 不许灌水 <input name="inwater" type="radio" class=1 value="yes" checked> 允许灌水 [如果选择“不许灌水”,则回复不得少于 <B>$gsnum</B> 字节]</td></tr>~;
}
if (($threadname) && ($threadname !~ /^[0-9]+$/)) { &error("普通&老大,别乱黑我的程序呀!"); }
#if (($id) && ($id !~ /^[0-9]+$/)) { &error("普通&老大,别乱黑我的程序呀!"); }
$helpurl = &helpfiles("阅读标记");
$helpurl = qq~$helpurl<img src=$imagesurl/images/help_b.gif border=0></a>~;
if ($arrawpostpic eq "on") { $postpicstates = "允许";} else {$postpicstates = "禁止";}
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 ($action eq "new") { &newthread; }
elsif ($action eq "addnew") { &addnewthread; }
elsif ($action eq "poll") { &poll; }
else { &error("普通&请以正确的方式访问本程序!$action"); }
&output( -Title => "$boardname - 在$forumname内发新投票", -ToPrint => $output, -Version => $versionnumber);
exit;
sub newthread {
#&getoneforum("$inforum");
&moderator("$inforum");
if (($floodcontrol eq "on") && ($membercode ne "ad")&& ($membercode ne 'smo')&&($membercode ne 'cmo')&&($membercode ne 'mo') && ($inmembmod ne "yes")) {
($lastpost, $posturl, $posttopic) = split(/\%\%\%/,$lastpostdate);
$lastpost = ($lastpost + $floodcontrollimit);
if ($lastpost > $currenttime) {
&error("发表新投票&灌水预防机制已经使用,您必须等待 $floodcontrollimit 秒钟才能再次发表!");
}
}
$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 ($pollopen eq "no") { &error("发表新投票&对不起,本论坛不允许发表新投票!"); }
if (($privateforum eq "yes") && ($allowed ne "yes")) { &error("发表新投票&对不起,您没有在此论坛中发表的权利!"); }
if ($emoticons eq "on") {
$emoticonslink = qq~<li><a href="javascript:openScript('misc.cgi?action=showsmilies',300,350)">允许<B>使用</B>表情字符转换</a>~;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -