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

📄 forums.cgi

📁 一个linux论坛
💻 CGI
📖 第 1 页 / 共 5 页
字号:
    close(FILE);
}
$ontopdata = join("\_",@ontop);
$ontopdata = "\_$ontopdata\_";
$ontopdata =~ s/\W//isg;
$topcount = @ontop;

if ($startarray eq 0) {
    if ($abstopcount > 0) {
        foreach (@absontop) {
	    chomp $_;
      	    if ($_ eq "") { $abstopcount --; next; }
	    my ($tempinforum,$tempintopic) = split (/\|/,$_);
	    my $rr = &readthreadpl($tempinforum,$tempintopic);
	    if ($rr ne "") {
	        (my $lastpostdate, my $topicid, my $topictitle, my $topicdescription, my $threadstate, my $threadposts, my $threadviews, my $startedby, my $startedpostdate, my $lastposter, my $posticon, my $posttemp) = split (/\t/,$rr);
	        if (($dofilter eq "no")||($dofilter eq "all")) {
	            my $temp = &postwordfilter("$topictitle\t$topicdescription\t$posttemp");
	           ($topictitle,$topicdescription,$posttemp) = split(/\t/,$temp);
	        }
	        push (@toptopic, "$topicid\t$tempinforum\t$topictitle\t$topicdescription\t$threadstate\t$threadposts\t$threadviews\t$startedby\t$startedpostdate\t$lastposter\t$lastpostdate\t$posticon\t$posttemp");
	    } else { $abstopcount --;}
        }
    }
    else { undef @toptopic; }

    if ($cattopcount > 0) {
        foreach (@catontop)
        {
                chomp;
                my ($tempinforum, $tempintopic) = split (/\|/, $_);
                if ($_ eq "" || $absontopdata =~ /\_$tempinforum\|$tempintopic\_/)
                {
                        $cattopcount--;
                        next;
                }

                my $rr = &readthreadpl($tempinforum, $tempintopic);
                if ($rr ne "")
                {
                        my ($lastpostdate, $topicid, $topictitle, $topicdescription, $threadstate, $threadposts, $threadviews, $startedby, $startedpostdate, $lastposter, $posticon, $posttemp) = split (/\t/, $rr);
                        if ($dofilter eq "no" || $dofilter eq "all")
                        {
                                my $temp = &postwordfilter("$topictitle\t$topicdescription\t$posttemp");
                                ($topictitle, $topicdescription, $posttemp) = split(/\t/, $temp);
                        }
                        push(@toptopic, "$topicid\t$tempinforum\t$topictitle\t$topicdescription\t$threadstate\t$threadposts\t$threadviews\t$startedby\t$startedpostdate\t$lastposter\t$lastpostdate\t$posticon\t$posttemp");
                }
                else
                {
                        $cattopcount--;
                }
        }
    }
    else { undef @toptopic if ($abstopcount <= 0); }

    if ($topcount > 0) {
        foreach (@ontop) {
	    chomp $_;
      	    if ($_ eq "") { $topcount --; next; }
            if ($absontopdata =~ /\_$inforum\|$_\_/) { $topcount --; next; }
            if ($catontopdata =~ /\_$inforum\|$_\_/) { $topcount --; next; }
	    my $rr = &readthreadpl($inforum,$_);
	    if ($rr ne "") {
	        (my $lastpostdate, my $topicid, my $topictitle, my $topicdescription, my $threadstate, my $threadposts, my $threadviews, my $startedby, my $startedpostdate, my $lastposter, my $posticon, my $posttemp) = split (/\t/,$rr);
	        if (($dofilter eq "no")||($dofilter eq "all")) {
	            my $temp = &postwordfilter("$topictitle\t$topicdescription\t$posttemp");
	           ($topictitle,$topicdescription,$posttemp) = split(/\t/,$temp);
	        }
	        push (@toptopic, "$topicid\t$inforum\t$topictitle\t$topicdescription\t$threadstate\t$threadposts\t$threadviews\t$startedby\t$startedpostdate\t$lastposter\t$lastpostdate\t$posticon\t$posttemp");
	    } else { $topcount --;}
        }
    }
    else { undef @toptopic if ($abstopcount + $cattopcount <= 0); }
}
else { undef @toptopic; }

foreach (@topics[$startarray ... $endarray]) {
    chomp $_;
    ($topicid, $topictitle, $topicdescription, $threadstate, $threadposts, $threadviews, $startedby, $startedpostdate, $lastposter, $lastpostdate, $posticon, $posttemp) = split(/\t/,$_);
    next if (($topicid eq "")||($topicid !~ /^[0-9]+$/));
    next if ($ontopdata =~ /\_$topicid\_/);
    next if ($absontopdata =~ /\_$inforum\|$topicid\_/);
    next if ($catontopdata =~ /\_$inforum\|$topicid\_/);
    if (($topictitle eq "")||($startedby eq "")||($startedpostdate eq "")||($threadposts eq "")) {
	my $rr = &readthreadpl($inforum,$topicid);
	if ($rr ne "") {
	    ($lastpostdate, my $topicid, $topictitle, $topicdescription, $threadstate, $threadposts, $threadviews, $startedby, $startedpostdate, $lastposter, $posticon, $posttemp) = split (/\t/,$rr);
	}
	else { next;}
    }
    if (($dofilter eq "no")||($dofilter eq "all")) {
	my $temp = &postwordfilter("$topictitle\t$topicdescription\t$posttemp");
	($topictitle,$topicdescription,$posttemp) = split(/\t/,$temp);
    }
    push (@toptopic, "$topicid\t$inforum\t$topictitle\t$topicdescription\t$threadstate\t$threadposts\t$threadviews\t$startedby\t$startedpostdate\t$lastposter\t$lastpostdate\t$posticon\t$posttemp\n");
}
undef @topics; undef $ontopdata; undef $absontopdata; undef $catontopdata;

opendir (DIR, "${imagesdir}usr/$inforum");
my @usruploadfile = readdir(DIR);
closedir (DIR);


$topiccount = 0;
foreach $topic (@toptopic) {
    $pagestoshow = undef;
    $threadpages = undef;
    chomp $topic;
    ($topicid, $forumid, $topictitle, $topicdescription, $threadstate, $threadposts, $threadviews, $startedby, $startedpostdate, $lastposter, $lastpostdate, $posticon, $posttemp) = split(/\t/,$topic);

    if ($forumid eq $inforum) {
        my @usruploadfile = grep(/^$inforum\_$topicid/,@usruploadfile);
        if ($jhdata =~ /\_$topicid\_/) {
	    $jhimage  = qq~ <img src=$imagesurl/images/$new_JH align=absmiddle alt=精华帖子>~;
	    $jhbuttom = qq~<a href=jinghua.cgi?action=del&forum=$inforum&topic=$topicid><font color=$titlecolor>取消精华</font></a>|~;
        } else { undef $jhimage; $jhbuttom = qq~<a href=jinghua.cgi?action=add&forum=$inforum&topic=$topicid><font color=$titlecolor>精</font></a>|~; }
    }
    
    if ($membercode eq "ad") {
        $abslockbuttom = "<a href=postings.cgi?action=abslocktop&forum=$inforum&topic=$topicid><font color=$titlecolor>总固</font></a>|";
    }
    else { undef $abslockbuttom; }
    
    $catlockbuttom = $membercode eq "ad" || $membercode eq "smo" || ",$catemods," =~ /\,$inmembername\,/i ? "<a href=postings.cgi?action=catlocktop&forum=$inforum&topic=$topicid><font color=$titlecolor>区固</font></a>|" : "";

    if (($posticon eq "")||($posticon =~/<br>/i)) {
        $posticon = int(rand(23));
    	$posticon = "0$posticon" if ($posticon<10);
	$posticon = qq~<img src=$imagesurl/posticons/$posticon.gif border=0 align=absmiddle>~;
    }
    else{
        $posticon = qq~<img src=$imagesurl/posticons/$posticon border=0 align=absmiddle>~;
    }

    $numberofitems = $threadposts + 1;
    $numberofpages = $numberofitems / 12;
    $counter = 0;
    $hasshow=0;
    if ($numberofitems > 12) {
        if ($numberofpages>int($numberofpages)){ $numberofpages = int($numberofpages)+1 ;}
	$pagestart = 0;
	while ($numberofpages > $counter) {
	    $counter++;
	    if (($numberofpages <= 11)||($counter<5)||($counter>$numberofpages-4)){
		$threadpages .= qq~<a href=topic.cgi?forum=$forumid&topic=$topicid&start=$pagestart&show=$inshow class=ha>$counter</a> ~;
	    }
	    elsif ($hasshow eq 0) {
		$threadpages .="\. \. \. ";
		$hasshow = 1;
	    }
	    $pagestart = $pagestart + 12;
	}
	$pagestart   = $pagestart - 12;
        $gotoendpost = "$pagestart";
        $pagestoshow = qq~<font color=$forumfontcolor>  [第 $threadpages 页]</font>~;
    }
    else {
        $gotoendpost = "0";
    }

    if ($inthreadages && ($inthreadages ne "all")&&(($topiccount >= $topcount + $abstopcount + $cattopcount)||($startarray ne 0))) {
	$threadagelimit = $currenttime - $inthreadages * 86400;
	if ($lastpostdate < $threadagelimit) { last; }
    }
    if (!$forumlastvisit) { $forumlastvisit = "0"; }

    if ($startedpostdate > $currenttime - 3600 * $newmarktime) { $topnew = " <img src=$imagesurl/images/$new_blogo absmiddle>";$addonlength +=2; } else { $topnew = ""; }

    if ((lc($inmembername) eq lc($startedby))&&($nodispown eq "yes")){ $mypost="<img src=$imagesurl/images/$mypost_blogo title=我发表的主题> "}else {$mypost=""};

    $topicicon = "<img src=$imagesurl/images/topicnonew.gif width=14 border=0>";

    if (($threadposts >= 20) && ($forumlastvisit < $lastpostdate) && ($inmembername ne "客人")) { $topicicon = "<img src=$imagesurl/images/topichot0.gif width=14 border=0>"; }
    elsif (($threadposts >= 20) && ($forumlastvisit > $lastpostdate) && ($inmembername ne "客人")) { $topicicon = "<img src=$imagesurl/images/topichotnonew.gif width=14 border=0>"; }
    elsif (($threadposts <  20) && ($forumlastvisit < $lastpostdate) && ($inmembername ne "客人")) { $topicicon = "<img src=$imagesurl/images/topicnew0.gif width=14 border=0>"; }
    elsif (($threadposts <  20) && ($forumlastvisit > $lastpostdate) && ($inmembername ne "客人")) { $topicicon = "<img src=$imagesurl/images/topicnonew.gif width=14 border=0>"; }

    $threadstate = "poll" if (($posticon =~/<br>/i)&&($threadstate eq ""));
    if (($threadstate eq "poll")||($threadstate eq "pollclosed")) {
       	$size = 0;
	if (open(FILE, "${lbdir}forum$forumid/$topicid.poll.cgi")) {
	    my @allpoll = <FILE>;
            close(FILE);
	    $size = @allpoll;
        }
    }
    if ($threadstate eq "closed") { $topicicon = "<img src=$imagesurl/images/topiclocked0.gif width=14 border=0>"; }
    elsif ($threadstate eq "poll") {
        if ($size >= 18) { $topicicon = "<img src=$imagesurl/images/closedbhot.gif width=13 border=0>"; }
	                      else { $topicicon = "<img src=$imagesurl/images/closedb.gif width=13 border=0>"; }
    }
    elsif ($threadstate eq "pollclosed") { $topicicon = "<img src=$imagesurl/images/closedb1.gif width=13 border=0>"; }

    if ($lastpostdate ne "") {
	$lastpostdate = $lastpostdate + $addtimes;
	$longdate = &dateformatshort("$lastpostdate");
	$lastpostdate = qq~$longdate~;
    }
    else { $lastpostdate = qq~没有~; }
    
    $startedpostdate  = $startedpostdate + $addtimes;
    $startedlongdate  = &dateformat("$startedpostdate");
    $startedpostdate  = qq~$startedlongdate~;
    if (($screenmode >=7)||($tablewidth > 770)) { $topictitlemax = 71; } else {$topictitlemax = 40;}

⌨️ 快捷键说明

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