Tom's Guide > Forum > Programmation > Problème script commentaires
Mot :    Pseudo :           
 

Bonjour !

J'aurais besoin d'un peu d'aide sur un script qui ne fonctionne pas ...

J'ai installé ce script de commentaires sur un site voici le lien

La table est installée, tout semble fonctionner, seulement lorsque je clique sur ajouter un commentaire seul le bas de la page s'affiche (la pub) voir la page

Voici le code de "comment.php" la page censée affichée le formulaire ou les commentaires.

<?
##############################################################
# ACGV Comment ( comment.php ) #
# #
# Script par menTiss ( Team ACGV ) #
# http://www.acgv.fr.st/ #
# version 1.0 #
##############################################################
require("config/comment.inc.php" );
require("config/function.inc.php" );
require("config/langue/"."$langue".".php" );

$copyright = "<br><div align=\"center\"><SCRIPT type='text/javascript' SRC='http://bannierefr.com:8088/123/hf/index_234x60-4.js'></script></div></body></html>";
if($actiona=='comment')
{
$actionc="commenter";
}
elseif($actiona=='note')
{
$actionc="noter";
}
$page = template("templates/head.html" );
eval("echo stripslashes(\"$page\" );" );

if($titre_plus=='yes')
{
if($actiona=='comment')
{
print("<h4 align=\"center\">$avis[lang] $sur[lang] $categorie</h4>" );
}
}
else
{
if($actiona=='comment')
{
print("<h4 align=\"center\">$avis[lang]</h4>" );
}
}

if($actiona=='comment' and $trmt!='ok')
{
$affichage = af_comments("$categorie","$numpage" );
$page = template("templates/corpus.html" );
eval("echo stripslashes(\"$page\" );" );
}
if($trmt=='ok' and $verif=='false' and $actiona=='comment')
{
$domain=strstr($mail, '@');
$domain2=strstr($mail, '.');
if(empty($titre) or empty($pseudo) or empty($mail) or empty($comment))
{
print("<div align=\"center\"><br><br>$remplir[lang]" );
print("<br><a href=\"#\" onClick=\"history.go(-1)\">$retour[lang]</a></div>" );
$verif="false";
}
if($pseudo=='vote')
{
print("<div align=\"center\">$nickvote[lang]" );
print("<br><a href=\"#\" onClick=\"history.go(-1)\">$retour[lang]</a></div>" );
$verif="false";
}
if($domain=='' or $domain2=='')
{
print("<div align=\"center\"><br><br>$mailno[lang]<br>" );
print("<a href=\"#\" onClick=\"history.go(-1)\">$retour[lang]</a></div>" );
$verif="false";
if(eregi("^([_a-z0-9]+([\\._a-z0-9-]+)*)@([a-z0-9]{2,}(\\.[a-z0-9-]{2,})*\\.[a-z]{2,3})$", $mail))
{
print("...." );
}

}
elseif($pseudo!='vote')
{
$verif="true";
}
}

if($trmt=='ok' and $verif=='true' and $actiona=='comment')
{

mysql_connect($hote,$login,$mdp) or die("$err_connect[lang]" );
mysql_select_db($base) or die("$err_seldb[lang]" );

$date=time();
if($sysvalid=="yes" )
{
$valid="0";
}
else
{
$valid="1";
}

$ajoute ="INSERT INTO $table_comment(id,pseudo,mail,titre,text,categorie,date,note,votant,valid,version) VALUES('','$pseudo','$mail','$titre','$comment','$categorie','$date','','','$valid','')";

mysql_query($ajoute) or die("$err_ajout[lang]" );
if($sysvalid=='yes')
{
$a="<br>$validcom[lang]";
}

print("<br><br><div align=\"center\">$comajoute[lang] $redirect[lang] $a" );
print("<meta http-equiv=\"refresh\" content=\"2; URL=comment.php?actiona=comment&categorie=$categorie\"></div>" );

}

if($actiona=='note' and $a_form!='1')
{
mysql_connect($hote,$login,$mdp);
mysql_select_db($base) or die("$err_seldb[lang]" );

$requete_note=mysql_query(" SELECT titre,categorie FROM $table_comment WHERE categorie='$categorie' AND pseudo='vote'" );
$num=mysql_num_rows($requete_note);
$vr=0;
$ver[0]="0";
if($num=='0')
{
$page = template("templates/note.html" );
eval("echo stripslashes(\"$page\" );" );
}
else
{
while($note=mysql_fetch_array($requete_note))
{
if(in_array("$note[categorie]",$ver))
{continue;}
else
{
$ver[$vr]="$note[categorie]";
$vr++;
$categorie=$note['categorie'];
$page = template("templates/note.html" );
eval("echo stripslashes(\"$page\" );" );
}
}
}
}
if($actiona=='note' and $a_form=='1')
{
mysql_connect($hote,$login,$mdp);
mysql_select_db($base) or die("$err_seldb[lang]" );
$requete=mysql_query(" SELECT * FROM $table_comment WHERE categorie='$categorie' AND pseudo='vote'" );
$num_note=mysql_num_rows($requete);
if($num_note=='0')
{
$insert="INSERT INTO $table_comment(id,pseudo,mail,titre,text,categorie,date,note,votant,valid,version) VALUES('','vote','','','','$categorie','','$note','1','','')";
mysql_query($insert) or die("$err_noteaj[lang]" );
print("<div align=\"center\">$voteok[lang] $categorie" );
print("<br><a href=\"#\" onClick=\"window.close()\">$fermer[lang]</a></div>" );
}
else
{
$vr=0;
$ver[0]="0";

while($star=mysql_fetch_array($requete))
{
if(in_array("$star[categorie]",$ver))
{continue;}
else
{
$ver[$vr]="$star[categorie]";
$vr++;
if($star[votant]!=0)
{
$nvot=$star[votant]+1;
$note_plus = $star[votant]*$star[note]+$note;
$note_moy = $note_plus/$nvot;
$note_fin = ceil($note_moy);

$update="UPDATE $table_comment SET note='$note_fin',votant='$nvot' WHERE categorie='$categorie' AND pseudo='vote'";
mysql_query($update) or die("$err_noteaj[lang]" );

print("<div align=\"center\">$voteok[lang] $star[categorie]" );
print("<br><a href=\"#\" onClick=\"window.close()\">$fermer[lang]</a></div>" );
}
else
{
$update = " UPDATE $table_comment SET note='$note',votant='1' WHERE categorie='$categorie' AND pseudo='vote'";
mysql_query($update) or die("$err_noteaj[lang]" );

print("<div align=\"center\">$voteok[lang] $star[categorie]" );
print("<br><a href=\"#\" onClick=\"window.close()\">$fermer[lang]</a></div>" );
}
}
}
}
}
print("$copyright" );

?>

Je comprends pas pourquoi seul le bas s'affiche vu que je n'ai rien modifié ...

HELP

Ah aussi la doc fournie qui se trouve dans le zip directement ici


Message édité par rmx713 le 28-12-2007 à 22:04:48
Liens sponsorisés
Inscrivez-vous ou connectez-vous pour masquer ceci.
Tom's Guide > Forum > Programmation > Problème script commentaires
Aller à :

Il y a 343 utilisateurs connus et inconnus. Pour voir la liste des connectés connus, cliquez ici.

Attention

Vous allez répondre sur un sujet resté inactif pendant plus de 6 mois.
Assurez-vous d'apporter des éléments nouveaux à la discussion avant de poursuivre.

Répondre Annuler
Liens