Forum

erreur :) page en cstruction

non

Vous n avez rien a faire ici, loggez vous :)

Repertoire: /Forum\n"; if (empty($chemin[2])) { echo "
"; $result=mysql_list_tables("informatique"); while ($row = mysql_fetch_row($result)) { if (ereg("^forum_(.*)",$row[0],$reg)) { $result = mysql_query("SELECT nom,description FROM description WHERE ref='$row[0]'") or die(mysql_error()); $compteur=1; while ($ref = mysql_fetch_assoc($result)) { $compteur++; if (fmod($compteur,2) ==0) { $style="foruma"; } else { $style="forumb"; } $requete = "SELECT pseudo,date,topic_id from forum_$reg[1] ORDER BY id DESC LIMIT 1"; $resultat = mysql_query($requete) or die(mysql_error()); $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"]); echo "
".$ref["nom"]."
".$ref["description"]."
\n"; if (!empty($dernier["pseudo"])) { echo "
Dernier message le ".$dernier["date"]." par ".$dernier["pseudo"]."
"; } } } } echo "
"; } else { $chemin[2] = preg_replace("/[^a-zA-Z]/","",$chemin[2]); echo "/ $chemin[2] \n"; if (empty($chemin[3])) { echo "

Nouveau

"; $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; $query = "SELECT DISTINCT topic_id,nom,pseudo FROM forum_".$chemin[2]." WHERE com_id='1' ORDER BY topic_id DESC LIMIT 30"; $result = mysql_query($query) or die("Not found?"); $compteur=1; echo "
\n"; while($row = mysql_fetch_assoc($result)) { $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 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 (($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"])) { echo "
Dernier message le ".$dernier["date"]." par ".$dernier["pseudo"]."
"; } echo "\n"; } echo "
\n"; } else { 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"); } 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
"; $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."
"; $contenu = explode("\n",$row["contenu"]); foreach($contenu as $key) { echo "

$key\n

"; } if ($nick == $row["pseudo"]) { echo "

Editer :: Supprimer

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

Repondre

\n"; echo "
"; } } } } } } ?>