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

📄 postings.cgi

📁 一个linux论坛
💻 CGI
📖 第 1 页 / 共 3 页
字号:

    if (($cleartoedit eq "yes") && ($checked eq "yes")) {
        my $truenumber = rebuildLIST(-Forum=>"$inforum");
        ($tpost,$treply) = split (/\|/,$truenumber);

        $filetoopen = "$lbdir" . "data/allforums.cgi";
        $filetoopen1 = "$lbdir" . "boarddata/list$inforum.cgi";
        my $filetoopens1 = &lockfilename($filetoopen);
        my $filetoopens2 = &lockfilename($filetoopen1);
        if ((!(-e "$filetoopens1.lck"))&&(!(-e "$filetoopens2.lck"))) {
            $filetoopen = "$lbdir" . "boarddata/list$inforum.cgi";
            &winlock($filetoopen) if (($OS_USED eq "Unix")||($OS_USED eq "Nt"));
            open(FILE, "$filetoopen");
            flock(FILE, 1) if ($OS_USED eq "Unix");
            $linetokeep = <FILE>;
            close(FILE);
            &winunlock($filetoopen) if (($OS_USED eq "Unix")||($OS_USED eq "Nt"));
            chomp $linetokeep;
            ($topicid, $topictitle, $trash, $trash, $trash, $trash, $lastforumposter1, $trash, $lastforumposter, $lastforumpostdate) = split(/\t/,$linetokeep);
 	    $topictitle =~ s/^*#!&*//;

            $filetoopen = "${lbdir}data/allforums.cgi";
	    if ($#forums >= 0) {
                &winlock($filetoopen) if (($OS_USED eq "Unix")||($OS_USED eq "Nt"));
                if (open(FILE, ">$filetoopen")) {
                    flock(FILE, 2) if ($OS_USED eq "Unix");
                    foreach $forum (@forums) {
                        chomp $forum;
                        (my $tempno, my $trash) = split(/\t/,$forum);
    	                next if ($tempno !~ /^[0-9]+$/);
                        if ($inforum eq $tempno) {
                            ($forumid, $category, $categoryplace, $forumname, $forumdescription, $forummoderator ,$htmlstate ,$idmbcodestate ,$privateforum, $startnewthreads ,$lastposter ,$lastposttime, $threads, $posts, $forumgraphic, $ratings, $misc,$forumpass,$hiddenforum,$indexforum,$teamlogo,$teamurl, $fgwidth, $fgheight, $miscadd3, $miscadd4, $miscad5) = split(/\t/,$forum);
                            $lastforumposter = $lastforumposter1 if ($lastforumposter eq "");
                            $lastforumpostdate = "$lastforumpostdate\%\%\%$topicid\%\%\%$topictitle";
                            print FILE "$forumid\t$category\t$categoryplace\t$forumname\t$forumdescription\t$forummoderator\t$htmlstate\t$idmbcodestate\t$privateforum\t$startnewthreads\t$lastforumposter\t$lastforumpostdate\t$tpost\t$treply\t$forumgraphic\t$ratings\t$misc\t$forumpass\t$hiddenforum\t$indexforum\t$teamlogo\t$teamurl\t$fgwidth\t$fgheight\t$miscadd3\t$miscadd4\t$miscad5\t\n";
                        }
                        else { print FILE "$forum\n"; }
                    }
                    close(FILE);
                }
                &winunlock($filetoopen) if (($OS_USED eq "Unix")||($OS_USED eq "Nt"));
            }
        }
        $output .= qq~<table cellpadding=0 cellspacing=0 border=0 width=$tablewidth bgcolor=$tablebordercolor align=center>
<tr><td><table cellpadding=6 cellspacing=1 border=0 width=100%>
<tr><td bgcolor=$miscbacktwo align=center><font color=$fontcolormisc><b>论坛修复成功</b></font></td></tr>
<tr><td bgcolor=$miscbackone><font color=$fontcolormisc>
具体情况:<ul><li><a href="forums.cgi?forum=$inforum">返回论坛</a><li><a href="leoboard.cgi">返回论坛首页</a></ul></tr></td>
</table></td></tr></table>
<meta http-equiv="refresh" content="3; url=forums.cgi?forum=$inforum">
~;
    } else {
        $inmembername =~ s/\_/ /g;
        $output .= qq~<table cellpadding=0 cellspacing=0 border=0 width=$tablewidth bgcolor=$tablebordercolor align=center>
<tr><td><table cellpadding=6 cellspacing=1 border=0 width=100%>
<tr><td bgcolor=$miscbacktwo colspan=2 align=center>
<form action="$thisprog" method="post">
<input type=hidden name="action" value="repireforum">
<input type=hidden name="checked" value="yes">
<input type=hidden name="forum" value="$inforum">
<input type=hidden name="topic" value="$intopic">
<font color=$fontcolormisc><b>请输入您的用户名、密码进入版主模式 [论坛修复]</b></font></td></tr>
<tr><td bgcolor=$miscbackone><font color=$fontcolormisc>请输入您的用户名</font></td>
<td bgcolor=$miscbackone><input type=text name="membername" value="$inmembername"></td></tr>
<tr><td bgcolor=$miscbackone><font color=$fontcolormisc>请输入您的密码</font></td>
<td bgcolor=$miscbackone><input type=password name="password" value="$inpassword"> &nbsp; <font color=$fontcolormisc><a href="profile.cgi?action=lostpass" style="cursor:help">忘记密码?</a></font></td></tr>
<tr><td bgcolor=$miscbacktwo colspan=2 align=center><input type=submit name="submit" value="登 陆"></td></form></tr></table></td></tr></table>
</table></td></tr></table>
~;
    }
}

sub puttop {
    &mischeader("主题提升");

    $cleartoedit = "no";
    if (($membercode eq "ad")  && ($inpassword eq $password)) { $cleartoedit = "yes"; }
    if (($membercode eq 'smo') && ($inpassword eq $password)) { $cleartoedit  = "yes"; }
    if (($inmembmod eq "yes")  && ($inpassword eq $password)) { $cleartoedit = "yes"; }
    unless ($cleartoedit eq "yes") { $cleartoedit = "no"; }
    if ($cleartoedit eq "no" && $checked eq "yes") { &error("主题提升&您不是本论坛坛主或版主,或者您的密码错误!"); }

    if (($cleartoedit eq "yes") && ($checked eq "yes")) {
        my $file = "${lbdir}forum$inforum/$intopic.pl";
        open (ENT, $file);
        $in = <ENT>;
        close (ENT);
        chomp $in;
        ($topicid, $topictitle, $topicdescription, $threadstate, $threadposts ,$threadviews, $startedby, $startedpostdate, $lastposter, $lastpostdate,$inposticon,$inposttemp) = split(/\t/,$in);
 	$topictitle =~ s/^*#!&*//;

        if (open(FILE, ">$file")) {
            print FILE "$intopic\t$topictitle\t$topicdescription\t$threadstate\t$threadposts\t$threadviews\t$startedby\t$startedpostdate\t$lastposter\t$currenttime\t$inposticon\t$inposttemp\t";
            close(FILE);
        }

        $file = "$lbdir" . "boarddata/list$inforum.cgi";
        &winlock($file) if (($OS_USED eq "Unix")||($OS_USED eq "Nt"));
        open (LIST, "$file");
        flock (LIST, 1) if ($OS_USED eq "Unix");
        @listall=<LIST>;
        close (LIST);

        if ($#listall >= 200) {
            if (open (LIST, ">$file")) {
        	flock (LIST, 2) if ($OS_USED eq "Unix");
                print LIST "$intopic\t$topictitle\t$topicdescription\t$threadstate\t$threadposts\t$threadviews\t$startedby\t$startedpostdate\t$lastposter\t$currenttime\t$inposticon\t$inposttemp\t\n";
		foreach (@listall) {
		    chomp $_;
                    ($listone,$noneed) = split(/\t/,$_);
	            next if ($listone !~ /^[0-9]+$/);
                    print LIST "$_\n" if ($listone ne $intopic);
                }
                close (LIST);
            }
            &winunlock($file) if (($OS_USED eq "Unix")||($OS_USED eq "Nt"));
        }
        else {
            &winunlock($file) if (($OS_USED eq "Unix")||($OS_USED eq "Nt"));
            rebuildLIST(-Forum=>"$inforum");
        }

        $filetoopen = "$lbdir" . "data/allforums.cgi";
        $filetoopens1 = &lockfilename($filetoopen);
        if (!(-e "$filetoopens1.lck")) {
	    if ($#forums >= 0) {
                &winlock($filetoopen) if (($OS_USED eq "Unix")||($OS_USED eq "Nt"));
                if (open(FILE, ">$filetoopen")) {
                    flock(FILE, 2) if ($OS_USED eq "Unix");
                    foreach $forum (@forums) {
                        chomp $forum;
                        next if ($forum eq "");
                        (my $tempno, my $trash) = split(/\t/,$forum);
    	                next if ($tempno !~ /^[0-9]+$/);
                        if ($inforum eq $tempno) {
                            ($forumid, $category, $categoryplace, $forumname, $forumdescription, $forummoderator ,$htmlstate ,$idmbcodestate ,$privateforum, $startnewthreads ,$no ,$lastposttime, $threads, $posts, $forumgraphic, $ratings, $misc,$forumpass,$hiddenforum,$indexforum,$teamlogo,$teamurl, $fgwidth, $fgheight, $miscadd3, $miscadd4, $miscad5) = split(/\t/,$forum);
                            $lastposter = $startedby if ($lastposter eq "");
                            $lastforumpostdate = "$currenttime\%\%\%$intopic\%\%\%$topictitle";
                            print FILE "$forumid\t$category\t$categoryplace\t$forumname\t$forumdescription\t$forummoderator\t$htmlstate\t$idmbcodestate\t$privateforum\t$startnewthreads\t$lastposter\t$lastforumpostdate\t$threads\t$posts\t$forumgraphic\t$ratings\t$misc\t$forumpass\t$hiddenforum\t$indexforum\t$teamlogo\t$teamurl\t$fgwidth\t$fgheight\t$miscadd3\t$miscadd4\t$miscad5\t\n";
                        }
                        else { print FILE "$forum\n"; }
                    }
                    close(FILE);
                }
                &winunlock($filetoopen) if (($OS_USED eq "Unix")||($OS_USED eq "Nt"));
            }
        }
        $output .= qq~<table cellpadding=0 cellspacing=0 border=0 width=$tablewidth bgcolor=$tablebordercolor align=center>
<tr><td><table cellpadding=6 cellspacing=1 border=0 width=100%>
<tr><td bgcolor=$miscbacktwo align=center><font color=$fontcolormisc><b>主题提升成功</b></font></td></tr>
<tr><td bgcolor=$miscbackone><font color=$fontcolormisc>
具体情况:<ul><li><a href="forums.cgi?forum=$inforum">返回论坛</a><li><a href="leoboard.cgi">返回论坛首页</a></ul></tr></td>
</table></td></tr></table>
<meta http-equiv="refresh" content="3; url=forums.cgi?forum=$inforum">
~;
    } else {
        $inmembername =~ s/\_/ /g;
        $output .= qq~<table cellpadding=0 cellspacing=0 border=0 width=$tablewidth bgcolor=$tablebordercolor align=center>
<tr><td><table cellpadding=6 cellspacing=1 border=0 width=100%>
<tr><td bgcolor=$miscbacktwo colspan=2 align=center>
<form action="$thisprog" method="post">
<input type=hidden name="action" value="puttop">
<input type=hidden name="checked" value="yes">
<input type=hidden name="forum" value="$inforum">
<input type=hidden name="topic" value="$intopic">
<font color=$fontcolormisc><b>请输入您的用户名、密码进入版主模式 [主题提升]</b></font></td></tr>
<tr><td bgcolor=$miscbackone><font color=$fontcolormisc>请输入您的用户名</font></td>
<td bgcolor=$miscbackone><input type=text name="membername" value="$inmembername"></td></tr>
<tr><td bgcolor=$miscbackone><font color=$fontcolormisc>请输入您的密码</font></td>
<td bgcolor=$miscbackone><input type=password name="password" value="$inpassword"> &nbsp; <font color=$fontcolormisc><a href="profile.cgi?action=lostpass" style="cursor:help">忘记密码?</a></font></td></tr>
<tr><td bgcolor=$miscbacktwo colspan=2 align=center><input type=submit name="submit" value="登 陆"></td></form></tr></table></td></tr></table>
</table></td></tr></table>
~;
    }
}

sub locktop {
    &mischeader("主题固定");

    $cleartoedit = "no";
    if (($membercode eq "ad") && ($inpassword eq $password)) { $cleartoedit = "yes"; }
    if(($membercode eq 'smo') && ($inpassword eq $password)) { $cleartoedit = "yes";}
    if (($inmembmod eq "yes") && ($inpassword eq $password)) { $cleartoedit = "yes"; }
    unless ($cleartoedit eq "yes") { $cleartoedit = "no"; }

    if ($cleartoedit eq "no" && $checked eq "yes") { &error("主题固定首行&您不是本论坛坛主或版主,或者您的密码错误!"); }
    if (($cleartoedit eq "yes") && ($checked eq "yes")) {
        my $file = "$lbdir" . "boarddata/ontop$inforum.cgi";
        if (open (TOPFILE, $file)) {
            @toptopic = <TOPFILE>;
            close (TOPFILE);
            if (open (TOPFILE, ">$file")) {
                print TOPFILE "$intopic\n";
	        $putno = 1;
	        foreach (@toptopic) {
	            chomp $_;
	            if ($_ ne $intopic) {
	    	        print TOPFILE "$_\n";
	    	        $putno ++;
	            }
	            last if ($putno eq 5);
	        }
                close (TOPFILE);
            }
        } else {
            if (open (TOPFILE, ">$file")) {
                print TOPFILE "$intopic\n";
                close (TOPFILE);
            }
        }
        $output .= qq~<table cellpadding=0 cellspacing=0 border=0 width=$tablewidth bgcolor=$tablebordercolor align=center>
<tr><td><table cellpadding=6 cellspacing=1 border=0 width=100%>
<tr><td bgcolor=$miscbacktwo align=center><font color=$fontcolormisc><b>主题固定首行成功</b></font></td></tr>
<tr><td bgcolor=$miscbackone><font color=$fontcolormisc>
具体情况:<ul><li><a href="forums.cgi?forum=$inforum">返回论坛</a><li><a href="leoboard.cgi">返回论坛首页</a></ul></tr></td>
</table></td></tr></table>
<meta http-equiv="refresh" content="3; url=forums.cgi?forum=$inforum">
~;
    } else {
        if (open (TOPFILE, "${lbdir}boarddata/ontop$inforum.cgi")) {
            @toptopic = <TOPFILE>;
            close (TOPFILE);
	}
	$toptopic = @toptopic;
	if ($toptopic >= 5) { $topnum = "<BR><B><font color=$fonthighlight>已经固定了 $toptopic 个帖子了,如果继续,最早一个被固定的帖子将被自动取消固定。</B></font>" } else { $topnum = "<BR><B><font color=$fonthighlight>已经固定了 $toptopic 个帖子了,你最多可以固定 5 个帖子。</B></font>"; }
        $inmembername =~ s/\_/ /g;
        $output .= qq~<table cellpadding=0 cellspacing=0 border=0 width=$tablewidth bgcolor=$tablebordercolor align=center>
<tr><td><table cellpadding=6 cellspacing=1 border=0 width=100%>
<tr><td bgcolor=$miscbacktwo colspan=2 align=center>
<form action="$thisprog" method="post">
<input type=hidden name="action" value="locktop">
<input type=hidden name="checked" value="yes">
<input type=hidden name="forum" value="$inforum">
<input type=hidden name="topic" value="$intopic">
<font color=$fontcolormisc><b>请输入您的用户名、密码进入版主模式 [主题固定首行]</b></font>$topnum</td></tr>
<tr><td bgcolor=$miscbackone><font color=$fontcolormisc>请输入您的用户名</font></td>
<td bgcolor=$miscbackone><input type=text name="membername" value="$inmembername"></td></tr>
<tr><td bgcolor=$miscbackone><font color=$fontcolormisc>请输入您的密码</font></td>
<td bgcolor=$miscbackone><input type=password name="password" value="$inpassword"> &nbsp; <font color=$fontcolormisc><a href="profile.cgi?action=lostpass" style="cursor:help">忘记密码?</a></font></td></tr>
<tr><td bgcolor=$miscbacktwo colspan=2 align=center><input type=submit name="submit" value="登 陆"></td></form></tr></table></td></tr></table>
</table></td></tr></table>
~;

    }
}

sub unlocktop {
    &mischeader("主题取消固定");

    $cleartoedit = "no";
    if (($membercode eq "ad") && ($inpassword eq $password)) { $cleartoedit = "yes"; }
    if(($membercode eq 'smo') && ($inpassword eq $password)) {$cleartoedit = "yes";}
    if (($inmembmod eq "yes") && ($inpassword eq $password)) { $cleartoedit = "yes"; }
    unless ($cleartoedit eq "yes") { $cleartoedit = "no"; }
    if ($cleartoedit eq "no" && $checked eq "yes") { &error("主题取消固定&您不是本论坛坛主或版主,或者您的密码错误!"); }

    if (($cleartoedit eq "yes") && ($checked eq "yes")) {
        my $file = "${lbdir}boarddata/ontop$inforum.cgi";
        if (open (TOPFILE, $file)) {
            @toptopic = <TOPFILE>;
            close (TOPFILE);

            if (open (TOPFILE, ">$file")) {
                foreach (@toptopic) {
                    chomp $_;
                    if ($_ ne $intopic) {
	    	        print TOPFILE "$_\n";
	            }
	        }
                close (TOPFILE);
            }
        }
        $output .= qq~<table cellpadding=0 cellspacing=0 border=0 width=$tablewidth bgcolor=$tablebordercolor align=center>
<tr><td><table cellpadding=6 cellspacing=1 border=0 width=100%>
<tr><td bgcolor=$miscbacktwo align=center><font color=$fontcolormisc><b>主题取消固定成功</b></font></td></tr>
<tr><td bgcolor=$miscbackone><font color=$fontcolormisc>

⌨️ 快捷键说明

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