Enjoy.
If your SQL tables only have a reborns column, remove the + creborns in ranking.php and main-rank.php
Make sure you change the links and images in Vote.php And Ranking.php. I will make a complete guide to use the vote system, just now now.
If you need more voting sites for vote.php copy the code right below. Be sure to change Gtop to something else and the g in the variables to something else as well.
PHP Code:
$gquery = mysql_query("SELECT *, SUM(`times`) as amount FROM votingrecords WHERE account='".$_SESSION['name']."' AND site='gtop'");
$glasttime = mysql_fetch_array($gquery);
$gamount = $glasttime['amount'];
$ginsertnew = false;
if ($gamount == "") {
$ginsertnew = true;
}
$gtimecalc = $time - $glasttime['date'];
if (!$ginsertnew) {
if ($gtimecalc < 43200) {
echo '<center>GTop voting completed!<br /><br /></center>';
} else {
echo "<center><!-- Begin Gtop100 voting code --><a href='?cype=dovote&site=gtop' title='MapleStory Top 100' target='_blank'><img src='http://www.gtop100.com/images/votebutton.jpg' border='0' alt='MapleStory Top 100'/></a><!-- End Gtop100s voting code -->";
}
}else{
echo "<center><!-- Begin Gtop100 voting code --><a href='?cype=dovote&site=gtop' title='MapleStory Top 100' target='_blank'><img src='http://www.gtop100.com/images/votebutton.jpg' border='0' alt='MapleStory Top 100'/></a><!-- End Gtop100s voting code --> ";
}
You also need to add in one of these. Change the gtop to what you made it up there.
PHP Code:
if($site=="gtop"){
header("Location: http://www.gtop100.com/in.php?site=49864");
}
Reborn-Based Rankings-
sources/public/main-rank.php
PHP Code:
<?php
/*
Copyright (C) 2009 Murad <Murawd>
Josh L. <Josho192837>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
echo "
<table width='100%' border='0' cellpadding='0' cellspacing='0'>
<tr>
<td>
<table width='100%' border='0' cellpadding='0' cellspacing='0'>
<tr>
<td width='100'>
<a href='?cype=main&page=ranking'>
<img src='".$styledir."/images/bbs_ranking_title.gif' alt='Ranking' border='0' />
</a>
</td>
<td align='right'>
<a href='?cype=main&page=ranking'>Total</a> |
<a href='?cype=main&page=ranking&order=fame&job='>Fame</a> |
<a href='?cype=main&page=ranking&order=wins&job='>FoJ</a>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td />
</tr>
<tr>
<td style='background-color:#b8b8b8' height='3' />
</tr>
<tr>
<td height='4' />
</tr>";
$gc = mysql_query("SELECT * FROM `characters` WHERE `gm`='0' ORDER BY `reborns` + `creborns` DESC, `level` DESC,`exp`") or die(mysql_error());
echo "
<tr>
<td>
<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\">
<tr>
<td rowspan=\"2\">
<table border=\"0\" width=\"100%\" cellspacing=\"0\" cellpadding=\"4\">";
$p = 0;
while($player = mysql_fetch_array($gc) and $p <=4){
$char = $player['accountid'];
$ban1 = mysql_query("SELECT banned FROM accounts WHERE id = $char");
$ban = mysql_fetch_array($ban1);
if ($ban["banned"] == 1){
}else{
$p++;
if($player["job"] == "121"){
$job = "White Knight";
}elseif($player["job"] == "000"){
$job = "Beginner";
}elseif($player["job"] == "100"){
$job = "Swordsman";
}elseif($player["job"] == "110"){
$job = "Fighter";
}elseif($player["job"] == "120"){
$job = "Page";
}elseif($player["job"] == "130"){
$job = "Spearman";
}elseif($player["job"] == "111"){
$job = "Crusader";
}elseif($player["job"] == "121"){
$job = "White Knight";
}elseif($player["job"] == "131"){
$job = "Dragon Knight";
}elseif($player["job"] == "112"){
$job = "Hero";
}elseif($player["job"] == "122"){
$job = "Paladin";
}elseif($player["job"] == "132"){
$job = "Dark Knight";
}elseif($player["job"] == "200"){
$job = "Magician";
}elseif($player["job"] == "210"){
$job = "F/P Wizard";
}elseif($player["job"] == "220"){
$job = "I/L Wizard";
}elseif($player["job"] == "230"){
$job = "Cleric";
}elseif($player["job"] == "211"){
$job = "F/P Mage";
}elseif($player["job"] == "221"){
$job = "I/L Mage";
}elseif($player["job"] == "231"){
$job = "Priest";
}elseif($player["job"] == "212"){
$job = "F/P Arch Mage";
}elseif($player["job"] == "222"){
$job = "I/L Arch Mage";
}elseif($player["job"] == "232"){
$job = "Bishop";
}elseif($player["job"] == "300"){
$job = "Bowman";
}elseif($player["job"] == "310"){
$job = "Hunter";
}elseif($player["job"] == "320"){
$job = "Crossbowman";
}elseif($player["job"] == "311"){
$job = "Ranger";
}elseif($player["job"] == "321"){
$job = "Sniper";
}elseif($player["job"] == "312"){
$job = "Bow Master";
}elseif($player["job"] == "322"){
$job = "Crossbow Master";
}elseif($player["job"] == "400"){
$job = "Rogue";
}elseif($player["job"] == "410"){
$job = "Assassin";
}elseif($player["job"] == "420"){
$job = "Bandit";
}elseif($player["job"] == "411"){
$job = "Hermit";
}elseif($player["job"] == "421"){
$job = "Chief Bandit";
}elseif($player["job"] == "412"){
$job = "Night Lord";
}elseif($player["job"] == "422"){
$job = "Shadower";
}elseif($player["job"] == "500"){
$job = "Pirate";
}elseif($player["job"] == "510"){
$job = "Brawler";
}elseif($player["job"] == "520"){
$job = "Gunslinger";
}elseif($player["job"] == "511"){
$job = "Marauder";
}elseif($player["job"] == "521"){
$job = "Outlaw";
}elseif($player["job"] == "512"){
$job = "Buccaneer";
}elseif($player["job"] == "522"){
$job = "Corsair";
}elseif($player["job"] == "900"){
$job = "GM";
}elseif($player["job"] == "910"){
$job = "SuperGM";
}
if ($p == 1){
echo "
<tr>
<td valign=\"top\" rowspan=\"6\">
<img src=\"GD/?n=".$player['name']."\" border=\"0\" name=\"top5\" alt='".$player['name']."' />
</td>
</tr>";
}
echo "
<script type=\"text/javascript\">
var image = new Image();
image.src = \"GD/?n=".$player['name']."\";
</script>
<tr onmouseover=\"roll('top5', 'GD/?n=".$player['name']."'); this.style.backgroundColor='';\" onmouseout=\"this.style.backgroundColor=''\">
<td class=\"toprank\">
<img src=\"".$styledir."/images/bbs_ranking_no0".$p.".gif\" width=\"14\" height=\"15\" alt='#".$p."' />
</td>
<td>
<a href=\"#".$player['name']."\">".$player['name']."</a>
</td>
<td>
".$player['level']."
</td>
<td align=\"center\">
".$job."
</td>
</tr>";
}
}
echo "
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>";
?>
sources/public/ranking.php
PHP Code:
<?php
/*
Copyright (C) 2009 Murad <Murawd>
Josh L. <Josho192837>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
// Original Author: Darkmagic
// Modified by: Cype Developments
// MOAR modified by: Architect/J03Wh4t of URBZMS!
$getjob = mysql_real_escape_string(@$_GET['job']);
if(@$getjob != NULL) {
$cygnus = '';
if (isset($_GET['ck'])) {
$cygnus = " AND characters.job >= '1000'";
}
$show = $cygnus." AND characters.job LIKE '".$getjob."%'";
} else {
$show = "";
}
$start = mysql_real_escape_string(@$_GET['start']);
if(@$start) {
$start = $start;
} else {
$start = 0;
}
$search = @$_GET['search'];
if(isset($search)) {
$search = mysql_real_escape_string(@$_POST['search']);
$csearch = " AND characters.name LIKE '".$search."%'";
} else {
$csearch = "";
}
$order = mysql_real_escape_string(@$_GET['order']);
if(@$order) {
$order = $order." DESC,";
} else {
$order = "";
$result2 = mysql_query("SELECT level, exp, characters.name name, meso, job, fame, logo, logoColor, guilds.name guildname, logoBG, logoBGColor, COUNT(eventstats.characterid) wins FROM accounts, characters LEFT JOIN guilds ON guilds.guildid = characters.guildid LEFT JOIN eventstats ON characters.id=eventstats.characterid WHERE characters.gm < '$gmlevel' AND accountid = accounts.id AND banned = 0 ".$show." ".$csearch." GROUP BY characters.id DESC ORDER BY $order reborns + creborns DESC, level DESC, exp DESC") or die("IT IS LINE ". __LINE__ . "<br />" . mysql_error());
$num_players=mysql_num_rows($result2);
}
if(isset($search)){
$row_number = 0;
$int = 0;
while(($row = mysql_fetch_array( $result2 )) && !$row_number){
if(strtolower($row['name']) == strtolower($search)){
$row_number = $int;
}
$int++;
}
if($row_number){
$start = $row_number - ($row_number % 5);
}
}
$result = mysql_query("SELECT level, exp, characters.name name, meso, job, fame, logo, logoColor, guilds.name guildname, logoBG, logoBGColor, reborns, creborns, COUNT(eventstats.characterid) wins FROM accounts, characters LEFT JOIN guilds ON guilds.guildid = characters.guildid LEFT JOIN eventstats ON characters.id=eventstats.characterid WHERE characters.gm < '$gmlevel' AND accountid = accounts.id AND banned = 0 ".$show."".$csearch." GROUP BY characters.id DESC ORDER BY $order reborns + creborns DESC, level DESC, exp DESC LIMIT $start, 5") or die("IT IS LINE ". __LINE__ . "<br />" . mysql_error());
echo "
<table border='0' style=\"height:100%;width:570px;border:solid 1px #BBB\">
<tr class=\"navtitle\" style=\"height:25px\">
<th colspan=\"2\" style=\"width:auto\"><a href=\"?cype=main&page=ranking\">".$servername." Rankings</a></th>
</tr>
<tr class=\"menulink\">
<td class=\"tdbox\">";
if($start)
echo "
<table border='0' width='100%'>
<tr>
<td align=\"left\">
<a href='?cype=main&page=ranking&start=". ($start - 5) ."&order=". isset($_POST['order']) ."&job=". isset($_POST['job']) ."'>
<img src='".$styledir."/images/prev.gif' alt='Previous' style='border:0px;' />
</a>";
else
echo "
<table border='0' width='100%'>
<tr>
<td align=\"left\">
<img src='".$styledir."/images/prev.gif' alt='Previous' style='border:0px;' /> ";
if($num_players % 5)
$num_players = $num_players - ($num_players % 5);
else
$num_players -= 5;
if($start <= $num_players - 5)
echo "
<a href='?cype=main&page=ranking&start=". ($start + 5) ."&order=". isset($_POST['order']) ."&job=". isset($_POST['job']) ."'>
<img src='".$styledir."/images/next.gif' alt='Next' style='border:0px;' />
</a>";
else
echo "
<img src='".$styledir."/images/next.gif' alt='Next' />";
echo "
</td>";
echo "
<td align='right' colspan='9'>
<form id='search_form' method='post' action='?cype=main&page=ranking&order=".isset($_POST['order'])."&job=".isset($_POST['job'])."&search'>
<input type='text' name='search' id='s' onmousedown=\"if(this.value=='Character Search'){this.value='';}\" onblur=\"if(this.value==''){this.value='Character Search'}\" value='' class='swap_value' />
<input type='hidden' name='start' value='".isset($_POST['start'])."' />
<input type='hidden' name='order' value='".isset($_POST['order'])."' />
<input type='hidden' name='job' value='".isset($_POST['job'])."' />
<input type='submit' value='Search' id='go' alt='Search' title='Search' />
</form>
</td>
</tr>
</table>
</td>
</tr>";
echo "
<tr>
<td>
<table style='border:.3em solid #505151;' border='0' width='100%' cellspacing='0'>";
echo "
<tr style='height: 40px;' align ='center' valign='middle'>
<td class='ranktitle'>
<b>Rank</b>
</td>
<td class='ranktitle'>
<b>Character</b>
</td>
<td class='ranktitle'>
<b>Name</b>
</td>
<td class='ranktitle'>
<b>Fame</b>
</td>
<td class='ranktitle'>
<b>Rebirths</b>
</td>
<td class='ranktitle'>
<b>Job</b>
</td>
<td style='background:#727575; color: #FFF; padding:10px;'>
<b>Level</b>
</td>
</tr>";
$ranking=$start;
$backcolor="ffffff";
while($row = mysql_fetch_array( $result )) {
$totalrb = $row['reborns'] + $row['creborns'];
if(@$backcolor2 == "ffffff")
$backcolor2 = "f3f3f3";
else
$backcolor2 = "ffffff";
if(@$row_number == $ranking && $search){
$backcolor = "cacaca";
}
else{
$backcolor=$backcolor2;
}
$ranking++;
echo "
<tr>
<td style='border-bottom:1px solid #e3e3e3;' align='center' bgcolor='#".$backcolor."'>
<b>$ranking</b>
</td>
<td style='border-bottom:1px solid #e3e3e3;' align='center' bgcolor='#".$backcolor."'>
<b><img src='GD/?n=".$row['name']."' alt='".$row['name']."' /></b>
</td>
<td style='border-bottom:1px solid #e3e3e3;' align='center' bgcolor='#".$backcolor."'>
<a href='#".$row['name']."'>
<b>".$row['name']."</b>
</a>
<br />";
if($row['guildname'])
echo "
<b>".$row['guildname']."</b>
<br />
<img src='GD/guild.php?back=".$row['logoBG']."&backcolor=".$row['logoBGColor']."&top=".$row['logo']."&topcolor=".$row['logoColor']."' alt='".$row['guildname']."' />";
else
echo "
<b>
<s>Guildless</s>
</b>";
echo "
</td>
<td style='border-bottom:1px solid #e3e3e3;' align='center' bgcolor='#".$backcolor."'>
<b>".$row['fame']."</b>
</td>
<td style='border-bottom:1px solid #e3e3e3;' align='center' bgcolor='#".$backcolor."'>
<b>".$totalrb."</b>
<b>".$totalrb."</b>
</td>
<td style='border-bottom:1px solid #e3e3e3;' align='center' bgcolor='#".$backcolor."'>
<b>";
if($row['job'] == 0)
echo "
<img src='images/class/job_beginner.gif' alt='Beginner' />";
if($row['job'] >= 100 && $row['job'] < 200)
echo "
<img src='images/class/job_warrior.gif' alt='Warrior' />";
if($row['job'] >= 200 && $row['job'] < 300)
echo "
<img src='images/class/job_magician.gif' alt='Magician' />";
if($row['job'] >= 300 && $row['job'] < 400)
echo "
<img src='images/class/job_bowman.gif' alt='Bowman' />";
if($row['job'] >= 400 && $row['job'] < 500)
echo "
<img src='images/class/job_thief.gif' alt='Theif' />";
if($row['job'] >= 500 && $row['job'] < 600)
echo "
<img src='images/class/job_pirate.gif' alt='Pirate' />";
if($row['job'] >= 900 && $row['job'] < 1000)
echo "
<img src='images/class/job_gm.gif' alt='GM' />";
echo "
<br />";
if ($row['job']=="000")
echo "Beginner";
if ($row['job']=="100")
echo "Warrior";
if ($row['job']=="110")
echo "Fighter";
if ($row['job']=="120")
echo "Page";
if ($row['job']=="130")
echo "Spearman";
if ($row['job']=="111")
echo "Crusader";
if ($row['job']=="121")
echo "White Knight";
if ($row['job']=="131")
echo "Dragon Knight";
if ($row['job']=="112")
echo "Hero";
if ($row['job']=="122")
echo "Paladin";
if ($row['job']=="132")
echo "Dark Knight";
if ($row['job']=="200")
echo "Magician";
if ($row['job']=="210")
echo "Wizard";
if ($row['job']=="220")
echo "Wizard";
if ($row['job']=="230")
echo "Cleric";
if ($row['job']=="211")
echo "Mage";
if ($row['job']=="221")
echo "Mage";
if ($row['job']=="231")
echo "Priest";
if ($row['job']=="212")
echo "Arch Mage";
if ($row['job']=="222")
echo "Arch Mage";
if ($row['job']=="232")
echo "Bishop";
if ($row['job']=="300")
echo "Bowman";
if ($row['job']=="310")
echo "Hunter";
if ($row['job']=="320")
echo "Crossbowman";
if ($row['job']=="311")
echo "Ranger";
if ($row['job']=="321")
echo "Sniper";
if ($row['job']=="312")
echo "Bow Master";
if ($row['job']=="322")
echo "Crossbow Master";
if ($row['job']=="400")
echo "Thief";
if ($row['job']=="410")
echo "Assassin";
if ($row['job']=="420")
echo "Bandit";
if ($row['job']=="411")
echo "Hermit";
if ($row['job']=="421")
echo "Chief Bandit";
if ($row['job']=="412")
echo "Night Lord";
if ($row['job']=="422")
echo "Shadower";
if ($row['job']=="500")
echo "Pirate";
if ($row['job']=="510")
echo "Brawler";
if ($row['job']=="520")
echo "Gunslinger";
if ($row['job']=="511")
echo "Marauder";
if ($row['job']=="521")
echo "Buccaneer";
if ($row['job']=="512")
echo "Outlaw";
if ($row['job']=="522")
echo "Corsair";
if ($row['job']=="900")
echo "GMs";
if ($row['job']=="910")
echo "SuperGM";
echo "
</b>
</td>
<td style='border-bottom:1px solid #e3e3e3;' align='center' bgcolor='#".$backcolor."'>
<b>
".$row['level']."
<font size='-3' color='green'>
<br />(".$row['exp'].")
</font>
</b>
</td>
</tr>";
}
echo "
</table><br />
<table border='0' width='100%' cellspacing='0'>
<tr valign='top'>
<td>";
if($start)
echo "
<a href='?cype=main&page=ranking&start=". ($start - 5) ."&order=". isset($_POST['order']) ."&job=". isset($_POST['job']) ."'>
<img src='$styledir/images/prev.gif' alt='Previous' style='border:0px;' />
</a>";
else
echo "
<img src='$styledir/images/prev.gif' alt='Previous' style='border:0px;' /> ";
if($num_players % 5)
$num_players = $num_players - ($num_players % 5);
else
$num_players -= 5;
if($start <= $num_players - 5)
echo "
<a href='?cype=main&page=ranking&start=". ($start + 5) ."&order=". isset($_POST['order']) ."&job=". isset($_POST['job']) ."'>
<img src='$styledir/images/next.gif' alt='Next' style='border:0px;' />
</a>";
else
echo "
<img src='$styledir/images/next.gif' alt='Next' style='border:0px;' />";
echo "
</td>
<td class='regtext' align='center'>
<b>
<a href='?cype=main&page=ranking&order=level&job=". isset($_POST['job']) ."'>
Level
</a>
|
<a href='?cype=main&page=ranking&order=fame&job=".isset($_POST['fame'])."'>
Fame
</a>
|
<a href='?cype=main&page=ranking&order=wins&job=". isset($_POST['job']) ."'>
FoJ Wins
</a>
</b>
</td>
<td align='right'>
<b>Page: </b>
<select id=\"p_op\" onchange=\"document.location.href='?cype=main&page=ranking&start='+document.getElementById('p_op').value+'&order=". isset($_POST['order'])."&job=".isset($_POST['job'])."';\">";
for( $int = 0; $int <= floor($num_players / 5); $int++){
if( $start == ($int * 5))
echo "
<option selected='selected' value='". ($int * 5) ."'>".($int + 1)."</option>\n";
else
echo "
<option value='". ($int * 5) ."'>".($int + 1)."</option>\n";
}
echo "
</select>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td class=\"tdbox\">
<table width='100%' cellspacing='0' border='0'>
<tr align='center'>
<td>
<a href='?cype=main&page=ranking&order=". $_POST['order'] ."'>
<img src='images/class/job_all.gif' alt='All' />
</a>
</td>
<td>
<a href='?cype=main&page=ranking&order=". $_POST['order'] ."&job=0'>
<img src='images/class/job_beginner.gif' alt='Beginner' />
</a>
</td>
<td>
<a href='?cype=main&page=ranking&order=". $_POST['order'] ."&job=1'>
<img src='images/class/job_warrior.gif' alt='Warrior' />
</a>
</td>
<td>
<a href='?cype=main&page=ranking&order=". $_POST['order'] ."&job=2'>
<img src='images/class/job_magician.gif' alt='Magician' />
</a>
</td>
<td>
<a href='?cype=main&page=ranking&order=". $_POST['order'] ."&job=3'>
<img src='images/class/job_bowman.gif' alt='Bowman' />
</a>
</td>
<td>
<a href='?cype=main&page=ranking&order=". $_POST['order'] ."&job=4'>
<img src='images/class/job_thief.gif' alt='Thief' />
</a>
</td>
<td>
<a href='?cype=main&page=ranking&order=". $_POST['order'] ."&job=5'>
<img src='images/class/job_pirate.gif' alt='Pirate' />
</a>
</td>
</tr>
</table>
</td>
</tr>
</table>";
?>
Voting System
You will need to make two files, vote.php and dovote.php
dovote.php
PHP Code:
<?php
$site = $_GET['site'];
$time = time();
$time = time();
$gquery = mysql_query("SELECT *, SUM(`times`) as amount FROM votingrecords WHERE account='".$_SESSION['name']."' AND site='".$site."'");
$glasttime = mysql_fetch_array($gquery);
$gamount = $glasttime['amount'];
$ginsertnew = false;
if ($gamount == "") {
$ginsertnew = true;
}
$gtimecalc = $time - $glasttime['date'];
if (!$ginsertnew) {
$update = mysql_query("UPDATE votingrecords SET account='".$_SESSION['name']."', date='".time()."', times=times+1 WHERE ip='".$_SERVER['REMOTE_ADDR']."' AND site='".$site."'");
}else{
$update = mysql_query("INSERT INTO votingrecords (`account`, `ip`, `date`, `times`, `site`) VALUES ('".$_SESSION['name']."', '".$_SERVER['REMOTE_ADDR']."', '".time()."', 1, '".$site."')");
}
if (!$update) {
$message = 'Invalid query: ' . mysql_error() . "\n";
$message .= 'Whole query: ' . $update;
die($message);
} else {
$earnedpoints = true;
}
mysql_query("UPDATE `accounts` SET `paypalNX` = paypalNX + '25000' WHERE `id` = ".$_SESSION['id']."") or die(mysql_error());
if($site=="gtop"){
header("Location: http://www.gtop100.com/in.php?site=49864");
}
if($site=="m200"){
header("Location: http://www.maplestory200.com/index.php?do=votes&id=802");
}
if($site=="topl"){
header("Location: http://www.jagtoplist.com/in.php?site=14627");
}
if($site=="mapt"){
header("Location: http://www.ultimateprivateservers.com/maple-story/");
}
if($site=="mmor"){
header("Location: http://www.mmorpgtoplist.com/in.php?site=31021");
}
if($site=="tmmo"){
header("Location: http://www.topmmorpgsites.com");
}
/*WHERE account='".$_SESSION['name']."' AND site='gtop' */
?>
vote.php
PHP Code:
<?php
if(isset($_SESSION['id'])){
echo '<script type=text/javascript>alert("MAKE SURE YOU LOG OUT FROM IN GAME OR YOU WON\'T RECIEVE YOUR NX!")</script>';
$time = time();
$gquery = mysql_query("SELECT *, SUM(`times`) as amount FROM votingrecords WHERE account='".$_SESSION['name']."' AND site='gtop'");
$glasttime = mysql_fetch_array($gquery);
$gamount = $glasttime['amount'];
$ginsertnew = false;
if ($gamount == "") {
$ginsertnew = true;
}
$gtimecalc = $time - $glasttime['date'];
if (!$ginsertnew) {
if ($gtimecalc < 43200) {
echo '<center>GTop voting completed!<br /><br /></center>';
} else {
echo "<center><!-- Begin Gtop100 voting code --><a href='?cype=dovote&site=gtop' title='MapleStory Top 100' target='_blank'><img src='http://www.gtop100.com/images/votebutton.jpg' border='0' alt='MapleStory Top 100'/></a><!-- End Gtop100s voting code -->";
}
}else{
echo "<center><!-- Begin Gtop100 voting code --><a href='?cype=dovote&site=gtop' title='MapleStory Top 100' target='_blank'><img src='http://www.gtop100.com/images/votebutton.jpg' border='0' alt='MapleStory Top 100'/></a><!-- End Gtop100s voting code --> ";
}
$dquery = mysql_query("SELECT *, SUM(`times`) as amount FROM votingrecords WHERE account='".$_SESSION['name']."' AND site='m200'");
$dlasttime = mysql_fetch_array($dquery);
$damount = $dlasttime['amount'];
$dinsertnew = false;
if ($damount == "") {
$dinsertnew = true;
}
$dtimecalc = $time - $dlasttime['date'];
if (!$dinsertnew) {
if ($dtimecalc < 43200) {
echo '<center>Maplestory200 voting completed!<br /><br /></center>';
} else {
echo '<center><a href="?cype=dovote&site=m200"><img border="0" src="http://www.maplestory200.com/default.png" alt="Maple Story Top 200 - Maple Story Private Servers" /></a>';
}
}else{
echo '<center><a href="?cype=dovote&site=m200"><img border="0" src="http://www.maplestory200.com/default.png" alt="Maple Story Top 200 - Maple Story Private Servers" /></a>';
}
$cquery = mysql_query("SELECT *, SUM(`times`) as amount FROM votingrecords WHERE account='".$_SESSION['name']."' AND site='topl'");
$clasttime = mysql_fetch_array($cquery);
$camount = $clasttime['amount'];
$cinsertnew = false;
if ($camount == "") {
$cinsertnew = true;
}
$ctimecalc = $time - $clasttime['date'];
if (!$cinsertnew) {
if ($ctimecalc < 43200) {
echo '<center>Toplist voting completed!<br /><br /></center>';
} else {
echo '<center><a href="?cype=dovote&site=topl"><img src="http://www.jagtoplist.com/images/vbtn88x55.jpg" border="0" alt="Top MapleStory Sites" /></a>';
}
}else{
echo '<center><a href="?cype=dovote&site=topl"><img src="http://www.jagtoplist.com/images/vbtn88x55.jpg" border="0" alt="Top MapleStory Sites" /></a>';
}
$zquery = mysql_query("SELECT *, SUM(`times`) as amount FROM votingrecords WHERE account='".$_SESSION['name']."' AND site='mapt'");
$zlasttime = mysql_fetch_array($zquery);
$zamount = $zlasttime['amount'];
$zinsertnew = false;
if ($zamount == "") {
$zinsertnew = true;
}
$ztimecalc = $time - $zlasttime['date'];
if (!$zinsertnew) {
if ($ztimecalc < 43200) {
echo '<center>Ultimate Private Servers voting completed!<br /><br /></center>';
} else {
echo '<center><a href="?cype=dovote&site=mapt"><img src="http://www.ultimateprivateservers.com/button.png" border="0" alt="MapleStory Private Servers" /></a>';
}
}else{
echo '<center><a href="?cype=dovote&site=mapt"><img src="http://www.ultimateprivateservers.com/button.png" border="0" alt="MapleStory Private Servers" /></a>';
}
$rquery = mysql_query("SELECT *, SUM(`times`) as amount FROM votingrecords WHERE account='".$_SESSION['name']."' AND site='mmor'");
$rlasttime = mysql_fetch_array($rquery);
$ramount = $rlasttime['amount'];
$rinsertnew = false;
if ($ramount == "") {
$rinsertnew = true;
}
$rtimecalc = $time - $rlasttime['date'];
if (!$rinsertnew) {
if ($rtimecalc < 43200) {
echo '<center>MMORPGToplist voting completed!<br /><br /></center>';
} else {
echo '<center><a href="?cype=dovote&site=mmor"><img src="http://www.mmorpgtoplist.com/vote.jpg" border="0" alt="MapleStory Servers"></a>';
}
}else{
echo '<center><a href="?cype=dovote&site=mmor"><img src="http://www.mmorpgtoplist.com/vote.jpg" border="0" alt="MapleStory Servers"></a>';
}
$kquery = mysql_query("SELECT *, SUM(`times`) as amount FROM votingrecords WHERE account='".$_SESSION['name']."' AND site='tmmo'");
$klasttime = mysql_fetch_array($kquery);
$kamount = $klasttime['amount'];
$kinsertnew = false;
if ($kamount == "") {
$kinsertnew = true;
}
$ktimecalc = $time - $klasttime['date'];
if (!$kinsertnew) {
if ($ktimecalc < 43200) {
echo '<center>Top MMORPG Sites voting completed!<br /><br /></center>';
} else {
echo '<center><a href="?cype=dovote&site=tmmo">Top MapleStory sites</a>';
}
}else{
echo '<center><a href="?cype=dovote&site=tmmo">Top MapleStory sites</a>';
}
/*
$time = time();
$query = mysql_query("SELECT *, SUM(`times`) as amount FROM votingrecords WHERE account='".$_SESSION['name']."' OR ip='".$_SERVER['REMOTE_ADDR']."'");
$lasttime = mysql_fetch_array($query);
$amount = $lasttime['amount'];
$insertnew = false;
if ($amount == "") {
$insertnew = true;
}
$timecalc = $time - $lasttime['date'];
if (!$timecalc < 43200) {
echo "<center><!-- Begin Gtop100 voting code --><a href='?cype=dovote&id=GTop%20100' title='MapleStory Top 100' target='_blank'><img src='http://www.gtop100.com/images/votebutton.jpg' border='0' alt='MapleStory Top 100'/></a><!-- End Gtop100s voting code -->";
}
*/
}else{
echo "<script type='text/javascript'>alert('Please log in before you vote!'); window.location = 'http://urbzms.servegame.com/?cype=main'</script>";
}
?>
SQL script
Code:
DROP TABLE IF EXISTS `votingrecords`;
CREATE TABLE `votingrecords` (
`account` varchar(13) NOT NULL default '0',
`ip` varchar(30) NOT NULL default '0',
`date` int(11) NOT NULL default '0',
`times` bigint(20) unsigned NOT NULL default '0',
`site` varchar(45) NOT NULL,
`id` int(11) unsigned NOT NULL auto_increment,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=236 DEFAULT CHARSET=latin1;