Jameo Posted March 5, 2008 Posted March 5, 2008 how do i put it in twg.php to vote for crystals for v2 thanks Quote
AlabamaHit Posted March 10, 2008 Posted March 10, 2008 Re: Voting For Crystas are you serious? look at the other voting pages.........im amazed that people could pay 300 for codes to a game and can not code at all....... Quote
gurpreet Posted March 10, 2008 Posted March 10, 2008 Re: Voting For Crystas *cough* illegal*cough* Here's one of my voting pages... <?php session_start(); if(get_magic_quotes_gpc() == 0) { foreach($_POST as $k => $v) { $_POST[$k]=addslashes($v); } foreach($_GET as $k => $v) { $_GET[$k]=addslashes($v); } } require "global_func.php"; if($_SESSION['loggedin']==0) { header("Location: login.php");exit; } $userid=$_SESSION['userid']; include "config.php"; global $_CONFIG; define("MONO_ON", 1); require "class/class_db_{$_CONFIG['driver']}.php"; $db=new database; $db->configure($_CONFIG['hostname'], $_CONFIG['username'], $_CONFIG['password'], $_CONFIG['database'], $_CONFIG['persistent']); $db->connect(); $c=$db->connection_id; $is=$db->query("SELECT u.*,us.* FROM users u LEFT JOIN userstats us ON u.userid=us.userid WHERE u.userid=$userid"); $ir=$db->fetch_row($is); $q=$db->query("SELECT * FROM votes WHERE userid=$userid AND list='trpg'"); if($db->num_rows($q)) { print "You have already voted at Top RPG Games today!"; } else { $db->query("INSERT INTO votes values ($userid,'trpg')"); $db->query("UPDATE users SET crystals=crystals+12 WHERE userid=$userid"); header("Location:http://www.toprpgames.com/vote.php?idno=1604"); exit; } ?> Quote
Wprincess Posted May 6, 2008 Posted May 6, 2008 Re: Voting For Crystas How do I get it to show up on site that I have already voted Sites Reward Voted Today? Cast Vote vote link 12 crystals yes/no vote always says no even if I have voted Quote
Magictallguy Posted May 9, 2008 Posted May 9, 2008 Re: Voting For Crystals This will obviously need to be done and implemented into your PHP but here you go! You will also need a few SQL's..May as well add a full mod on xD Stick this somewhere on your voting.php page (remove the <?php and ?>) <?php include "globals.php"; if($ir['voted'] == 1) { $voted = "<font color=green>Yes</font>"; } else { $voted = "<font color=red>No</font>"; } <table> <tr> <td>Sites</td> <td>Reward</td> <td>Voted Today?</td> <td>Cast Vote</td> </tr> <tr> <td>vote link</td><td>12 crystals</td><td>$voted</td><td>your href to vote</td> </tr> </table> ?> Very basic but there you go.. EDIT: For got to include the globals file! Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.