#!/usr/bin/perl # insertion des variables de statistiques require 'stats.pl'; $lien='aucun'; #nombre de sites inscrits $nb = 7; sub compteuriser # définit le numéro de site appelé { $compteur = $nb + 1; # génère un nombre aléatoire while ($compteur > $nb) { $compteur = 1 + (int(rand($nb))); } } sub variabliser # récupère les valeurs correspondant au numéro de site { #bannière 1 if (($compteur == 1) && ($source ne "youki")) { $lien='http://www.2patates.com/forum'; $image='youki.gif'; $texte='Le forum à Youki'; $select='youki'; } #bannière 2 elsif (($compteur == 2) && ($source ne "exprime")) { $lien='http://www.exprime-toi.net/communique/forums'; $image='exprime.gif'; $texte='Forums thématiques de exprime-toi.com'; $select='exprime'; } #bannière 3 elsif (($compteur == 3) && ($source ne "nonog")) { $lien='http://nonog.apinc.org'; $image='nonog.gif'; $texte="L'atelier de nonoG, entrez dans la galerie virtuelle de l'artiste"; $select='nonog'; } #bannière 4 elsif (($compteur == 4) && ($source ne "micemoa")) { $lien='http://micemoa.lautre.net/forum/index2.php3'; $image='micemoa.jpg'; $texte='Micé Fo Rhum'; $select='micemoa'; } #bannière 5 elsif (($compteur == 5) && ($source ne "gp")) { $lien='http://pretextes.apinc.org'; $image='gp.gif'; $texte='Notre forum préféré :)'; $select='gp'; } #bannière 6 elsif (($compteur == 6) && ($source ne "trolo")) { $lien='http://olo.f2o.org/forum/forum/forumzav.php'; $image='trolo.gif'; $texte='le forum de chez trolo'; $select='trolo'; } #bannière 7 elsif (($compteur == 7) && ($source ne "chabel")) { $lien='http://chabel.org'; $image='chabel.gif'; $texte='Auberge de sites et forum de discussions'; $select='chabel'; } $image="http://ane-haut.eu.org/bannieres/".$image; } sub lister { &compteuriser; &variabliser; # attribue tant que déjà appelé if ($liste{$select} eq '1') { &lister; } $liste{$select} = '1'; } sub majstats { # met à jour le fichier de statistiques $texte = ''; foreach $key (sort keys %ban) { $texte=$texte.'$ban{"'.$key.'"}='.$ban{$key}.";\n"; } $texte = $texte."\n"; foreach $key (sort keys %lie) { $texte=$texte.'$lie{"'.$key.'"}='.$lie{$key}.";\n"; } $texte = $texte."\n"; foreach $key (sort keys %app) { $texte=$texte.'$app{"'.$key.'"}='.$app{$key}.";\n"; } $texte = $texte."\n"; foreach $key (sort keys %lis) { $texte=$texte.'$lis{"'.$key.'"}='.$lis{$key}.";\n"; } $texte = $texte."\n"; foreach $key (sort keys %pla) { $texte=$texte.'$pla{"'.$key.'"}='.$pla{$key}.";\n"; } open (fstats,">stats.pl"); print fstats "$texte"; print fstats "1;"; close fstats; } 1;