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

📄 new.cgi

📁 --黑客防线-精华奉献本(攻册)
💻 CGI
字号:
#!/usr/bin/perl
#------------------------------------------------------#
#         本程序为Yuzi工作室提供        #
#        Yuzi论坛3000(BBS3000)v4.00      #
#------------------------------------------------------#
$cgipa=".";     # CGI程序文件的绝对路径
$newno="8";     # 显示的主题数
######################
## 以下部分不需修改 ##
######################
require "$cgipa/setup.cgi";
if ($ENV{'REQUEST_METHOD'} eq "POST") {
read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'});
}
else {
$buffer = $ENV{'QUERY_STRING'};
}
@pairs = split(/&/, $buffer);
foreach $pair (@pairs) {
($name, $value) = split(/=/, $pair);
$value=~tr/+/ /;
$value=~s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;
$value=~s/<!--(.|\n)*-->//g;
$value=~s/\.\.//g;
$FORM{$name} = $value;
}
$id=$FORM{'id'};
if($FORM{'menu'} eq ""){&new;exit;}
if($FORM{'menu'} eq "hot"){&hot;exit;}
elsif($FORM{'menu'} eq "new"){&new;exit;}
elsif($FORM{'menu'} eq "jing"){&jing;exit;}
exit;
##############
sub hot{
$new="<table>";
open (PEO,"$filepath/data/people.cgi");
@lines=<PEO>;
close (PEO);
foreach $line (@lines) {
chomp($line);
($rip,$r1,$r2,$r3,$rname,$tu,$bbsname,$rtitles,$act)=split(/\t/,$line);
if($rtitles){
$new="$new<tr><td width=80%>○ <a href=$ym/$act target=_blank>$rtitles</a></td><td>($r1:$r2:$r3)</td></tr>";
}
}
$new="$new</table>";
print "Content-type: text/html\n\n";
print "document.write(\"$new\")";
exit;
}
##############
sub new{
$new="<table>";
open(TITLES,"$filepath/list/$id/bbs");
@hastitles=<TITLES>;
close(TITLES);
for ($i=0; $i<$newno; $i++){
$hastitle=@hastitles[$i];
if($hastitle ne ""){
($rcomment)=split(/\t/,$hastitle);
chomp($rcomment);
open(TITLES,"$filepath/list/$id/$rcomment");
$m=<TITLES>;
close(TITLES);
($rtitles,$rthistime,$rusername,$nr,$rfrom,$rhasreply,$remote)=split(/\t/,$m);
$rtitles=~s/"//g;
if (length($rtitles) > 20) {$rtitles = substr($rtitles,0,20);$rtitles.="...";}
($rthistime)=split(/\./,$rthistime);
$new="$new<tr><td width=80%><img src=$imagurl/$remote.gif> <a href=$ym/bbs.cgi?menu=show&id=$id&slttitle=$rcomment target=_blank>$rtitles</a></td><td>($rthistime)</td></tr>";
}}
$new="$new</table>";
print "Content-type: text/html\n\n";
print <<EOF;
document.write("$new");
EOF
exit;
}
##############
sub jing{
$new="<table>";
open(TITLES,"$filepath/list/$id/good");
@hastitles=<TITLES>;
close(TITLES);
for ($i=0; $i<$newno; $i++){
$hastitle=@hastitles[$i];
if($hastitle ne ""){
($rcomment)=split(/\t/,$hastitle);
chomp($rcomment);
open(TITLES,"$filepath/list/$id/$rcomment");
$m=<TITLES>;
close(TITLES);
($rtitles,$rthistime,$rusername,$nr,$rfrom,$rhasreply,$emote,$lastname,$rlasttime,$re,$rhassee)=split(/\t/,$m);
$rtitles=~s/"//g;
($rthistime)=split(/\./,$rthistime);
$new="$new<tr><td width=80%>○ <a href=$ym/bbs.cgi?menu=show&id=$id&slttitle=$rcomment target=_blank>$rtitles</a></td><td>(点击:$rhassee)</td></tr>";
}}
$new="$new</table>";
print "Content-type: text/html\n\n";
print <<EOF;
document.write("$new");
EOF
exit;
}
######################### END OF SCRIPT #########################

⌨️ 快捷键说明

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