lynx
Advanced lynx | Редактировать | Профиль | Сообщение | Цитировать | Сообщить модератору Marilda Количество просмотров берется из файла list.cgi Смотрим: topic.cgi Код: $filetoopen = "$ikondir" . "forum$inforum/list.cgi"; $filetoopen = &stripMETA($filetoopen); if (-e $filetoopen) { open(FILE, $filetoopen) or &error("$ibtxt{'3001'}&$ibtxt{'3002'}$inforum/list.cgi"); flock (FILE, 1); @allthreads = <FILE>; close(FILE); $totalthreadcount = @allthreads; $count = 0; foreach $line (@allthreads) { #start foreach @threads ($tempno, $trash) = split(/\|/, $line); chomp $line; push (@numbercounter, $tempno); if ($intopic eq $tempno) { ($topicid, $topictitle, $topicdescription, $threadstate, $threadposts ,$threadviews, $startedby, $startedpostdate, $lastposter, $lastpostdate) = split(/\|/,$line); $threadviews++; | И потом пишется в файл *.pl: В общем, смотрю я на этот кусок кода и пока не понимаю, все ли это надо: Код: $filetoopen = "$ikondir" . "forum$inforum/list.cgi"; $filetoopen = &stripMETA($filetoopen); if (-e $filetoopen) { open(FILE, $filetoopen) or &error("$ibtxt{'3001'}&$ibtxt{'3002'}$inforum/list.cgi"); flock (FILE, 1); @allthreads = <FILE>; close(FILE); $totalthreadcount = @allthreads; $count = 0; foreach $line (@allthreads) { #start foreach @threads ($tempno, $trash) = split(/\|/, $line); chomp $line; push (@numbercounter, $tempno); if ($intopic eq $tempno) { ($topicid, $topictitle, $topicdescription, $threadstate, $threadposts ,$threadviews, $startedby, $startedpostdate, $lastposter, $lastpostdate) = split(/\|/,$line); $threadviews++; $keepcounter = $count; $linetokeep = "$topicid|$topictitle|$topicdescription|$threadstate|$threadposts|$threadviews|$startedby|$startedpostdate|$lastposter|$lastpostdate"; chomp $linetokeep; $processed_data .= "$linetokeep\n"; } else { $processed_data .= "$line\n"; } $count++; } if (($processed_data eq "") || ($processed_data !~ m!\|!)) { &error("Missing Data&Data as corrupted on the server. Please go back and try again"); } open(FILE, ">$filetoopen"); flock(FILE, 2); print FILE $processed_data; close(FILE); undef $processed_data; my $file = "$ikondir" . "forum$inforum/$intopic.pl"; open(MSG, ">$file"); flock(MSG, 2); print MSG $linetokeep; close(MSG); } | |