#!/usr/bin/perl print "Content-type: text/html\n\n"; use CGI; $cgi=new CGI; $pagecount=$cgi->param('text'); $page=$cgi->param('page'); $offset=$cgi->param('offset'); $set=$cgi->param('set'); $searchtext=$cgi->param('searchtext'); $class=$cgi->param('class'); $typ=$cgi->param('typ'); $search_typ=$cgi->param('search_typ'); $cpage=$cgi->param('cpage'); $submitgo=$cgi->param('submitgo'); $mode=$cgi->param('mode'); $typ=$cgi->param('typ'); $cat=$typ; $da=time()+1036800; ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst)=localtime($da); $year2=$year+1900; $mon2=$mon+1; $mday2=$mday; $searchtext=~ s/^\s+//; $searchtext=~ s/\s+$//; $searchtext=~ s/\'/\\\'/; ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst)=localtime(time); $year=$year+1900; $month=$mon+1; $day=$mday; $month=sprintf("%02d",$month); $day=sprintf("%02d",$day); open(GUEST,"header.htm"); @title=; close(GUEST); print "@title"; print "\n"; print <<"HED"; HED print "
"; $showcat=&showcat("typ.txt"); print $showcat; $select_typ=&selectindex("typ",$typ); print qq(
管理员    当前位置: 首页 > 新闻中心 > $cat
); print ""; print ""; print ""; print "
"; print "
"; print ""; print " "; print "
"; print "
"; print <<"TAB";
TAB @fields=('cat','title','author','form_data','content'); open(info,"typ.txt"); @cat=; close(info); for ($h=0;$h<@cat;$h++){ print "@cat[$h]"; $typ=@cat[$h]; print "
"; &sub_category($typ); } undef $typ; $tag=0; if($tag eq 1) { print "
"; print "按日期浏览 $typ"; $yy=$year-1; $yy2=$yy-1; print "年"; print ""; print "月"; print "日"; print ""; print "
"; } ######################## else { open (data,"data.txt"); @datas=; close(data); $total=@datas; $row=@datas[$total-1]; @field=split(/\|/,$row); $max=substr(@field[5],4,2); $intmax=int($max); print "
"; print "按期刊浏览 $typ"; $yy=$year-1; print "年"; print ""; #print "期"; print "期"; print ""; print "
"; } ################################ print qq(

); print ""; print ""; open(GUEST,"footer.htm"); @title=; close(GUEST); print "@title"; sub selectindex { local($select_name,$selected)=@_; open(SE,"$select_name.txt"); @sel=; close(SE); undef $result; foreach $info (@sel) { chop($info); if($info eq $selected) { $result.="\n";} else { $result.="\n";} } return $result; } sub showcat { local($txt)=@_; open(SE,"$txt"); @sel=; close(SE); my $j=8; $result=""; for($i=0;$i<@sel;$i=$i+$j){ $result.=""; for($jj=0;$jj<$j;$jj++) { chop(@sel[$i+$jj]); $result.=""; } $result.=""; } $result.="
@sel[$i+$jj]
"; return $result; } sub sub_category { local($typ)=@_; chop($typ); print ""; open (data,"data.txt"); @datas=; close(data); $total=@datas; for ($k=$total-1;$k>-1;$k--){ $row=@datas[$k]; @field=split(/\|/,$row); if(@field[0]=~ m/$typ/) { $kk++; $row=@datas[$k]; $y=substr(@field[3],0,4); $m=substr(@field[3],4,2); $d=substr(@field[3],6,2); print <<"HHH";
  • @field[1] ($y年$m月$d日) HHH } last if($kk gt 5); } print "

    更多内容 >>

    "; print ""; $kk=0; }