Forum

Repertoire: /Forum\n"; if (empty($chemin[2])) { echo "

Rechercher sur tout le forum

"; $compteur=1; $envoi = "SELECT ref,nom,description,categorie FROM description WHERE axx<=$axx ORDER by id ASC"; $resulta = mysql_query($envoi) or die(mysql_error()); #ref = nom et description des tables while ($ref = mysql_fetch_assoc($resulta)) { $compteur++; if (fmod($compteur,2) ==0) { $style="foruma"; } else { $style="forumb"; } $requete = "SELECT pseudo,date,topic_id,com_id from ".$ref["ref"]." ORDER BY id DESC LIMIT 1"; $resultat = mysql_query($requete) or die(mysql_error()."
$requete"); $dernier = mysql_fetch_assoc($resultat); $dernier["date"] = preg_replace("/(\d{4})-(\d{2})-(\d{2}) (\d{2}):(\d{2}):(\d{2})/","$3/$2/$1 à $4:$5:$6",$dernier["date"]); $ref["ref"] = preg_replace("/^forum_(.*)/","$1",$ref["ref"]); echo "
".$ref["nom"]."
".$ref["description"]."
\n"; if (!empty($dernier["pseudo"])) { $lastpage = ceil($dernier["com_id"]/10); echo "
Dernier message le ".$dernier["date"]." par ".$dernier["pseudo"]."
"; } } echo "
"; } else { if (empty($chemin[3])) { list($table,$start) = split("-",$chemin[2]); $envoi = "SELECT axx FROM description WHERE ref='forum_$table'"; $result_envoie=mysql_query($envoi); if ($row=mysql_fetch_array($result_envoie)) { $need_axx = $row[0]; } else { $need_axx = 100; } if ($need_axx > $axx) { die("

Vous n'avez pas acces a ce forum , fatal error

"); } echo "/ $table \n"; $requete = "SELECT COUNT(DISTINCT topic_id) from forum_$table "; $resultat = mysql_query($requete) or die("inexistant"); $pages = mysql_fetch_array($resultat); $page = ceil($pages[0]/10); if ($page == 1) { echo "( 1 page )"; } else { echo "("; for($i=1;$i<=$page;$i++) { echo "$i "; } echo " )";} $start =($start-1)*10; $chemin[2]=$table; echo "

Rechercher sur cette section

Nouveau

"; $big=array(); $bignum = 0; $query = "SELECT topic_id,nom,pseudo FROM forum_".$chemin[2]." WHERE com_id='1' ORDER BY id DESC LIMIT $start,10"; $result = mysql_query($query) or die("Not found?"); $compteur=1; echo "
\n"; while($row = mysql_fetch_assoc($result)) { $big[$bignum] = array("nom"=> $row["nom"], "topic_id"=>$row["topic_id"], "pseudo"=>$row["pseudo"]); $bignum++; } for ($i=0;$i $row) { $a_nom[$key]=$row["nom"]; $a_topic_id[$key]=$row["topic_id"]; $a_pseudo[$key]=$row["pseudo"]; $a_date[$key]=$row["date"]; } array_multisort($a_date, SORT_DESC, $a_nom, SORT_DESC, $a_topic_id, SORT_DESC, $a_pseudo, SORT_DESC , $big); foreach($big as $row) { $requete = "SELECT COUNT(*) from forum_$chemin[2] WHERE topic_id='".$row["topic_id"]."'"; $resultat = mysql_query($requete) or die(mysql_error()); $reponses = mysql_fetch_array($resultat); $requete = "SELECT com_id,pseudo,date from forum_$chemin[2] WHERE topic_id='".$row["topic_id"]."' and com_id>1 ORDER BY com_id DESC LIMIT 1"; $resultat = mysql_query($requete) or die(mysql_error()); $dernier = mysql_fetch_assoc($resultat); $compteur++; if (fmod($compteur,2) ==0) { $style="foruma"; } else { $style="forumb"; } echo "
".$row["nom"]."
par ".$row["pseudo"].""; if ($axx > 5) { echo " (Supprimer)"; } echo "
"; if (($reponses[0]-1)== 0) echo "pas de reponses"; elseif(($reponses[0]-1) == 1) { echo "1 reponse"; } else { echo ($reponses[0]-1)." reponses"; } $dernier["date"] = preg_replace("/(\d{4})-(\d{2})-(\d{2}) (\d{2}):(\d{2}):(\d{2})/","$3/$2/$1 à $4:$5:$6",$dernier["date"]); echo "
"; if (!empty($dernier["pseudo"])) { $page = ceil($com_id/10)+1; echo "
Dernier message le ".$dernier["date"]." par ".$dernier["pseudo"].""; } else { echo "
n/a"; } echo "\n"; echo "
"; } echo "
\n"; } else { echo "/ $chemin[2] \n"; $chemin[2] = preg_replace("/[^a-zA-Z]/","",$chemin[2]); $envoi = "SELECT axx FROM description WHERE ref='forum_$chemin[2]'"; $result_envoie=mysql_query($envoi); if ($row=mysql_fetch_array($result_envoie)) { $need_axx = $row[0]; } else { $need_axx = 100; } if ($need_axx > $axx) { die("

Vous n'avez pas acces a ce document

"); } if ($chemin[3] == "new") { include(dirname(__FILE__)."/inc_forum/new.php"); } else { $chemin[3] = preg_replace("/^(\d+)\-(\d+).*/","$1-$2",$chemin[3]); if ($chemin[4]=="repondre") { include(dirname(__FILE__)."/inc_forum/repondre.php"); } elseif ($chemin[4]=="topicdel") { include(dirname(__FILE__)."/inc_forum/topicdel.php"); } else { if (!empty($chemin[4])) { include(dirname(__FILE__)."/inc_forum/edit.php"); } else { list($table,$start) = split("-",$chemin[3]); $requete = "SELECT COUNT(*) from forum_$chemin[2] WHERE topic_id='$table'"; $resultat = mysql_query($requete) or die(mysql_error()); $pages = mysql_fetch_array($resultat); $page = ceil($pages[0]/10); if ($page == 1) { echo "( 1 page )"; } else { echo "("; for($i=1;$i<=$page;$i++) { echo "$i "; } echo " )";} $start =($start-1)*10; echo "\n

Rechercher sur ce topic

"; $query = "SELECT com_id,nom,pseudo,date,contenu FROM forum_$chemin[2] WHERE topic_id='$table' ORDER BY id ASC LIMIT $start,10"; $result = mysql_query($query) or die("Erreur !"); $compteur=1; while ($row = mysql_fetch_assoc($result)) { $date = preg_replace("/(\d{4})-(\d{2})-(\d{2}) (\d{2}):(\d{2}):(\d{2})/","$3/$2/$1 à $4:$5:$6",$row["date"]); $compteur++; if (fmod($compteur,2) ==0) { $style="foruma"; } else { $style="forumb"; } # echo "
".$row["nom"]."
#
(#)par ".$row["pseudo"]." le ".$date."
#
"; echo "
".$row["nom"]."
(#)par ".$row["pseudo"]." le ".$date."
"; affichage($row["contenu"]); if ($nick == $row["pseudo"] or $axx>5) { echo "

Editer :: Supprimer

"; } echo "
\n"; } echo "

Repondre

\n"; } } } } } ?>