Hello everyone ,
i want to ask how can i add a new voting site on my voting box i tried adding it but it shows an error
This error appears
[Only registered and activated users can see links. Click Here To Register...]
my ajax.php
kindly help me with this. thanks
BUMP :D
i want to ask how can i add a new voting site on my voting box i tried adding it but it shows an error
This error appears
[Only registered and activated users can see links. Click Here To Register...]
my ajax.php
<?php
include('./inc/config.inc.php');
if(empty($_GET['page'])) $_GET['page'] = 1;
/* VOTE BOX */
if($_GET['a'] == 'showvotebox') {
$_SESSION['votebox'] = 'showed';
}
if($_GET['a'] == 'hidevotebox') {
$_SESSION['votebox'] = 'hidden';
}
if($_GET['a'] == 'voteitem') {
$selecteditems = odbc_exec($mssql, 'SELECT * FROM [web_voteitems] WHERE vitemid=\''.mssql_escape_string($_GET['vid']).'\'');
$selecteditem = odbc_fetch_array($selecteditems);
odbc_exec($mssql, 'USE [ACCOUNT_DBF]');
$userselect = odbc_exec($mssql, 'SELECT * FROM [ACCOUNT_TBL] WHERE account=\''.mssql_escape_string($_SESSION['user']).'\'');
$user = odbc_fetch_array($userselect);
if($user['votepoints'] < $selecteditem['price']) {
echo '<span style="color: #f00;">You don\'t have enough Vote Points!</span><br/><br/>';
} else {
if(empty($_GET['char']) || !isset($_GET['char'])) {
echo '<span style="color: #f00;">You must have a character!</span><br/><br/>';
} elseif($selecteditem == '') {
echo '<span style="color: #f00;">The selected item does not exist!</span><br/><br/>';
} else {
odbc_exec($mssql, 'USE [CHARACTER_01_DBF]');
$accountofchar = odbc_exec($mssql, 'SELECT account FROM [CHARACTER_TBL] WHERE m_idPlayer=\''.mssql_escape_string($_GET['char']).'\'');
if(strtolower(odbc_result($accountofchar, 'account')) == strtolower($_SESSION['user'])) {
send_item($_GET['char'], $selecteditem['itemid'], $selecteditem['count']);
odbc_exec($mssql, 'USE [ACCOUNT_DBF]');
odbc_exec($mssql, 'UPDATE [ACCOUNT_TBL] SET votepoints=votepoints-\''.mssql_escape_string($selecteditem['price']).'\' WHERE account=\''.mssql_escape_string($_SESSION['user']).'\'');
echo '<script type="text/javascript">currentvpoint(\''.$user['votepoints'].'\', \''.$selecteditem['price'].'\');</script>';
echo 'You have successfully purchased the item!<br/><br/>';
}
}
}
}
if($_GET['a'] == 'voteitemspage') {
echo '<table>';
odbc_exec($mssql, 'USE [WEBSITE_DBF]');
$items = odbc_exec($mssql, 'SELECT * FROM [web_voteitems]');
$page = $_GET['page'];
$perpage = 2;
$resultset = array();
$counter = 0;
while($row = odbc_fetch_array($items)) {
$resultset[$counter++] = $row;
}
$count = odbc_exec($mssql, 'SELECT COUNT(*) as i FROM [web_voteitems]');
$countpages = odbc_result($count, 'i') / $perpage;
for($i = $perpage * ($page-1);$i < $perpage*$page;$i++) {
if(isset($resultset[$i])) {
echo '<tr>
<td style="vertical-align: top;"><img src="./img/'.$resultset[$i]['icon'].'" /></td>
<td valign="top">
<b>'.$resultset[$i]['name'].'</b><br/>
<table><tr><td><img src="img/price.png" /></td><td>'.$resultset[$i]['price'].' Vote Points</td></tr></table>';
if(isset($_SESSION['user'])) {
echo '<a href="javascript:voteItem('.$resultset[$i]['vitemid'].')">Take it!</a>';
}
echo '</td>
</tr>
<tr><td colspan="2"><br/></td></tr>';
}
}
echo '</table>';
for($i=0; $i < $countpages; $i++) {
$k = $i + 1;
if($page == $k) {
echo '<span id="page"><b>'.$k.'</b></span>';
} else {
echo '<span id="page"><a href="javascript:voteItemsPage('.$k.');">'.$k.'</a></span>';
}
}
}
if($_GET['a'] == 'voteitems') {
echo 'Here you can vote for the server in order<br/>to support us and get a <b>free gift</b>!<br/><br/>';
if(isset($_SESSION['user'])) {
odbc_exec($mssql, 'USE [CHARACTER_01_DBF]');
$player = odbc_exec($mssql, 'SELECT * FROM [CHARACTER_TBL] WHERE account=\''.mssql_escape_string($_SESSION['user']).'\' AND isblock=\'F\' ORDER BY playerslot');
if(odbc_num_rows($player) >= 1) {
echo 'Character: <form method="post"><select name="character" id="character">';
while($char = odbc_fetch_array($player)) {
echo '<option value="'.$char['m_idPlayer'].'">'.$char['m_szName'].'</option>';
}
echo '</select></form><br/>';
}
}
echo 'Available Gifts:<br/><br/>
<div id="availgifts">
<table>';
odbc_exec($mssql, 'USE [WEBSITE_DBF]');
$items = odbc_exec($mssql, 'SELECT * FROM [web_voteitems]');
$page = $_GET['page'];
if(!isset($page)) { $page = 1; }
$perpage = 2;
$resultset = array();
$counter = 0;
while($row = odbc_fetch_array($items)) {
$resultset[$counter++] = $row;
}
$count = odbc_exec($mssql, 'SELECT COUNT(*) as i FROM [web_voteitems]');
$countpages = odbc_result($count, 'i') / $perpage;
for($i = $perpage * ($page-1);$i < $perpage*$page;$i++) {
if(isset($resultset[$i])) {
echo '<tr>
<td style="vertical-align: top;"><img src="./img/'.$resultset[$i]['icon'].'" /></td>
<td valign="top">
<b>'.$resultset[$i]['name'].'</b><br/>
<table><tr><td><img src="img/price.png" /></td><td>'.$resultset[$i]['price'].' Vote Points</td></tr></table>';
if(isset($_SESSION['user'])) {
echo '<a href="javascript:voteItem('.$resultset[$i]['vitemid'].');">Take it!</a>';
}
echo '</td>
</tr>
<tr><td colspan="2"><br/></td></tr>';
}
}
echo '</table>';
for($i=0; $i < $countpages; $i++) {
$k = $i + 1;
if($page == $k) {
echo '<span id="page"><b>'.$k.'</b></span>';
} else {
echo '<span id="page"><a href="javascript:voteItemsPage('.$k.');">'.$k.'</a></span>';
}
}
echo '</div><br />';
if(isset($_SESSION['user'])) {
odbc_exec($mssql, 'USE [ACCOUNT_DBF]');
$votepoints = odbc_exec($mssql, 'SELECT votepoints FROM [ACCOUNT_TBL] WHERE account=\''.mssql_escape_string($_SESSION['user']).'\'');
echo 'Current Vote Points: <b><span id="currvp">'.odbc_result($votepoints, 'votepoints').'</span></b><br/><br/>';
echo '<span id="takeitem"></span>';
echo '<a href="javascript:voteTab();"><b>Click here to vote!</b></a>';
} else {
echo '<b>You must login before you can vote!</b>';
}
}
if($_GET['a'] == 'vote') { // Vote Box
odbc_exec($mssql, 'USE [ACCOUNT_DBF]');
$userselect = odbc_exec($mssql, 'SELECT * FROM [ACCOUNT_TBL] WHERE account=\''.mssql_escape_string($_SESSION['user']).'\'');
$user = odbc_fetch_array($userselect);
$diff1 = diff($user['lastvote1']);
$diff2 = diff($user['lastvote2']);
$diff3 = diff($user['lastvote3']);
$diff4 = diff($user['lastvote4']);
$votedtoday = 0;
if($diff1['hours'] < 12)
$votedtoday = $votedtoday + 1;
if($diff2['hours'] < 12)
$votedtoday = $votedtoday + 1;
if($diff3['hours'] < 12)
$votedtoday = $votedtoday + 1;
if($diff4['hours'] < 12)
$votedtoday = $votedtoday + 1;
echo 'Username: <b>'.$user['account'].'</b><br/><br/>';
echo 'Current Vote Points: <b><span id="vpoints">'.$user['votepoints'].'</span></b><br/><br/>';
echo 'You can vote <b><span id="vtoday"> '.(4 - $votedtoday).' </span></b> more times today.<br/><br/>';
if($diff1['hours'] >= 12 || $diff2['hours'] >= 12 || $diff3['hours'] >= 12) || $diff4['hours'] >= 12) {
if(isset($_GET['submit'])) {
if($_GET['submit'] == 1) {
if($diff1['hours'] >= 12) {
odbc_exec($mssql, 'UPDATE [ACCOUNT_TBL] SET votepoints=votepoints+\'1\', lastvote'.mssql_escape_string($_GET['submit']).'=\''.date('d.M.Y H:m:s').'\' WHERE account=\''.mssql_escape_string($_SESSION['user']).'\'');
}
} elseif($_GET['submit'] == 2) {
if($diff2['hours'] >= 12) {
odbc_exec($mssql, 'UPDATE [ACCOUNT_TBL] SET votepoints=votepoints+\'1\', lastvote'.mssql_escape_string($_GET['submit']).'=\''.date('d.M.Y H:m:s').'\' WHERE account=\''.mssql_escape_string($_SESSION['user']).'\'');
}
} elseif($_GET['submit'] == 3) {
if($diff3['hours'] >= 12) {
odbc_exec($mssql, 'UPDATE [ACCOUNT_TBL] SET votepoints=votepoints+\'1\', lastvote'.mssql_escape_string($_GET['submit']).'=\''.date('d.M.Y H:m:s').'\' WHERE account=\''.mssql_escape_string($_SESSION['user']).'\'');
}
} elseif($_GET['submit'] == 4) {
if($diff4['hours'] >= 12) {
odbc_exec($mssql, 'UPDATE [ACCOUNT_TBL] SET votepoints=votepoints+\'1\', lastvote'.mssql_escape_string($_GET['submit']).'=\''.date('d.M.Y H:m:s').'\' WHERE account=\''.mssql_escape_string($_SESSION['user']).'\'');
}
}
}
echo 'You gain 1 Vote Point each topsite.<br/>After voting you will be able to choose a free gift!<br/>Follow the instructions to vote for all 3 topsites.<br/><br/><div id="topsite" style="text-align: center;">';
if($diff1['hours'] >= 12) {
// Top of Games
echo '<img src="img/tog.gif" /><br/><br/>';
echo '<span id="votetext"><a onclick="vote(1, '.$diff2['hours'].', \''.$votelist2.'\', \''.$votelist3.'\''.$votelist4.'\');" href="'.$votelist1.'" target="_blank">Click here to continue!</a></span>';
} elseif($diff2['hours'] >= 12 ) {
// Xtreme Top 100
echo '<img src="img/xtop100.jpg" /><br/><br/>';
echo '<span id="votetext"><a onclick="vote(2, '.$diff3['hours'].', \''.$votelist2.'\', \''.$votelist3.'\''.$votelist4.'\');" href="'.$votelist2.'" target="_blank">Click here to continue!</a></span>';
} elseif($diff3['hours'] >= 12) {
// G Top 100
echo '<img src="img/gtop100.jpg" /><br/><br/>';
echo '<span id="votetext"><a onclick="vote(3, 0, \''.$votelist2.'\', \''.$votelist3.'\''.$votelist4.'\');" href="'.$votelist3.'" target="_blank">Click here to continue!</a></span>';
}
} elseif($diff4['hours'] >= 12) {
// arena Top 100
echo '<img src="img/arena-top.png" /><br/><br/>';
echo '<span id="votetext"><a onclick="vote(4, 0, \''.$votelist2.'\', \''.$votelist3.'\''.$votelist4.'\');" href="'.$votelist4.'" target="_blank">Click here to continue!</a></span>';
}
echo '</div>';
} else {
echo '<a href="javascript:voteItemTab();">Choose an item!</a>';
}
}
/* VOTE BOX END */
?>
include('./inc/config.inc.php');
if(empty($_GET['page'])) $_GET['page'] = 1;
/* VOTE BOX */
if($_GET['a'] == 'showvotebox') {
$_SESSION['votebox'] = 'showed';
}
if($_GET['a'] == 'hidevotebox') {
$_SESSION['votebox'] = 'hidden';
}
if($_GET['a'] == 'voteitem') {
$selecteditems = odbc_exec($mssql, 'SELECT * FROM [web_voteitems] WHERE vitemid=\''.mssql_escape_string($_GET['vid']).'\'');
$selecteditem = odbc_fetch_array($selecteditems);
odbc_exec($mssql, 'USE [ACCOUNT_DBF]');
$userselect = odbc_exec($mssql, 'SELECT * FROM [ACCOUNT_TBL] WHERE account=\''.mssql_escape_string($_SESSION['user']).'\'');
$user = odbc_fetch_array($userselect);
if($user['votepoints'] < $selecteditem['price']) {
echo '<span style="color: #f00;">You don\'t have enough Vote Points!</span><br/><br/>';
} else {
if(empty($_GET['char']) || !isset($_GET['char'])) {
echo '<span style="color: #f00;">You must have a character!</span><br/><br/>';
} elseif($selecteditem == '') {
echo '<span style="color: #f00;">The selected item does not exist!</span><br/><br/>';
} else {
odbc_exec($mssql, 'USE [CHARACTER_01_DBF]');
$accountofchar = odbc_exec($mssql, 'SELECT account FROM [CHARACTER_TBL] WHERE m_idPlayer=\''.mssql_escape_string($_GET['char']).'\'');
if(strtolower(odbc_result($accountofchar, 'account')) == strtolower($_SESSION['user'])) {
send_item($_GET['char'], $selecteditem['itemid'], $selecteditem['count']);
odbc_exec($mssql, 'USE [ACCOUNT_DBF]');
odbc_exec($mssql, 'UPDATE [ACCOUNT_TBL] SET votepoints=votepoints-\''.mssql_escape_string($selecteditem['price']).'\' WHERE account=\''.mssql_escape_string($_SESSION['user']).'\'');
echo '<script type="text/javascript">currentvpoint(\''.$user['votepoints'].'\', \''.$selecteditem['price'].'\');</script>';
echo 'You have successfully purchased the item!<br/><br/>';
}
}
}
}
if($_GET['a'] == 'voteitemspage') {
echo '<table>';
odbc_exec($mssql, 'USE [WEBSITE_DBF]');
$items = odbc_exec($mssql, 'SELECT * FROM [web_voteitems]');
$page = $_GET['page'];
$perpage = 2;
$resultset = array();
$counter = 0;
while($row = odbc_fetch_array($items)) {
$resultset[$counter++] = $row;
}
$count = odbc_exec($mssql, 'SELECT COUNT(*) as i FROM [web_voteitems]');
$countpages = odbc_result($count, 'i') / $perpage;
for($i = $perpage * ($page-1);$i < $perpage*$page;$i++) {
if(isset($resultset[$i])) {
echo '<tr>
<td style="vertical-align: top;"><img src="./img/'.$resultset[$i]['icon'].'" /></td>
<td valign="top">
<b>'.$resultset[$i]['name'].'</b><br/>
<table><tr><td><img src="img/price.png" /></td><td>'.$resultset[$i]['price'].' Vote Points</td></tr></table>';
if(isset($_SESSION['user'])) {
echo '<a href="javascript:voteItem('.$resultset[$i]['vitemid'].')">Take it!</a>';
}
echo '</td>
</tr>
<tr><td colspan="2"><br/></td></tr>';
}
}
echo '</table>';
for($i=0; $i < $countpages; $i++) {
$k = $i + 1;
if($page == $k) {
echo '<span id="page"><b>'.$k.'</b></span>';
} else {
echo '<span id="page"><a href="javascript:voteItemsPage('.$k.');">'.$k.'</a></span>';
}
}
}
if($_GET['a'] == 'voteitems') {
echo 'Here you can vote for the server in order<br/>to support us and get a <b>free gift</b>!<br/><br/>';
if(isset($_SESSION['user'])) {
odbc_exec($mssql, 'USE [CHARACTER_01_DBF]');
$player = odbc_exec($mssql, 'SELECT * FROM [CHARACTER_TBL] WHERE account=\''.mssql_escape_string($_SESSION['user']).'\' AND isblock=\'F\' ORDER BY playerslot');
if(odbc_num_rows($player) >= 1) {
echo 'Character: <form method="post"><select name="character" id="character">';
while($char = odbc_fetch_array($player)) {
echo '<option value="'.$char['m_idPlayer'].'">'.$char['m_szName'].'</option>';
}
echo '</select></form><br/>';
}
}
echo 'Available Gifts:<br/><br/>
<div id="availgifts">
<table>';
odbc_exec($mssql, 'USE [WEBSITE_DBF]');
$items = odbc_exec($mssql, 'SELECT * FROM [web_voteitems]');
$page = $_GET['page'];
if(!isset($page)) { $page = 1; }
$perpage = 2;
$resultset = array();
$counter = 0;
while($row = odbc_fetch_array($items)) {
$resultset[$counter++] = $row;
}
$count = odbc_exec($mssql, 'SELECT COUNT(*) as i FROM [web_voteitems]');
$countpages = odbc_result($count, 'i') / $perpage;
for($i = $perpage * ($page-1);$i < $perpage*$page;$i++) {
if(isset($resultset[$i])) {
echo '<tr>
<td style="vertical-align: top;"><img src="./img/'.$resultset[$i]['icon'].'" /></td>
<td valign="top">
<b>'.$resultset[$i]['name'].'</b><br/>
<table><tr><td><img src="img/price.png" /></td><td>'.$resultset[$i]['price'].' Vote Points</td></tr></table>';
if(isset($_SESSION['user'])) {
echo '<a href="javascript:voteItem('.$resultset[$i]['vitemid'].');">Take it!</a>';
}
echo '</td>
</tr>
<tr><td colspan="2"><br/></td></tr>';
}
}
echo '</table>';
for($i=0; $i < $countpages; $i++) {
$k = $i + 1;
if($page == $k) {
echo '<span id="page"><b>'.$k.'</b></span>';
} else {
echo '<span id="page"><a href="javascript:voteItemsPage('.$k.');">'.$k.'</a></span>';
}
}
echo '</div><br />';
if(isset($_SESSION['user'])) {
odbc_exec($mssql, 'USE [ACCOUNT_DBF]');
$votepoints = odbc_exec($mssql, 'SELECT votepoints FROM [ACCOUNT_TBL] WHERE account=\''.mssql_escape_string($_SESSION['user']).'\'');
echo 'Current Vote Points: <b><span id="currvp">'.odbc_result($votepoints, 'votepoints').'</span></b><br/><br/>';
echo '<span id="takeitem"></span>';
echo '<a href="javascript:voteTab();"><b>Click here to vote!</b></a>';
} else {
echo '<b>You must login before you can vote!</b>';
}
}
if($_GET['a'] == 'vote') { // Vote Box
odbc_exec($mssql, 'USE [ACCOUNT_DBF]');
$userselect = odbc_exec($mssql, 'SELECT * FROM [ACCOUNT_TBL] WHERE account=\''.mssql_escape_string($_SESSION['user']).'\'');
$user = odbc_fetch_array($userselect);
$diff1 = diff($user['lastvote1']);
$diff2 = diff($user['lastvote2']);
$diff3 = diff($user['lastvote3']);
$diff4 = diff($user['lastvote4']);
$votedtoday = 0;
if($diff1['hours'] < 12)
$votedtoday = $votedtoday + 1;
if($diff2['hours'] < 12)
$votedtoday = $votedtoday + 1;
if($diff3['hours'] < 12)
$votedtoday = $votedtoday + 1;
if($diff4['hours'] < 12)
$votedtoday = $votedtoday + 1;
echo 'Username: <b>'.$user['account'].'</b><br/><br/>';
echo 'Current Vote Points: <b><span id="vpoints">'.$user['votepoints'].'</span></b><br/><br/>';
echo 'You can vote <b><span id="vtoday"> '.(4 - $votedtoday).' </span></b> more times today.<br/><br/>';
if($diff1['hours'] >= 12 || $diff2['hours'] >= 12 || $diff3['hours'] >= 12) || $diff4['hours'] >= 12) {
if(isset($_GET['submit'])) {
if($_GET['submit'] == 1) {
if($diff1['hours'] >= 12) {
odbc_exec($mssql, 'UPDATE [ACCOUNT_TBL] SET votepoints=votepoints+\'1\', lastvote'.mssql_escape_string($_GET['submit']).'=\''.date('d.M.Y H:m:s').'\' WHERE account=\''.mssql_escape_string($_SESSION['user']).'\'');
}
} elseif($_GET['submit'] == 2) {
if($diff2['hours'] >= 12) {
odbc_exec($mssql, 'UPDATE [ACCOUNT_TBL] SET votepoints=votepoints+\'1\', lastvote'.mssql_escape_string($_GET['submit']).'=\''.date('d.M.Y H:m:s').'\' WHERE account=\''.mssql_escape_string($_SESSION['user']).'\'');
}
} elseif($_GET['submit'] == 3) {
if($diff3['hours'] >= 12) {
odbc_exec($mssql, 'UPDATE [ACCOUNT_TBL] SET votepoints=votepoints+\'1\', lastvote'.mssql_escape_string($_GET['submit']).'=\''.date('d.M.Y H:m:s').'\' WHERE account=\''.mssql_escape_string($_SESSION['user']).'\'');
}
} elseif($_GET['submit'] == 4) {
if($diff4['hours'] >= 12) {
odbc_exec($mssql, 'UPDATE [ACCOUNT_TBL] SET votepoints=votepoints+\'1\', lastvote'.mssql_escape_string($_GET['submit']).'=\''.date('d.M.Y H:m:s').'\' WHERE account=\''.mssql_escape_string($_SESSION['user']).'\'');
}
}
}
echo 'You gain 1 Vote Point each topsite.<br/>After voting you will be able to choose a free gift!<br/>Follow the instructions to vote for all 3 topsites.<br/><br/><div id="topsite" style="text-align: center;">';
if($diff1['hours'] >= 12) {
// Top of Games
echo '<img src="img/tog.gif" /><br/><br/>';
echo '<span id="votetext"><a onclick="vote(1, '.$diff2['hours'].', \''.$votelist2.'\', \''.$votelist3.'\''.$votelist4.'\');" href="'.$votelist1.'" target="_blank">Click here to continue!</a></span>';
} elseif($diff2['hours'] >= 12 ) {
// Xtreme Top 100
echo '<img src="img/xtop100.jpg" /><br/><br/>';
echo '<span id="votetext"><a onclick="vote(2, '.$diff3['hours'].', \''.$votelist2.'\', \''.$votelist3.'\''.$votelist4.'\');" href="'.$votelist2.'" target="_blank">Click here to continue!</a></span>';
} elseif($diff3['hours'] >= 12) {
// G Top 100
echo '<img src="img/gtop100.jpg" /><br/><br/>';
echo '<span id="votetext"><a onclick="vote(3, 0, \''.$votelist2.'\', \''.$votelist3.'\''.$votelist4.'\');" href="'.$votelist3.'" target="_blank">Click here to continue!</a></span>';
}
} elseif($diff4['hours'] >= 12) {
// arena Top 100
echo '<img src="img/arena-top.png" /><br/><br/>';
echo '<span id="votetext"><a onclick="vote(4, 0, \''.$votelist2.'\', \''.$votelist3.'\''.$votelist4.'\');" href="'.$votelist4.'" target="_blank">Click here to continue!</a></span>';
}
echo '</div>';
} else {
echo '<a href="javascript:voteItemTab();">Choose an item!</a>';
}
}
/* VOTE BOX END */
?>
kindly help me with this. thanks
BUMP :D