webring script

shiver

Erfahrenes Mitglied
hi, ich hoffe jemand von euch kann mir helfen...
ich sitz gerade an nem webringscript, und will das so anpassen dass bei dem befehl "list" die ausgabe mit einer zusätzlichen spalte, und zwar den hits, erscheint...

jaaaa, ich hab keine ahnung von perl, deshalb frag ich ja ob von euch einer ne idee hat ;)


PHP:
sub list	{
  my $activesite = 0;
  my $inactivesite = 0;
  if ($rlmain::data{'offset'} || $rlmain::data{'offset'} eq '0')	{
    if ($rlmain::data{'offset'} =~ /\D/)	{
      push (@rlmain::error, '<p class="error">'
      . gettext("The &quot;offset&quot; argument shall consist of digits only.\nThe list below starts with a randomly chosen site.")
      . '</p>');
      $rlmain::data{'offset'} = int (rand (scalar @rlmain::activesites));
    } elsif ($rlmain::data{'offset'} > scalar @rlmain::activesites - 1 || $rlmain::data{'offset'} < 0)	{
      push (@rlmain::error, '<p class="error">' . sprintf (
        gettext("Incorrect &quot;offset&quot; value. (Should have been a number between\n0 and %d.) The list below starts with a randomly chosen site."),
        scalar @rlmain::activesites - 1) . '</p>');
      $rlmain::data{'offset'} = int (rand (scalar @rlmain::activesites));
    }
    &createlist;
  }
  $rlmain::data{'offset'} = 0;
  for (@rlmain::activesites)	{
    if ($_ =~ /^$rlmain::data{'siteid'}\t/)	{
      $activesite = 1;
      last;
    } else	{
      $rlmain::data{'offset'} ++;
    }
  }
  if (!$rlmain::data{'siteid'})	{
    if ($rlmain::action =~ /^list\./i)	{
      $rlmain::data{'offset'} = int (rand (scalar @rlmain::activesites));
      &createlist;
    } else	{
      $rlmain::result = '<p class="error">' . gettext("Error! You must provide a site ID.") . '</p>';
      &mainhtml;
      rlmain::exit;
    }
  } elsif (!$activesite && $rlmain::action !~ /^list\./i)	{
    &naverror;
  } elsif (!$activesite)	{
    for (@rlmain::inactivesites)	{
      if ($_ =~ /^$rlmain::data{'siteid'}\t/)	{
        $inactivesite = 1;
        push (@rlmain::error, '<p class="error">' . sprintf (
          gettext("Site ID %s is not active. The list below\nstarts with another, randomly chosen, site."),
          "&quot;$rlmain::data{'siteid'}&quot;") . '</p>');
        $rlmain::data{'offset'} = int (rand (scalar @rlmain::activesites));
        &createlist;
        last;
      }
    }
    if (!$inactivesite)	{
      push (@rlmain::error, '<p class="error">' . sprintf (
        gettext("Site ID %s does not exist in this ring.\nThe list below starts with a randomly chosen site."),
        "&quot;$rlmain::data{'siteid'}&quot;") . '</p>');
      $rlmain::data{'offset'} = int (rand (scalar @rlmain::activesites));
      &createlist;
    }
  } else	{
    rlmain::addgenhits ($rlmain::data{'siteid'});
    &createlist;
  }
}

sooo sieht der liebe aufruf aus... leider keine (richtige) ahnung wo die ausgabe der hits der einzelnen seiten reinzupacken wär (oder wie das geht)..

vielleicht kann mir ja jemand helfen
thx.

shiv
 
hm okay.. formulieren wir die frage anders...

gibt es hier irgendwo jemanden, der sich gut mit perl auskennt, und uns aushelfen würde?
 

Neue Beiträge

Zurück