www.pudn.com > bbs3000afree.zip > new.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///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=""; 
open (PEO,"$filepath/data/people.cgi"); 
@lines=; 
close (PEO); 
foreach $line (@lines) { 
chomp($line); 
($rip,$r1,$r2,$r3,$rname,$tu,$bbsname,$rtitles,$act)=split(/\t/,$line); 
if($rtitles){ 
$new="$new"; 
} 
} 
$new="$new
$rtitles($r1:$r2:$r3)
"; print "Content-type: text/html\n\n"; print "document.write(\"$new\")"; exit; } ############## sub new{ $new=""; open(TITLES,"$filepath/list/$id/bbs"); @hastitles=; 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=; 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"; }} $new="$new
$rtitles($rthistime)
"; print "Content-type: text/html\n\n"; print <; 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=; close(TITLES); ($rtitles,$rthistime,$rusername,$nr,$rfrom,$rhasreply,$emote,$lastname,$rlasttime,$re,$rhassee)=split(/\t/,$m); $rtitles=~s/"//g; ($rthistime)=split(/\./,$rthistime); $new="$new○ $rtitles(点击:$rhassee)"; }} $new="$new"; print "Content-type: text/html\n\n"; print <