Jump to content
MakeWebGames

[mccode] voting Pimped Out


-Genocide-

Recommended Posts

The voting.php that comes with MCCodes v2 is unorganized, and looks shitty, so I pimped it a little bit. :evil:

voting.php

You're unable to view this code.

Viewing code within this forum requires registration, you can register here for free.

 

Peace. :mrgreen:

*EDIT* Ok, there are lots of questions about this simple little modification, I am going to attempt to answer most of them real fast, but I just woke up and its 5:35am here, so excuse me.

1. Does this code require SQL?

No, you do not need to install any SQL at all to use this mod.

2. How do you make the no change to a yes?

Simple...this mod querys the "votes" table of the database with this part of the code:

You're unable to view this code.

Viewing code within this forum requires registration, you can register here for free.

All you have to do to make the No change to Yes is open the votesite.php (votetorpg.php, votecetwg.php) or something similar to that.

You will see a line like this:

You're unable to view this code.

Viewing code within this forum requires registration, you can register here for free.

right above the voting link. Now all you have to do is make sure that the query in this part of the code:

You're unable to view this code.

Viewing code within this forum requires registration, you can register here for free.

matches the query in this part of the code:

You're unable to view this code.

Viewing code within this forum requires registration, you can register here for free.

 

Example:

This is the code found in the votesite.php

You're unable to view this code.

Viewing code within this forum requires registration, you can register here for free.

 

Ok, see where it says 'votesite'? you will need to edit voting.php to match...like this:

Original:

You're unable to view this code.

Viewing code within this forum requires registration, you can register here for free.

 

Edited:

You're unable to view this code.

Viewing code within this forum requires registration, you can register here for free.

 

Pay close attention to the first query....notice I have edited it to match. The No will now change to a Yes once I have voted.

3. How do I add a new voting site?

This is really easy, all you have to do is copy what I already have, then modify it to match the new voting site.

Copy This:

You're unable to view this code.

Viewing code within this forum requires registration, you can register here for free.

 

Add the code above right before this:

 

 

Find this:

You're unable to view this code.

Viewing code within this forum requires registration, you can register here for free.

 

Then add a query for your new voting site like this:

You're unable to view this code.

Viewing code within this forum requires registration, you can register here for free.

 

Ok, now go back to what you added right before the end table code and edit it to match the one you just added for your new vote site:

You're unable to view this code.

Viewing code within this forum requires registration, you can register here for free.

 

See where I have edited it to match the $vs query? Simple shit....

I think that is all the questions about this mod, if you have more, post and I will explain.

Peace. :mrgreen:

Link to comment
Share on other sites

Re: voting.php Pimped Out (Free)

about a week ago I altered my VOTE links under my header to turn red when someone had not voted, seems to help a bit, and I actually finally made the postbacks from the sites trigger the rewards.

Nice work Genocide

Link to comment
Share on other sites

  • 3 months later...
  • 2 weeks later...

Re: [mccode] voting Pimped Out

myne sez this :-(

Vote For Us

Vote for us at various RPG toplists and be rewarded.

Top List Reward Voted Today? Cast Vote

Stage 3 Top Games 10 Crystals

Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/imgame/public_html/voting.php on line 27

No Vote

TBAB Top Games $1,000

Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/imgame/public_html/voting.php on line 37

No Vote

Game Sites 200 Energy Refill

Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/imgame/public_html/voting.php on line 47

No

Link to comment
Share on other sites

Guest Anonymous

Re: [mccode] voting Pimped Out

Are u useing mccode v1.1 :|

<?php

session_start();

require "global_func.php";

if($_SESSION['loggedin']==0) { header("Location: login.php");exit; }

$userid=$_SESSION['userid'];

require "header.php";

$h = new headers;

$h->startheaders();

include "mysql.php";

global $c;

$is=mysql_query("SELECT u.*,us.* FROM users u LEFT JOIN userstats us ON u.userid=us.userid WHERE u.userid=$userid",$c) or die(mysql_error());

$ir=mysql_fetch_array($is);

check_level();

$fm=money_formatter($ir['money']);

$cm=money_formatter($ir['crystals'],'');

$lv=date('F j, Y, g:i a',$ir['laston']);

$h->userdata($ir,$lv,$fm,$cm);

$h->menuarea();

$s3=mysql_query("SELECT * FROM votes WHERE userid=$userid AND list='stage3'",$c);

$tb=mysql_query("SELECT * FROM votes WHERE userid=$userid AND list='tbab'",$c);

$gs=mysql_query("SELECT * FROM votes WHERE userid=$userid AND list='gs200'",$c);

print "<h3>Vote For Us</h3>

Vote for us at various RPG toplists and be rewarded.

<table cellspacing='1' border='0' cellpadding='3' class='table' width='90%'>

<tr background='tablehgrad.png'><th>Top List</th><th>Reward</th><th>Voted Today?</th><th>Cast Vote</th></tr>

<tr><td><center>Stage 3 Top Games</td><td><center>10 Crystals</td><td>";

if(mysql_num_rows($s3))

{

print "<font color='red'><center>Yes</font>";

}

else

{

print"<center><font color='green'>No</font>";

}

print "<td><center>Vote</td></tr>

<tr><td><center>TBAB Top Games</td><td><center>$1,000</td><td>";

if(mysql_num_rows($tb))

{

print "<font color='red'><center>Yes</font>";

}

else

{

print"<center><font color='green'>No</font>";

}

print "<td><center>Vote</td></tr>

<tr><td><center>Game Sites 200</td><td><center>Energy Refill</td><td>";

if(mysql_num_rows($gs))

{

print "<font color='red'><center>Yes</font>";

}

else

{

print"<center><font color='green'>No</font>";

}

print "<td><center>Vote</td></tr>

</table>";

$h->endpage();

?>

Ithink it will work just replaced just include "globals.php";

Link to comment
Share on other sites

  • 2 weeks later...
  • 1 month later...

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...