Problème avec le script alex poll 2.1

Eléphanteau du PHP | 15 Messages

31 oct. 2008, 17:35

Bonjour,

Je viens d'installer le script Alex Poll pour afficher un sondage sur mon site. Il est très bien mais les visiteurs qui utilisent Firefox ne peuvent participer au sondage: le popup s'ouvre une fois qu'ils cliquent sur ok mais la page reste blanche.

Voyez plutôt: www.juventus-fr.com

Est ce que quelqu'un pourrait m'aider ?

Voici le code du templates

Code : Tout sélectionner

[var:width_tableau=210] [var:nb_chiffres_after_virg=1] [var:bar_pool=*] <!-- FUNCT_JAVASCRIPT --> <script language="Javascript"> function popup_apoll2_{ID_POLL}(page,largeur,hauteur,options, name_page){ var top=(screen.height-hauteur)/2; var left=(screen.width-largeur)/2; window.open(page,name_page,"top="+top+",left="+left+",width="+largeur+",height="+hauteur+","+options); } function voter_{ID_POLL}(){ var width_popup = {WIDTH_POP_UP} + 100; if (width_popup > screen.width) width_popup = screen.width - 20; popup_apoll2_{ID_POLL}('',width_popup,300,'menubar=no,scrollbars=yes,statusbar=no', 'popup_voter'); document.f_voter_apoll2_{ID_POLL}.submit(); } </script> <!-- /FUNCT_JAVASCRIPT --> <table border="0" width="{WIDTH_TABLEAU}" cellspacing="1" cellpadding="0" bgcolor="#C0C0C0"> <tr> <td width="100%"> <table border="0" width="100%" cellspacing="0" cellpadding="0"> <form name=f_voter_apoll2_{ID_POLL} method="post" action="{QUERY_POPUP}" target="popup_voter"> <tr> <td align="center" height="18" bgcolor="#F0F0F0"><font size="1" face="Verdana"><b>{POLL_QUESTION}</b></font></td> </tr> <tr> <td align="center" height="1" bgcolor="#C0C0C0"><img border="0" src="{CHEM_SCRIPT}images/blank.gif" width="1" height="1"></td> </tr> <tr> <td align="center" height="1" bgcolor="#FBFBFB"><img border="0" src="{CHEM_SCRIPT}images/blank.gif" width="1" height="3"></td> </tr> <!-- ANSWERS - do not touch this code ! --> <tr> <td bgcolor="#FBFBFB"> <table border="0" width="100%" cellspacing="0" cellpadding="0"> <tr> <td width="4"></td> <td> <input type="{ANS_TYPE}" value="{ANS_VALUE}" name="{ANS_NAME}" id="{ANS_ID}"><label for="{ANS_ID}"><font size="1" face="Verdana" style="cursor: hand"> {POLL_ANSWER}</font></label></font> </td> <td width="4"></td> </tr> </table> </td> </tr> <!-- /ANSWERS - do not touch this code ! --> <!-- STATS - do not touch this code ! --> <tr> <td bgcolor="#FBFBFB"> <table border="0" width="100%" cellspacing="0" cellpadding="0"> <tr> <td width="4"></td> <td><img src="{CHEM_SCRIPT}images/bars/{BAR_POOL}" width="{WIDTH_BARS}" height="9" border=0 alt="{ALT_ANSWERS}"><font size="1" face="Verdana"> <b>{POURCENT_ANSWERS}</b>%</font><br><font size="1" face="Arial">{POLL_ANSWER}</font></td> <td width="4"></td> </tr> <tr> <td align="center" height="3" bgcolor="#FBFBFB" colspan="3"><img border="0" src="{CHEM_SCRIPT}images/blank.gif" width="1" height="7"></td> </tr> </table> </td> </tr> <!-- /STATS - do not touch this code ! --> <!-- GOFORM - do not touch this code ! --> <tr> <td align="center" height="1" bgcolor="#FBFBFB"><img border="0" src="{CHEM_SCRIPT}images/blank.gif" width="1" height="5"></td> </tr> <tr> <td align="center" height="38" bgcolor="#FBFBFB"><a href="javascript: void(0);"><img border="0" src="{CHEM_SCRIPT}images/boutons/voter2.gif" width="30" height="13" alt="{ALT_VOTER}" onclick="voter_{ID_POLL}();" /></a><br> <font size="1" face="Arial"><a href="javascript: popup_apoll2_{ID_POLL}('{CHEM_SCRIPT}results.php?id_poll={ID_POLL}',{WIDTH_POP_UP},300,'menubar=no,scrollbars=yes,statusbar=no', 'results');" style="color: #000000; text-decoration: none">{LANG_RESULTATS}</a> | <a href="{CHEM_SCRIPT}index.php" style="color: #000000; text-decoration: none">{LANG_ARCHIVES}</a></font> </td> </tr> <!-- GOFORM - do not touch this code ! --> <!-- AFTERSTATS - do not touch this code ! --> <tr> <td align="middle" bgColor="#FBFBFB" height="20"> <table border="0" width="100%" cellspacing="0" cellpadding="0"> <tr> <td width="45%"><font size="1" face="Verdana"> {NB_VOTES} {LANG_VOTES}</font></td> <td width="55%" align="right"><font size="1" face="Verdana"><a href="{CHEM_SCRIPT}index.php" style="color: #000000; text-decoration: none"><b>{LANG_ARCHIVES}</b></a> </font></td> </tr> </table> </td> </tr> <!-- /AFTERSTATS - do not touch this code ! --> </form> </table> </td> </tr> </table>
Voici le code la page qui gère le sondage (poll.php):

Code : Tout sélectionner

<?php /////////////////////////////////////////////// // @lex Poll2 // // by Soulard Alexis - 2003 // // http://www.alexphpteam.com/ // // all right reserved // /////////////////////////////////////////////// error_reporting(0); DEFINE("APOLL", true); //----------------------- sécurité if (!function_exists("safety_verif_poll2")){ function safety_verif_poll2($indice){ global $HTTP_GET_VARS, $_GET, $HTTP_POST_VARS, $_POST, $HTTP_COOKIE_VARS, $_COOKIE, $HTTP_POST_FILES, $_FILES; return ($HTTP_GET_VARS[$indice] or $_GET[$indice] or $HTTP_POST_VARS[$indice] or $_POST[$indice] or $HTTP_COOKIE_VARS[$indice] or $_COOKIE[$indice] or $HTTP_POST_FILES[$indice] or $_FILES[$indice]) ? false : true; } } if (!safety_verif_poll2('chem_script_apoll2') or !safety_verif_poll2('id_poll_apoll2') or !safety_verif_poll2('id_rubrique_apoll2') or !safety_verif_poll2('verif_ok_vote_apoll2')) die("Safety error."); //----------------------- fichiers à inclure if (!$chem_script_apoll2) $chem_script_apoll2 = "./"; if (file_exists($chem_script_apoll2."config/extension.inc") && $verif_ok_vote_apoll2 != 'no'){ include($chem_script_apoll2."config/extension.inc"); include($chem_script_apoll2."include/poll_include.".$alex_poll_ext); } //****************************************************** // VOTER //****************************************************** if ($HTTP_GET_VARS[$nameExtVote]){ //on regarde si la personne peut ou non voter pour le sondage sélectionné if (!$HTTP_COOKIE_VARS[$nameCookie."_".$HTTP_GET_VARS[$nameIdSondVote]]){ $time_now = time(); //on regarde si le sondage est encore valide pour voter recup_infos_base("alex_poll_sondages", "nb_sond", "type_vote", "WHERE (id_sondage='".$HTTP_GET_VARS[$nameIdSondVote]."' and last_ip_vote<>'".$HTTP_SERVER_VARS['REMOTE_ADDR']."' and statut<>3) and (not deb_sondage or (".$time_now.">=deb_sondage and ".$time_now."<fin_sondage))"); //sondage encore ok pour le vote if ($nb_sond > 0){ //on sauvegarde dans un tableau les ids de chacune des réponses. //les ids ne sont pas enregistrées dans le html pour éviter toute tentative de "triche" recup_infos_base("alex_poll_reponses", "nbre_reponses", "id_reponse", "WHERE id_sondage='".$HTTP_GET_VARS[$nameIdSondVote]."'", "ORDER BY id_reponse"); //choix unique - sauvegarde de la réponse $insert_vote = false; if ($table_type_vote[1] == "unique"){ $query = "UPDATE ".$name_table['alex_poll_reponses']." SET nb_votes=nb_votes+1 WHERE id_reponse='".$table_id_reponse[$HTTP_POST_VARS['rep_poll']]."'"; $result = $f_db_connexion -> sql_query($query); if ($HTTP_POST_VARS['rep_poll']) $insert_vote = true; } //choix multiple else if ($table_type_vote[1] == "multiple"){ //on boucle suivant chaque réponse for ($i=1; $i<=$nbre_reponses; $i++){ //bouton radio coché, on enregistre le vote if ($HTTP_POST_VARS['rep_poll_'.$i]){ $query = "UPDATE ".$name_table['alex_poll_reponses']." SET nb_votes=nb_votes+1 WHERE id_reponse='".$table_id_reponse[$i]."'"; $result = $f_db_connexion -> sql_query($query); $insert_vote = true; } } } //on sauvegarde le vote uniquement si l'utilisateur avait donné une réponse if ($insert_vote){ //le visiteur vient de voter ${"vote_save_".$HTTP_GET_VARS[$nameIdSondVote]} = true; //on place le cookie @setcookie($nameCookie."_".$HTTP_GET_VARS[$nameIdSondVote],1,time()+$delai_cookie_vote,"/"); //## on enregistre le vote ## //sauvegarde de la dernière ip à avoir voté pour ce sondage $query = "UPDATE ".$name_table['alex_poll_sondages']." SET last_ip_vote='".$HTTP_SERVER_VARS['REMOTE_ADDR']."' WHERE id_sondage='".$HTTP_GET_VARS[$nameIdSondVote]."'"; $result = $f_db_connexion -> sql_query($query); } } } //si le vote était dans une popup on retourne à cette dernière if ($HTTP_GET_VARS['popup']){ header("Location: popup.php?".$nameIdSondVote."=".$HTTP_GET_VARS[$nameIdSondVote]); exit(); } else{ header("Location:".$HTTP_SERVER_VARS['HTTP_REFERER']."?".eregi_replace("(&)*(".$nameExtVote."|".$nameIdSondVote.")=[0-9]*", "", $HTTP_SERVER_VARS['QUERY_STRING'])); exit(); } } //******************************************************************** // SI LE SONDAGE A AFFICHER FAIT PARTIE D'UN GROUPE, ON LE SELECTIONNE //******************************************************************** if (isset($id_rubrique_apoll2)){ if ($id_rubrique_apoll2 == "") $id_rubrique_apoll2 = 0; //on récupère l'id du sondage actif membre du groupe choisi recup_infos_base("alex_poll_sondages", "nbre_sondages", "id_sondage", "WHERE statut='1' and id_rubrique='".$id_rubrique_apoll2."'"); if (!$table_id_sondage[1]) die($f_lang['no_sond_actif_for_groupe']); else $id_poll_apoll2 = $table_id_sondage[1]; } //****************************************************** // ON REGARDE SI LE VISITEUR PEUT OU NON VOTER //****************************************************** $vote_permis = true; if ($HTTP_COOKIE_VARS[$nameCookie."_".$id_poll_apoll2]) $vote_permis = false; else{ $time_now = time(); //on regarde si le sondage est toujours valide pour le vote if (!count_elements("alex_poll_sondages", "id_sondage", "WHERE (id_sondage='".$id_poll_apoll2."' and last_ip_vote<>'".$HTTP_SERVER_VARS['REMOTE_ADDR']."' and statut<>3) and (not deb_sondage or (".$time_now.">=deb_sondage and ".$time_now."<fin_sondage))")) $vote_permis = false; } //****************************************************** // SI L'UTILISATEUR PEUT VOTER ON AFFICHE LE FORMULAIRE //****************************************************** if (!isset($afficher_archives)) $afficher_archives = true; if ($verif_ok_vote_apoll2 == 'no') $vote_permis = true; //si on affiche le sondage d'exemple de la partie admin if ($vote_permis && !${"vote_save_".$id_poll_apoll2}){ //----------------------- on récupère le sondage à afficher recup_infos_base("alex_poll_sondages", "nbre_sondages", "question, deb_sondage, fin_sondage, skin, statut, type_vote, id_rubrique, last_ip_vote", "WHERE id_sondage='".$id_poll_apoll2."'"); //on récupère les réponses recup_infos_base("alex_poll_reponses", "nbre_reponses", "id_reponse, reponse, nb_votes", "WHERE id_sondage='".$id_poll_apoll2."'", "ORDER BY id_reponse"); //si on affiche le skin d'exemple pour la partie admin "admin/see_skin.php" if ($verif_ok_vote_apoll2) $table_skin[1] = $HTTP_GET_VARS['see_skin_apoll2']; //type de vote $type_vote = ($table_type_vote[1] == "unique") ? "radio" : "checkbox"; //lecture du skin if (!$tpl_poll = read_page_poll2($chem_script_apoll2."templates/skins/".$table_skin[1])) die($f_lang['error_open_skin']); //lecture des variables d'options $tpl_poll = variables_options($tpl_poll); //on parse le template $tpl_poll = parse_tpl_poll2($tpl_poll, $id_poll_apoll2); //----------------------- affichage du sondage echo stripslashes($tpl_poll); } //****************************************************** // L'UTILISATEUR NE PEUT PAS VOTER, ON AFFICHE LES STATS //****************************************************** else{ include($chem_script_apoll2."include/stats.inc.".$alex_poll_ext); } ?>
Code de la page popup.php

Code : Tout sélectionner

<?php /////////////////////////////////////////////// // @lex Poll2 // // by Soulard Alexis - 2003 // // http://www.alexphpteam.com/ // // all right reserved // /////////////////////////////////////////////// DEFINE("APOLL", true); $chem_script_apoll2 = "./"; //----------------------- fichiers à inclure include($chem_script_apoll2."config/extension.inc"); include($chem_script_apoll2."include/poll_include.".$alex_poll_ext); //----------------------- lecture du fichier template de la pop-up if (!$tpl_pop_up = read_page_poll2($chem_script_apoll2."templates/pop-up/pop-up".$extension_fichiers_tpl)) die($f_lang['error_open_skin']); //----------------------- on parse le template $tpl_pop_up = str_replace("{TITLE}", $f_lang['title_popup_voter'], $tpl_pop_up); $tpl_pop_up = str_replace("{LANG_CLOSE_WINDOW}", $f_lang['close_pop_up'], $tpl_pop_up); //----------------------- on sépare le template de la pop-up en 2 morceaux $table_tpl_popup = explode("{POLL}", $tpl_pop_up); //----------------------- affichage de la 1ère partie de la pop-up echo stripslashes($table_tpl_popup[0]); //----------------------- affichage du sondage $afficher_archives = false; $id_poll_apoll2 = $HTTP_GET_VARS[$nameIdSondVote]; $chem_script_apoll2 = "./"; ${"vote_save_".$id_poll_apoll2} = true; // on force l'affichage du résultat du dondage même si le visiteur n'a pas voté include($chem_script_apoll2."poll.php"); //----------------------- affichage de la 2ème partie de la pop-up echo stripslashes($table_tpl_popup[1]); ?>
Merci d'avance pour votre aide

ViPHP
ViPHP | 4039 Messages

31 oct. 2008, 18:57

Sous FF2 osx 10.3, ça marche nickel.
Mais qu'importe. (je suis ici - dernier petit projet)
Berze going social.

ViPHP
ViPHP | 4039 Messages

31 oct. 2008, 19:01

Firebug m'envoie quelques erreurs par contre, peut-être des pistes:
uncaught exception: Permission refusée d'appeler la méthode Location.toString
[Break on this error] undefined
img_scroll is not defined
[Break on this error] <!-- DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
posting.php (line 1)
img_scroll is not defined
[Break on this error] <!-- DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
posting.php (line 1)
img_scroll is not defined
[Break on this error] <!-- DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
posting.php (line 1)
uncaught exception: Permission refusée d'appeler la méthode Location.toString
Mais qu'importe. (je suis ici - dernier petit projet)
Berze going social.

Eléphant du PHP | 422 Messages

31 oct. 2008, 19:45

Sous FF 3.0.3 Vista, il n'y a aucun problème

Code : Tout sélectionner

Merci d'avoir pris le temps de voter Comment jugez-vous le travail de Claudio Ranieri ? 119 votes 7.3% Excellent 346 votes 21.3% Très bon 634 votes 39% Bon 383 votes 23.6% Moyen 82 votes 5% Mauvais 16 votes 1% Très mauvais 44 votes 2.7% Désastreux 1624 votes [Fermer cette fenêtre]

ViPHP
ViPHP | 4039 Messages

01 nov. 2008, 00:36

Mais du coup le vote est faussé: ni moi ni caroube ne votions avec une quelconque connaissance du sujet (enfin, je parle pour moi, caroube ?).

Il faut refaire la votation du début.
Mais qu'importe. (je suis ici - dernier petit projet)
Berze going social.

Eléphant du PHP | 422 Messages

02 nov. 2008, 01:24

enfin, je parle pour moi, caroube ?).
Pour moi, pas de problème : le tennis de table n'a aucun secret pour moi :D C'est donc en toute connaissance de cause que j'ai voté.

Avatar du membre
Administrateur PHPfrance
Administrateur PHPfrance | 9782 Messages

02 nov. 2008, 12:18

Pas de problème non plus sous FF 3.0.3 + Windows XP
Quand tout le reste a échoué, lisez le mode d'emploi...