Автор Тема: НАРОД! НУЖНА ПОМОЩЬ!  (Прочитано 2464 раз)

0 Пользователей и 1 Гость просматривают эту тему.

Dynamic_One

  • Гость
НАРОД! НУЖНА ПОМОЩЬ!
« : 26 Июля 2002, 06:08:40 »
Вот сам скрипт он выводит ошибку
500 Internal Server Error





require "setup.pl";

sub layout {
print "Location: $htmlpath/$pagename.html\\n\\n";
exit;

sub process {

   #####Add Hits
   open (FILE,"$cgipath/file.dat") || &error("Error reading file.dat");
   @filedata = ;
   close (FILE);

   $totalaccount = 0;
   $place = 16;
   if ($methrank == 0) { $place = 16 }
   elsif ($methrank == 1) { $place = 8 }
   elsif ($methrank == 2) { $place = 15 }
   elsif ($methrank == 3) { $place = 25 }
   elsif ($methrank == 4) { $place = 17 }
   elsif ($methrank == 5) { $place = 24 }
   foreach $line (@filedata) {
      @account = split(/\\|\\|/,$line);
      $file = $account[0];

      open (COUNT,"$cgipath/in/$file.dat");
      $countfiledata = ;
      close (COUNT);

      #####Add Hits To Daily
      $account[8] += $countfiledata;
      $account[15] += $countfiledata;

      #####Delete count.dat
      open (COUNT,">$cgipath/in/$file.dat");
      if ($flock) { flock COUNT, 2 }
      close (COUNT);
      
      open (COUNT,"$cgipath/out/$file.dat");
      $countfiledataz = ;
      close (COUNT);

      #####Add Hits To Daily
      $account[17] += $countfiledataz;
      $account[24] += $countfiledataz;

      #####Delete count.dat
      open (COUNT,">$cgipath/out/$file.dat");
      if ($flock) { flock COUNT, 2 }
      close (COUNT);

      #####Calculate Average
      if ($account[0]) {
         if ($account[26] != 0) {
            $account[16] = int($account[15]/$account[26]);
            $account[25] = int($account[24]/$account[26]);
         }
         #####Delete Inactives
         if ($inactives && $inactmeth && ($account[26] > 7) && ($account[14] == 0) && ($account[13] == 0) && ($account[12] == 0) && ($account[11] == 0) && ($account[10] == 0) && ($account[9] == 0) && ($account[8] == 0)) { $account[27] = "Inactives" }
         elsif ($inactives && ($account[26] > 7) && ($account[14] == 0) && ($account[13] == 0) && ($account[12] == 0) && ($account[11] == 0) && ($account[10] == 0) && ($account[9] == 0) && ($account[8] == 0)) { $line = "" }

         $line = join("||",@account);
         if ($account[27] eq "Actives") {
            $zrank[$totalaccount] = "$account[$place]||$account[0]||0";
            $totalaccount++;
         }
      }
      else { $line = "" }
   }
   #####Save Changes
   open (FILE,">$cgipath/file.dat") || &error("Error writing to file.dat");
   if ($flock) { flock FILE, 2 }
   print FILE @filedata;
   close (FILE);
   
   #####Sort Data
   @zrank = reverse (sort { $a <=> $b }@zrank);

   open (BANNER,"$cgipath/banner.dat") || &error("Error reading banner.dat");
   @banner = ;
   close (BANNER);

   #####Put in Category
   if ($category) {
      open (CAT, "$cgipath/category.dat") || &error("Error reading category.dat");
      @category = ;
      close (CAT);
      $totaltemp = $totalaccount;
      $pagetemp = $pagename;

      $cattext = "Category: Entire";
      $catdrop = " \\n";

      foreach $linezz(@category) {
         @catarray = split(/\\|\\|/, $linezz);
         if ($catarray[0]) {
            $totalaccount = 0;
            foreach $linex(@filedata) {
               @acczz = split(/\\|\\|/, $linex);
               if ($acczz[7] eq $catarray[0]) { $totalaccount++ }
            }
            $pagenum = 1;
            if ($totalaccount > $pageaccount) {
               if ($multipage) {
                  $pagenum = (int ($totalaccount / $pageaccount) + 1);
               }
            }
            $pagename = $catarray[1];
            $namezz = $catarray[0];
            &run;
         }
      }

      $totalaccount = $totaltemp;
      $pagename = $pagetemp;
   }

   #####Start Ranking
   $pagenum = 1;
   if ($totalaccount > $pageaccount) {
      if ($multipage) {
         $pagenum = (int ($totalaccount / $pageaccount) + 1);
      }
   }

   #####The Big Loop
   open (BAN,">$cgipath/banner.dat") || &error("Error writing to banner.dat");
   if ($flock) { flock BAN, 2 }
   $namezz = 0;
   &run;
}
#####Make the pages
sub run {
   $pageend = 1;
   $rank = 0;
   $rankx = 0;
   $srank = 0;
   while ($pagenum >= $pageend) {
      if ($pageend == 1){
         $pagepath = "$htmlpath/$pagename.html";
      }
      else {
         $pagepath = "$htmlpath/$pagename$pageend.html";
      }
      $temp = 0;
      $pagee = 0;
      $navtext = "";
      $navdrop = "";
      if ($multipage){
         $navtext = "Page: ";
         $navdrop = "
\\n";
      }
      $page = "\\n";
      if ($style eq "Style 1") { require "style1.pl"; }
      elsif ($style eq "Style 2") { require "style2.pl"; }
      elsif ($style eq "Style 3") { require "style3.pl"; }
      elsif ($style eq "Style 4") { require "style4.pl"; }
      elsif ($style eq "Style 5") { require "style5.pl"; }
      elsif ($style eq "Custom") { require "custom.pl"; }
      &head;
      $srank = ($srank + $pageaccount);
      while ($rankx < $srank) {
         @acc = split(/\\|\\|/,$zrank[$rankx]);
         $rankx++;
         foreach $line(@filedata) {
            @account = split(/\\|\\|/,$line);
            if ($category) {
                if ($namezz eq $account[7]) { $founds = 1 }
                else { $founds = 0 }
            }
            unless ($namezz) { $founds = 1; }
            if (($account[0] == $acc[1]) && ($account[27] eq "Actives") && $founds) {
               $rank++;
               #####Printing to banner.dat
               unless ($namezz) { print BAN "$account[0]||$rank||0\\n" }

               open (COMMENTS,"$cgipath/comments/$account[0].dat");
               @comments = ;
               close (COMMENTS);
               $pos = 0;
               $neg = 0;
               foreach $entry(@comments) {
                  @com = split(/\\|\\|/,$entry);
                  if ($com[3] eq "+") { $pos++ }
                  elsif ($com[3] eq "-") { $neg++ }
               }
               unless ($account[26] <= $newtime) {
                  #####Arrows Thingy
                  $point = $same;
                  foreach $line(@banner) {
                     @arrow = split(/\\|\\|/,$line);
                     if ($arrow[0] == $account[0]) {
                        $parrow = $arrow[1];
                        if ($parrow < $rank) { $point = $down }
                        elsif ($parrow > $rank) { $point = $up }
                     }
                  }
               }
               &body;
            }
         }
      }
      &foot;
      $page .= qq~
$topsitename is powered by http://intensitymf.vze.com">Intense Topsites Version 3.1 Pro~;
      open (OPTION, "$cgipath/options.dat") || &error("Error reading options.dat");
      @options =

Оффлайн YA

  • Модератор
  • Глобальный модератор
  • Ветеран
  • *****
  • Сообщений: 597
  • +0/-0
  • 0
    • Просмотр профиля
    • http://
НАРОД! НУЖНА ПОМОЩЬ!
« Ответ #1 : 26 Июля 2002, 08:57:50 »
Н-да... Ты бы еще "Войну и мир" сюда запостил!
Да и форумом ты немного ошибся.

А по существу:
- смотри сначала error.log;
- ошибка может быть и в твоем "setup.pl".
Литературный перевод с русского и английского на Perl. Дорого!

Оффлайн Evgeny

  • Фанат форума
  • Старожил
  • ****
  • Сообщений: 272
  • +0/-0
  • 0
    • Просмотр профиля
НАРОД! НУЖНА ПОМОЩЬ!
« Ответ #2 : 26 Июля 2002, 10:21:00 »
Может быть у тебя сервер юникс, а у скрипта windows-кодировка?

Оффлайн ESE

  • Фанат
  • Постоялец
  • ***
  • Сообщений: 172
  • +0/-0
  • 2
    • Просмотр профиля
    • http://comp.hobi.ru
НАРОД! НУЖНА ПОМОЩЬ!
« Ответ #3 : 26 Июля 2002, 10:37:27 »
Забыл закрыть два раза } а где, догадайся сам
и еще, у тебя две подпрограммы с одним и тем-же названием layout, не знаю, правильно ли это???
У програмиста две руки: левая и !левая
welcome

 

Sitemap 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28