Fork me on GitHub

Rapport de message :*
 

Re: Laisser le bouton voter dans le bloc de sondage

Titre du sujet : Re: Laisser le bouton voter dans le bloc de sondage
par francois21 sur 31/10/2007 13:29:12

Je pense que mon problème viens du fichier index.php à partir de la 76
if ( $xoopsUser ) {
                if ( 
XoopsPollLog::hasVoted($poll_idxoops_getenv('REMOTE_ADDR'), $xoopsUser->getVar("uid")) ) {
                    
setcookie("voted_polls[$poll_id]"10);
                    
$msg _PL_ALREADYVOTED;
                } else {
                    
$poll->vote($HTTP_POST_VARS['option_id'], xoops_getenv('REMOTE_ADDR'), $xoopsUser->getVar("uid"));
                    
$poll->updateCount();
                    
setcookie("voted_polls[$poll_id]"10);
                    
$msg _PL_THANKSFORVOTE;
                }
            } else {
                if ( 
XoopsPollLog::hasVoted($poll_idxoops_getenv('REMOTE_ADDR')) ) {
                    
setcookie("voted_polls[$poll_id]"10);
                    
$msg _PL_ALREADYVOTED;
                } else {
                    
$poll->vote($HTTP_POST_VARS['option_id'], xoops_getenv('REMOTE_ADDR'));
                    
$poll->updateCount();
                    
setcookie("voted_polls[$poll_id]"10);
                    
$msg _PL_THANKSFORVOTE;
                }
            }
        }

Je le changerais bien par ca
if ( $xoopsUser ) {
                if ( 
XoopsPollLog::hasVoted($poll_idxoops_getenv('REMOTE_ADDR'), $xoopsUser->getVar("uid")) ) {
                    
setcookie("voted_polls[$poll_id]"10);
                    
$msg _PL_ALREADYVOTED;
                } else {
                    
$poll->vote($HTTP_POST_VARS['option_id'], xoops_getenv('REMOTE_ADDR'), $xoopsUser->getVar("uid"));
                    
$poll->updateCount();
                    
setcookie("voted_polls[$poll_id]"10);
                    
$msg _PL_THANKSFORVOTE;
                }
            } else {
                if ( 
XoopsPollLog::hasVoted($poll_idxoops_getenv('REMOTE_ADDR')) ) {
                    
$poll->vote($HTTP_POST_VARS['option_id'], xoops_getenv('REMOTE_ADDR'));
                    
$poll->updateCount();
                    
setcookie("voted_polls[$poll_id]"10);
                    
$msg _PL_THANKSFORVOTE;
                } else {
                    
$poll->vote($HTTP_POST_VARS['option_id'], xoops_getenv('REMOTE_ADDR'));
                    
$poll->updateCount();
                    
setcookie("voted_polls[$poll_id]"10);
                    
$msg _PL_THANKSFORVOTE;
                }
            }
        }

Mais j'ai peur de faire une bétise.
Propulsé avec XOOPS | Graphisme adapté par Tatane, Grosdunord, Montuy337513

155 Personne(s) en ligne (139 Personne(s) connectée(s) sur Forum) | Utilisateur(s): 0 | Invité(s): 155 | Plus ...