BigMurzik
Местный кот | Редактировать | Профиль | Сообщение | ICQ | Цитировать | Сообщить модератору D_P_A_K_O_H ага есть глюк, у меня щаз тока не закрывает автоматом, а премещать - перемещает, вобщем там мне pechalny помог. вобщем так, открываешь postings.cgi и ищещ Код: далее все что ниже, до Код: меняешь на Код: sub movetopic { &getmember("$inmembername"); &moderator; $cleartomove = "no"; &mischeader("$ibtxt{'1501'}"); if (($membercode eq "ad") && ($inpassword eq $password)) { $cleartomove = "yes"; } if (($inmembmod eq "yes") && ($inpassword eq $password)) { $cleartomove = "yes"; } unless ($cleartomove eq "yes") { $cleartomove = "no"; } if ($cleartomove eq "no" && $checked eq "yes") { &error("$ibtxt{'1502'}&$ibtxt{'0504'}"); } if (($cleartomove eq "yes") && ($checked eq "yes") && ($movetoid)) { ### Get a new thread number. $dirtoopen = "$ikondir" . "forum$movetoid"; opendir (DIR, "$dirtoopen"); @numberdata = readdir(DIR); closedir (DIR); if ($movetoid == $inforum) { &error("$ibtxt{'1502'}&$ibtxt{'1506'} \!"); } @sorteddirdata = grep(/thd/,@numberdata); @sorteddirdata = sort numerically(@sorteddirdata); @sorteddirdata = reverse(@sorteddirdata); $highestno = @sorteddirdata[0]; $highestno =~ s/.thd//; $newthreadnumber = $highestno + 1; $currenttime = time; ### Get the old forum name $filetoopen = "$ikondir" . "data/allforums.cgi"; open(FILE, "$filetoopen"); flock FILE, 1; @forums = <FILE>; close(FILE); foreach $forumline (@forums) { #start foreach @forums ($tempno, $trash) = split(/\|/,$forumline); if ($inforum eq $tempno) { ($trash, $trash, $trash, $oldforumname, $trash) = split(/\|/,$forumline); } } ### Get the new forum name foreach $forumline (@forums) { #start foreach @forums ($tempno, $trash) = split(/\|/,$forumline); if ($movetoid eq $tempno) { ($trash, $trash, $trash, $newforumname, $trash) = split(/\|/,$forumline); } } unless ($inleavemessage eq "no") { $inpost = qq~#Moderation Mode<p>$inpost<p><a href="$boardurl/$threadprog?forum=$movetoid&topic=$newthreadnumber" target="_self">$ibtxt{'1510'}</a>~; $filetoopen = "$ikondir" . "forum$inforum/$intopic.thd"; open(FILE, "$filetoopen"); @allmessages = <FILE>; close(FILE); ##poll start $filetoopen = "$ikondir" . "forum$inforum/$intopic.vote"; $filetoopen = &stripMETA($filetoopen); if (-e $filetoopen) { $vfe = "1"; open(FILE, "$filetoopen"); @allvoters = <FILE>; close(FILE); } else { $vfe = "0" } $filetoopen = "$ikondir" . "forum$inforum/$intopic.poll"; if (-e $filetoopen) { $pfe = "1"; open(FILE1,"$filetoopen"); @pollfile = <FILE1>; close(FILE1); } else { $pfe = "0" } ##poll end $linetokeep = @allmessages[0]; chomp $linetokeep; ($trash, $topictitle, $trash) = split(/\|/,$linetokeep); foreach $messages (@allmessages) { chomp $messages; $processed_data .= "$messages\n"; } $processed_data .= "$inmembername|$topictitle|Moderation Mode|yes|yes|$currenttime|$inpost"; $filetomake = "$ikondir" . "forum$inforum/$intopic.thd"; open(FILE, ">$filetomake"); flock(FILE, 2); print FILE $processed_data; close(FILE); undef $processed_data; $threadposts = @allmessages; my $file = "$ikondir" . "forum$inforum/$intopic.pl"; open (ENT, $file); flock ENT, 1; $in = <ENT>; close (ENT); ($topicid, $topictitle, $topicdescription, $threadstate, $threadposts ,$threadviews, $startedby, $startedpostdate, $lastposter, $lastpostdate) = split(/\|/,$in); open(FILE, ">$file"); flock(FILE, 2); $threadposts++; print FILE "$intopic|$topictitle|$topicdescription|closed|$threadposts|$threadviews|$startedby|$startedpostdate|$lastposter|$lastpostdate"; close(FILE); } # end if inleavemessage eq yes my $file = "$ikondir" . "forum$inforum/$intopic.pl"; open (ENT, $file); flock ENT, 1; $in = <ENT>; close (ENT); ($topicid, $topictitle, $topicdescription, $threadstate, $threadposts ,$threadviews, $startedby, $startedpostdate, $lastposter, $lastpostdate) = split(/\|/,$in); my $file = "$ikondir" . "forum$movetoid/$newthreadnumber.pl"; open(FILE, ">$file"); flock(FILE, 2); print FILE "$newthreadnumber|$topictitle|$topicdescription|open|$threadposts|$threadviews|$startedby|$startedpostdate|$lastposter|$lastpostdate"; close(FILE); ### Pick up old forum messages $filetoopen = "$ikondir" . "forum$inforum/$intopic.thd"; open(FILE, "$filetoopen"); @oldforummessages = <FILE>; close(FILE); $oldthreadposts = @oldforummessages - 1; ### Print to new forum message file foreach $message (@oldforummessages) { chomp $message; $processed_data .= "$message\n"; } $filetomake = "$ikondir" . "forum$movetoid/$newthreadnumber.thd"; open(FILE, ">$filetomake"); flock(FILE, 2); print FILE $processed_data; close(FILE); undef $processed_data; ##poll start ?? if ($vfe eq "1") { $filetomake = "$ikondir" . "forum$movetoid/$newthreadnumber.vote"; $filetomake = &stripMETA($filetomake); open(FILE, ">$filetomake"); flock(FILE, 2); foreach $voters (@allvoters) { chomp $voters; print FILE "$voters\n"; } close(FILE); } if ($pfe eq "1") { $filetomake = "$ikondir" . "forum$movetoid/$newthreadnumber.poll"; $filetomake = &stripMETA($filetomake); open(FILE, ">$filetomake"); flock(FILE, 2); print FILE "@pollfile"; close(FILE); } ##poll end ### Update the post counts and lastposter details. $filetoopen = "$ikondir" . "data/allforums.cgi"; open(FILE, "$filetoopen"); flock FILE, 1; @allforums = <FILE>; close(FILE); foreach $forum (@allforums) { #start foreach @forums chomp($forum); ($tempno, $trash) = split(/\|/,$forum); if ($inforum eq $tempno) { ($forumid, $category, $categoryplace, $forumname, $forumdescription, $forummoderator ,$htmlstate ,$idmbcodestate ,$privateforum, $startnewthreads ,$lastposter ,$lastposttime, $threads, $posts, $forumgraphic, $pollstate) = split(/\|/,$forum); if ($inleavemessage eq "no") { $threads--; } $currenttime = time; $posts = $posts - $threadposts; $posts++; $processed_data .= "$forumid|$category|$categoryplace|$forumname|$forumdescription|$forummoderator|$htmlstate|$idmbcodestate|$privateforum|$startnewthreads|$lastposter|$lastposttime|$threads|$posts|$forumgraphic|$pollstate\n"; } elsif ($movetoid eq $tempno) { ($forumid, $category, $categoryplace, $forumname, $forumdescription, $forummoderator ,$htmlstate ,$idmbcodestate ,$privateforum, $startnewthreads ,$lastposter ,$lastposttime, $threads, $posts, $forumgraphic, $pollstate) = split(/\|/,$forum); $threads++; $posts = $posts + $threadposts; $posts--; $processed_data .= "$forumid|$category|$categoryplace|$forumname|$forumdescription|$forummoderator|$htmlstate|$idmbcodestate|$privateforum|$startnewthreads|$lastposter|$lastposttime|$threads|$posts|$forumgraphic|$pollstate\n"; } else { $processed_data .= "$forum\n"; } } if (($processed_data eq "") || ($processed_data !~ m!\|!)) { &error("Missing Data&Data as corrupted on the server. Please go back and try again"); } $filetomake = "$ikondir" . "data/allforums.cgi"; open(FILE, ">$filetomake"); flock(FILE, 2); print FILE $processed_data; close(FILE); undef $processed_data; if ($inleavemessage ne "yes") { ### Delete the old listings first delete the old thread file $filetounlink = "$ikondir" . "forum$inforum/$intopic.thd"; unlink $filetounlink; ##poll start $filetounlink = "$ikondir" . "forum$inforum/$intopic.vote"; unlink $filetounlink; $filetounlink = "$ikondir" . "forum$inforum/$intopic.poll"; unlink $filetounlink; ##poll end ### Now we have to trash it from the list.cgi $filetounlink = "$ikondir" . "forum$inforum/$intopic.pl"; unlink $filetounlink; } # end unless statement rebuildLIST(-Forum=>"$inforum"); rebuildLIST(-Forum=>"$movetoid"); $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 valign=middle align=center><font face="$font" color=$fontcolormisc size=$dfontsize2><b>$ibtxt{'1503'}</b></font></td></tr> <tr> <td bgcolor=$miscbackone valign=middle><font face="$font" color=$fontcolormisc size=$dfontsize1> $ibtxt{'1004'}: <ul> <li><a href="$forumsprog?forum=$inforum">$ibtxt{'1504'}</a> <li><a href="$forumsprog?forum=$movetoid">$ibtxt{'1505'}</a> <li><a href="$forumsummaryprog">$ibtxt{'0323'}</a> </ul> </tr> </td> </table></td></tr></table> ~; $checked = "no"; } # end clear to move if else { $filetoopen = "$ikondir" . "data/allforums.cgi"; open(FILE, "$filetoopen"); flock FILE, 1; @forums = <FILE>; close(FILE); $jumphtml .= "<option value=\"\">$ibtxt{'1507'}\n"; foreach $forum (@forums) { #start foreach @forums chomp $forum; ($movetoforumid, $category, $categoryplace, $forumname, $forumdescription) = split(/\|/,$forum); $rearrange = ("$categoryplace|$category|$forumname|$forumdescription|$movetoforumid"); push (@rearrangedforums, $rearrange); } # end foreach (@forums) @finalsortedforums = sort numerically(@rearrangedforums); foreach $sortedforums (@finalsortedforums) { #start foreach ($categoryplace, $category, $forumname, $forumdescription, $movetoforumid) = split(/\|/,$sortedforums); if ($categoryplace ne $lastcategoryplace) { #start if $categoryplace $jumphtml .= "<option value=\"\">\n"; $jumphtml .= "<option value=\"\">-- $category\n"; $jumphtml .= "<option value=\"$movetoforumid\"> $forumname\n"; } else { $jumphtml .= "<option value=\"$movetoforumid\"> $forumname\n"; } $lastcategoryplace = $categoryplace; } # end foreach $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%> <form action="$thisprog" method="post"> <input type=hidden name="action" value="movetopic"> <input type=hidden name="checked" value="yes"> <input type=hidden name="forum" value="$inforum"> <input type=hidden name="topic" value="$intopic"> <tr> <td bgcolor=$miscbacktwo valign=middle align=center colspan=2><font face="$font" color=$fontcolormisc size=$dfontsize2><b>$ibtxt{'1508'}</b></font></td></tr> <tr> <td bgcolor=$miscbackone valign=middle colspan=2><font face="$font" color=$fontcolormisc size=$dfontsize1><center><b>$ibtxt{'1509'}</font></td> <tr> <td bgcolor=$miscbackone valign=middle width=40%><font face="$font" color=$fontcolormisc size=$dfontsize1><b>$ibtxt{'0306'}</b></font></td> <td bgcolor=$miscbackone valign=middle><input type=text name="membername" value="$inmembername" size=20</td></tr> <tr> <td bgcolor=$miscbackone valign=middle><font face="$font" color=$fontcolormisc size=$dfontsize1><b>$ibtxt{'0307'}</b></font></td> <td bgcolor=$miscbackone valign=middle><input type=password name="password" value="$inpassword" size=20> <font face="$font" color=$fontcolormisc size=$dfontsize1><a href="$profileprog?action=lostpass">$ibtxt{'2411'}</a></font></td></tr> <tr> <td bgcolor=$miscbackone valign=middle><font face="$font" color=$fontcolormisc size=$dfontsize1> <b>$ibtxt{'1513'}</td> <td bgcolor=$miscbackone valign=middle><font face="$font" color=$fontcolormisc size=$dfontsize1> <input name="leavemessage" type="radio" value="yes" checked> $ibtxt{'1514'}<br><input name="leavemessage" type="radio" value="no"> $ibtxt{'1515'}</font> </td> </tr> <tr> <td bgcolor=$miscbackone valign=top><font face="$font" color=$fontcolormisc size=$dfontsize1><b>$ibtxt{'0931'}</b><p> $ibtxt{'1517'}<p> $ibtxt{'1518'} </font></td> <td bgcolor=$miscbackone valign=middle><textarea cols=45 rows=6 wrap="soft" name="inpost"></textarea></td> </tr> <tr> <td bgcolor=$miscbackone valign=top><font face="$font" color=$fontcolormisc size=$dfontsize1><b>$ibtxt{'1519'}</b></font></td> <td bgcolor=$miscbackone valign=top><font face="$font" color=$fontcolormisc size=$dfontsize1><select name="movetoid">$jumphtml</select></font></td> </tr> <tr> <td bgcolor=$miscbacktwo valign=middle colspan=2 align=center><input type=submit name="submit" value="$ibtxt{'0039'}" class=subm></td></tr></form></table></td></tr></table> </table> </td></tr> </table> ~; } # end else } # end movetopic | тока учти у меня для верси с голосованиями.
Внёс исправления (то, что красным цветом). Xnom | Всего записей: 1967 | Зарегистр. 23-10-2001 | Отправлено: 01:00 03-04-2002 | Исправлено: Xnom, 02:06 11-01-2003 |
|