lynx
Advanced lynx | Редактировать | Профиль | Сообщение | Цитировать | Сообщить модератору Нашла баг в твоей подпрограмме, там условие не там, у тебя: Код: if ($inpassword ne '') { $cleanmembername = $inmembername; $cleanmembername =~ s/ /\_/isg; $numberofposts++; $lastpostdate = "$currenttime\%\%\%$threadprog?forum=$inforum&topic=$newthreadnumber\%\%\%$intopictitle" if ($privateforum ne "yes"); chomp $lastpostdate; $filetomake = "$ikondir" . "members/$cleanmembername.cgi"; $filetomake = &stripMETA($filetomake); open(FILE, ">$filetomake"); flock(FILE, 2); print FILE "$inmembername|$password|$membertitle|$membercode| $numberofposts|$emailaddress|$showemail|$ipaddress|$homepage| $aolname|$icqnumber|$location|$interests|$joineddate|$lastpostdate| $signature|$timedifference|$privateforums|$useravatar|$misc1|$misc2 |$misc3"; close(FILE); } | А надо не тут совсем, а выше, короче я сейчас дам весь новый код, просто им замени. Код: sub addnewthread { # start routine ### Lets sort out the flood control, incase they used the back button... #if($inpassword ne '') #{ &getmember("$inmembername"); if (($floodcontrol eq "on") && ($membercode ne "ad") && ($membercode ne "mo")) { $currenttime = time; ($lastpost, $posturl, $posttopic) = split(/\%\%\%/,$lastpostdate); $lastpost = ($lastpost + $floodcontrollimit); if ($lastpost > $currenttime) { &error("$ibtxt{'1403'}&$ibtxt{'1404'} $floodcontrollimit $ibtxt{'1405'}"); } } # Sort out the forum moderator &moderator; if ($startnewthreads eq "no") { unless ($membercode eq "ad" || $inmembmod eq "yes") { &error("$ibtxt{'1428'}&$ibtxt{'1412'}"); } } #} if ($userregistered eq "no") { &error("$ibtxt{'1428'}&$ibtxt{'1102'}"); } elsif ($inpassword ne $password) { &error("$ibtxt{'1428'}&$ibtxt{'1430'}"); } elsif ($membercode eq "banned") { &error("$ibtxt{'1432'}&$ibtxt{'1431'}"); } elsif ($intopictitle eq "") { &error("$ibtxt{'1428'}&$ibtxt{'1433'}"); } elsif ($inpost eq "") { &error("$ibtxt{'1428'}&$ibtxt{'1434'}"); } elsif ($intopictitle =~ /^\s/) { &error("Starting a thread&You must start the title with a letter or number"); } else { # start else &getforum("$inforum"); if ($allowedentry{$inforum} eq "yes") { $allowed = "yes"; } if (($privateforum eq "yes") && ($allowed ne "yes")) { &error("$ibtxt{'1406'}&$ibtxt{'1407'}"); } ### Get a new thread number. $dirtoopen = "$ikondir" . "forum$inforum"; opendir (DIR, "$dirtoopen"); @dirdata = readdir(DIR); closedir (DIR); @sorteddirdata = grep(/thd/,@dirdata); @newdirdata = sort numerically(@sorteddirdata); @neworderdirdata = reverse(@newdirdata); $highest = @neworderdirdata[0]; $highest =~ s/.thd//; $newthreadnumber = $highest + 1; # Open the bad word filter $filetoopen = "$ikondir" . "data/badwords.cgi"; open (FILE, "$filetoopen"); $badwords = <FILE>; close (FILE); if ($badwords) { @pairs = split(/\&/,$badwords); foreach (@pairs) { ($bad, $good) = split(/=/,$_); $inpost =~ s/$bad/$good/ig; $intopictitle =~ s/$bad/$good/ig; $intopicdescription =~ s/$bad/$good/ig; } } # Write the list.threadnumber entry $filetoopen = "$ikondir" . "forum$inforum/$newthreadnumber.pl"; $filetoopen = &stripMETA($filetoopen); open(FILE, ">$filetoopen"); flock (FILE, 2); print FILE "$newthreadnumber|$intopictitle|$intopicdescription|open|0|0|$inmembername|$currenttime|$inmembername|$currenttime"; close(FILE); # Create the new thread file $filetomake = "$ikondir" . "forum$inforum/$newthreadnumber.thd"; $filetomake = &stripMETA($filetomake); open(FILE, ">$filetomake"); flock(FILE, 2); print FILE "$inmembername|$intopictitle|$postipaddress|$inshowemoticons|$inshowsignature|$currenttime|$inpost"; close(FILE); # Update stats for member, and board &getforum("$inforum"); #if ($inpassword ne '') #{ $cleanmembername = $inmembername; $cleanmembername =~ s/ /\_/isg; $numberofposts++; $lastpostdate = "$currenttime\%\%\%$threadprog?forum=$inforum&topic=$newthreadnumber\%\%\%$intopictitle" if ($privateforum ne "yes"); chomp $lastpostdate; $filetomake = "$ikondir" . "members/$cleanmembername.cgi"; $filetomake = &stripMETA($filetomake); open(FILE, ">$filetomake"); flock(FILE, 2); print FILE "$inmembername|$password|$membertitle|$membercode|$numberofposts|$emailaddress|$showemail|$ipaddress|$homepage|$aolname|$icqnumber|$location|$interests|$joineddate|$lastpostdate|$signature|$timedifference|$privateforums|$useravatar|$misc1|$misc2 |$misc3"; close(FILE); #} $filetoopen = "$ikondir" . "data/allforums.cgi"; $filetoopen = &stripMETA($filetoopen); open(FILE, "$filetoopen"); flock FILE, 1; @allforums = <FILE>; close(FILE); $filetomake = "$ikondir" . "data/allforums.cgi"; $filetomake = &stripMETA($filetomake); 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) = split(/\|/,$forum); $lastposter = $inmembername; $lastposttime = $currenttime; $threads = $newthreadnumber; $processed_data .= "$forumid|$category|$categoryplace|$forumname|$forumdescription|$forummoderator|$htmlstate|$idmbcodestate|$privateforum|$startnewthreads|$lastposter|$lastposttime|$threads|$posts|$forumgraphic\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"); } open(FILE, ">$filetomake"); flock(FILE, 2); print FILE $processed_data; close(FILE); undef $processed_data; require "$ikondir" . "data/boardstats.cgi"; $filetomake = "$ikondir" . "data/boardstats.cgi"; $filetomake = &stripMETA($filetomake); $totalthreads++; open(FILE, ">$filetomake"); flock(FILE, 2); print FILE "\$lastregisteredmember = \"$lastregisteredmember\"\;\n"; print FILE "\$totalmembers = \"$totalmembers\"\;\n"; print FILE "\$totalthreads = \"$totalthreads\"\;\n"; print FILE "\$totalposts = \"$totalposts\"\;\n"; print FILE "\n1\;"; close (FILE); # if the user wants email notifications, lets add them. if (($emailfunctions eq "on") && ($innotify eq "yes")) { # start mail $filetomake = "$ikondir" . "forum$inforum/$newthreadnumber.mal"; open (FILE, ">$filetomake"); flock (FILE, 2); print FILE "$inmembername|$emailaddress\n"; close (FILE); } # end if $relocurl = "$threadprog?forum=$inforum&topic=$newthreadnumber"; &mischeader("$ibtxt{'1440'}"); $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{'1441'}</b></font></td></tr> <tr> <td bgcolor=$miscbackone valign=middle><font face="$font" color=$fontcolormisc size=$dfontsize1> $ibtxt{'0321'} <ul> <li><a href="$threadprog?forum=$inforum&topic=$newthreadnumber">$ibtxt{'1443'}</a> <li><a href="$forumsprog?forum=$inforum">$ibtxt{'0509'}</a> <li><a href="$forumsummaryprog">$ibtxt{'0323'}</a> </ul> </tr> </td> </table></td></tr></table> <meta http-equiv="refresh" content="5; url=$relocurl"> ~; rebuildLIST(-Forum=>"$inforum"); } # end else } # end addnewthread |
| Всего записей: 11712 | Зарегистр. 08-05-2001 | Отправлено: 20:55 24-11-2002 | Исправлено: lynx, 21:16 24-11-2002 |
|