Jump to content
MakeWebGames

Recommended Posts

Posted

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;

}

?>

  • 1 month later...
Posted

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

Posted

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!

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...