vue Système de vote pour 2moons 1.6.1
Kommunauty
Connexion
Inscription

Système de vote pour 2moons 1.6.1


kiki9999 Messages : 85

Bonjour j'ai fait un système de vote pour 2moons 1.6.1 mais j ai un petit problème, car l'utilisateur reçoit l'anti-matière sans avoir cliquer sur le lien pour voter

Pouvez vous m'aider a résoudre sa

J'ai un fichier ShowVotePage.php a mette dans includes/pages/

<?php

if(!defined('INSIDE')){ die(header("location:../../"));}
function ShowVotePage()
{
global $USER, $PLANET, $LNG, $db,  $Timestamp;

$darkmatter = $USER['darkmatter'];
$IP = $_SERVER["REMOTE_ADDR"];
$Timestamp = time();


$donnees = $db->query("SELECT `timestamp` FROM  uni1_vote WHERE IP='".$IP."';");
while($foobar = $donnees->fetch_object())
{
$temps = $foobar->timestamp + 7200;
}

$temps_complet = gmdate ( " G:i:s", $temps );
$temps_ajouté = $temps + 7200;
$temps_pour_vote = gmdate ( " G:i:s", $temps_ajouté );
$temps_diff = $temps - $Timestamp;
$Temps_Fini= $temps -time();
$temps_diff_affiché = gmdate ( " G:i:s", $temps_diff );
$phrase_vote = "Tu a voté a $temps_complet tu doit attendre jusqu'a $temps_pour_vote Il te reste $temps_diff_affiché a attendre pour un nouveaux vote";



if (time() >= $temps){

$temps = $db->query("DELETE FROM uni1_vote WHERE IP='$IP'");
$temps = $db->query("INSERT INTO uni1_vote VALUES('$IP', '$Timestamp')");



$db->query("UPDATE ".USERS." SET `darkmatter` = darkmatter+100 WHERE `id` = ".$USER['id'].";");

}
$template = new template();
$template->show("vote_overview.tpl");
}
?>

un fichier vote_overview.tpl a mettre dans styles/templates

{include file="overall_header.tpl"}
{include file="left_menu.tpl"}
{include file="overall_topnav.tpl"}
<div id="content">

<table>
    <th><center>Un vote effectue = 100 antimatieres</center></th>
    <tr>
        <td>
<a href="http://www.root-top.com/topsite/topxnova/in.php?ID=124"><img src="http://img.root-top.com/topsite/topxnova/banner.gif" border="0" alt="tld wars" title="tld wars"><br />TLD-Wars</a>
        </td>
    </tr>
</table>

</div>
{include file="planet_menu.tpl"}
{include file="overall_footer.tpl"}

et pour finir rajouter dans games.php ceci

    case 'vote':
        include_once(ROOT_PATH . 'includes/pages/ShowVotePage.php');
        ShowVotePage();
    break;  
//  ----------------------------------------------------------------------------------------------------------------------------------------------//
samedi 5 mai 2012

Répondre Pour répondre, tu dois d'abord t'inscrire rapidement sur Kommunauty. Rejoins-nous vite !