Code:
<?php
if (!defined('AXE'))
exit;
if (!isset($_SESSION['user']))
{
print "<font color='green'>You are not logged in.</font>"; include "footer.php"; exit;
}
if (isset($_GET['delid']) && isset($_GET['points']) && $a_user['gm']=='az')
{
$points=pun_htmlspecialchars($_GET['points']);
$delid=pun_htmlspecialchars($_GET['delid']);
if (isset($_GET['confirm']))
{
$db->query("DELETE FROM shop WHERE id='".$db->escape($delid)."' LIMIT 1") or die (mysql_error());
box ( "Delete Item","Item deleted!<br><br><a href='./quest.php?name=account&points=".$points."'>Go to Shop</a>" );
require_once "footer.php"; exit;
}
else
{
box ( "Delete Item","<center>Are you sure you want delete this item?<br><br><a href='./quest.php?name=account&points=".$points."&delid=".$delid."&confirm=YES'>YES</a> <a href='./quest.php?name=account&points=".$points."'>NO</a></center>" );
require_once "footer.php"; exit;
}
}
if (isset($_POST['action']))
{
if ($_POST['character']=='none')
{
box ('Fail','You don\'t have any characters. Mail can\'t be sent.');
require_once "footer.php"; exit;
}
$pieces = explode("-", $_POST['character']);
$char = $pieces[0];
$realm = $pieces[1];
if ($_POST['itemsgrup']=='')
{
box ('Fail','No item selected.');
require_once "footer.php"; exit;
}
$pieces2 = explode("-", $_POST['itemsgrup']);
$cost = $pieces2[1];
$itemid = $pieces2[0];
$item_stack = $pieces2[2];
$db->select_db($db_name) or die(mysql_error());
$dorv=pun_htmlspecialchars($_POST['dorv']);
if ($dorv=='1')
{
if ($a_user['dp']>=$cost)
{
$newpoints=$a_user['dp']-$cost;
$delpoints = $db->query("UPDATE accounts_more SET dp='".$newpoints."' WHERE acc_login='".$a_user['login']."'") or die(mysql_error());
}
else
{
box ('Fail','You don\'t have enough points to buy that item.<br>You have '.$a_user['dp'].' points and item costs '.$cost.' points.');
require_once "footer.php"; exit;
}
}
else if ($dorv=='2')
{
if ($a_user['vp']>=$cost)
{
$newpoints=$a_user['vp']-$cost;
$delpoints = $db->query("UPDATE accounts_more SET vp='".$newpoints."' WHERE acc_login='".$a_user['login']."'") or die(mysql_error());
}
else
{
box ('Fail','You don\'t have enough points to buy that item.<br>You have '.$a_user['vp'].' points and item costs '.$cost.' points.');
require_once "footer.php"; exit;
}
}
else
{
box ('Fail','Something went wrong with points...');
require_once "footer.php"; exit;
}
if ($pieces[1]=='1')
{
if ($char_db1=='')
{box ('Fail','RivaL WoW does not exist!');require_once "footer.php"; exit;}
else
{$db->select_db($char_db1) or die(mysql_error());}
}
else if ($pieces[1]=='2')
{
if ($char_db2=='')
{box ('Fail','RivaL WoW does not exist!');require_once "footer.php"; exit;}
else
{$db->select_db($char_db2) or die(mysql_error());}
}
else if ($pieces[1]=='3')
{
if ($char_db3=='')
{box ('Fail','Realm 3 does not exist!');require_once "footer.php"; exit;}
else
{$db->select_db($char_db3) or die(mysql_error());}
}
else if ($pieces[1]=='4')
{
if ($char_db4=='')
{box ('Fail','Realm 4 does not exist!');require_once "footer.php"; exit;}
else
{$db->select_db($char_db4) or die(mysql_error());}
}
else
{
box ('Fail','This realm socket is not compatible with this web script, make sure admin know about this so he can update script!');require_once "footer.php"; exit;
}
$time = date("m-d-Y, h:i");
$subject = 'Rival WoW Shop';
if ($dorv=='1')
$body = 'Enjoy your new reward! thankyou for donating for RivaL WoW
Item costed '.$cost.' vote/donation points. Time sent: '.$time;
$additem = $db->query("INSERT INTO mailbox_insert_queue (sender_guid, receiver_guid, subject, body, stationary, money, item_id, item_stack) VALUES ('".$char."', '".$char."', '".$subject."', '".$body."', '0', '0', '".$itemid."', '".$item_stack."')") or die(mysql_error());
box ('Success','Item has been dispatched! It will arrive in next few minutes. Reloging is not required.');
require_once "footer.php"; exit;
}
?>
<div class="post2"><img src="res/post_top2.png" alt="" align="bottom">
<div class="post_body2"><?php if ($a_user['gm']=='az') echo '<a href="./quest.php?name=admincp">Admin Panel</a> | '; ?><a href="./quest.php?name=account">Account Panel</a> | <a href="./quest.php?name=donate_form">Donation Panel</a>
</div><img src="res/post_bottom2.png" alt="" align="top"></div>
<?php
if ($_GET['points'])
{
if ($_GET['points']=='1')
{
$ititle="Online Item Shop";
$donateor='1';
$heh= "Your account currently has <strong>". $a_user['vp'] . "</strong> vote points stored.";
$hidden = '<input name="dorv" type="hidden" value="2" />';
}
else if ($_GET['points']=='2')
{
$ititle="Online Donation Item Shop";
$donateor='0';
$heh= "Your account currently has <strong>". $a_user['dp'] . "</strong> donation points stored.";
$hidden = '<input name="dorv" type="hidden" value="1" />';
}
else
{
exit;
}
?>
<div class="post2">
<div class="post_header2">
<center>
<?php print $ititle; ?>
</center>
</div>
<div class="post_body2" align="left">
Hello, <strong><?php print $a_user['login']; ?></strong>! <br />
<?php print $heh; ?><br /><br />
<form method="post" action="">
<table border="0" width="590" align="center" cellpadding="3" cellspacing="0">
<tr bgcolor="#3F3F3F">
<td colspan="2">Item Name</td>
<td>Description</td>
<td>Cost</td>
<td>Buy?</td>
</tr>
<?php
$query = $db->query("SELECT * FROM shop WHERE donateorvote='".$donateor."' ORDER BY cat, sort ASC") or die (mysql_error());
while ($items = $db->fetch_assoc($query))
{
if ($items['sep']=='1')
{
print "<tr><td colspan='4'>";
if ($a_user['gm']=='az')
{
print '<a href="./quest.php?name=account&points=1&delid='.$items['id'].'">[x]</a> «'.$items['cat'].'-'.$items['sort'].'» ';
}
print "<strong><i>".$items['name']."</i></strong></td></tr>";
}
else
{
print '<tr onmouseover="this.style.backgroundColor = \'#3D5247\';" onmouseout="this.style.backgroundColor = \'transparent\'; ">';
print "<td>";
if ($a_user['gm']=='az')
{
print '<a href="./quest.php?name=account&points=1&delid='.$items['id'].'">[x]</a> «'.$items['cat'].'-'.$items['sort'].'» ';
}
if ($items['custom']=='1')
{
$cil = array (
'0'=>'gray',
'1'=>'white',
'2'=>'#25FF16',
'3'=>'#0070AC',
'4'=>'#A335EE',
'5'=>'#FF8000',
);
print "[c] <font color='".$cil[$items['color']]."'>[".$items['name']."]</font></td>";
}
else
{
print "<a class='q".$items['color']."' href='http://www.wowhead.com/?item=".$items['itemid']."'>[".$items['name']."]</a></td>";
}
if ($items['charges']=='0' || $items['charges']=='1')
{
$charges='';
}
else
{
$charges='x'.$items['charges'];
}
print "<td>".$charges."</td>";
print "<td>".$items['description']."</td>";
print "<td>".$items['cost']."</td>";
print '<td><input type="radio" name="itemsgrup" value="'.$items['itemid'].'-'.$items['cost'].'-'.$items['charges'].'" />';
print'</td> </tr>';
}
}
?>
<tr><td colspan="4"><br />
Select Your Chracter: <select name="character">
<?php
$i=0;
if ($char_db1<>'')
{
$db->select_db($char_db1);
$result = $db->query("SELECT * FROM characters WHERE acct='".$a_user['acct']."'") or die (mysql_error());
while ($char = $db->fetch_assoc($result))
{
print "<option value='".$char['guid']."-1'>".$s1name." - ".$char['name']." - Level ".$char['level']." </option>";
$i=$i+1;
}
}
if ($char_db2<>'')
{
$db->select_db($char_db2);
$result = $db->query("SELECT * FROM characters WHERE acct='".$a_user['acct']."'") or die (mysql_error());
while ($char = $db->fetch_assoc($result))
{
print "<option value='".$char['guid']."-1'>".$s2name." - ".$char['name']." - Level ".$char['level']." </option>";
$i=$i+1;
}
}
if ($i=='0')
{
print "<option value='none'>You don't have any characters</option>";
}
$db->select_db($db_name);
print "</select>";
print $hidden ;
?>
<input name="action" type="submit" value="Purchase!" />
<br />
<br />
Upon pressing purchase, this script will insert a mail message containing the item into the server's mailbox queue. It should be received ingame in a few minutes. There is no need to relog.<br /><br />[c] - Custom Item
</tr></td>
</table>
</form>
</div>
<img src="res/post_bottom2.png" alt="" align="top" />
</div>
<?php
if ($a_user['gm']=='az')
{
if ($_POST['additem'])
{
if ($_POST['sep']=='0')
{
if ($_POST['itemid']=='')
{
box ('Fail','Make sure you type in item id.');
require_once "footer.php";exit;
}
else if ($_POST['name']=='')
{
box ('Fail','Make sure you type in item name.');
require_once "footer.php";exit;
}
else if ($_POST['description']=='')
{
box ('Fail','Make sure you type in item description.');
require_once "footer.php";exit;
}
else if ($_POST['points']=='')
{
box ('Fail','Make sure you type in item point cost.');
require_once "footer.php";exit;
}
else if ($_POST['charges']=='')
{
box ('Fail','Make sure you type in charges.');
require_once "footer.php";exit;
}
else if ($_POST['cat']=='')
{
box ('Fail','Make sure you type in category number for sorting items.');
require_once "footer.php";exit;
}
else if ($_POST['sort']=='')
{
box ('Fail','Make sure you type in sort items within same category.');
require_once "footer.php";exit;
}
else
{
$result=$db->query("INSERT INTO shop (sep,name,itemid,color,cat,sort,cost,charges,donateorvote,description,custom) VALUES ('0','".$db->escape($_POST['name'])."','".$db->escape($_POST['itemid'])."','".$_POST['color']."','".$db->escape($_POST['cat'])."','".$db->escape($_POST['sort'])."','".$db->escape($_POST['points'])."','".$db->escape($_POST['charges'])."','".$donateor."','".$db->escape($_POST['description'])."','".$db->escape($_POST['custom'])."')") or die(mysql_error());
box ('Success','Item is added!');
require_once "footer.php";exit;
}
}
else
{
if ($_POST['name']=='')
{
box ('Fail','Make sure you type in item name.');
require_once "footer.php";exit;
}
else if ($_POST['cat']=='')
{
box ('Fail','Make sure you type in category number for sorting items.');
require_once "footer.php";exit;
}
else if ($_POST['sort']=='')
{
box ('Fail','Make sure you type in sort items within same category.');
require_once "footer.php";exit;
}
else
{
$result=$db->query("INSERT INTO shop (sep,name,cat,sort,donateorvote) VALUES ('1','".$db->escape($_POST['name'])."','".$db->escape($_POST['cat'])."','".$_POST['sort']."','".$donateor."')") or die(mysql_error());
box ('Success','Item is added!');
require_once "footer.php";exit;
}
}
}
?>
<div class="post2">
<div class="post_header2">
<center>
Admin Tools - Add new item
</center>
</div>
<div class="post_body2" align="left">
<form action="" method="post">
<table border="0" align="center" cellpadding="3">
<tr>
<td>Item or Seperator:<br /></td>
<td><select name="sep">
<option value="0" selected="selected">Item</option>
<option value="1">Seperator *</option>
</select></td>
</tr>
<tr>
<td>Is custom item? </td>
<td><select name="custom">
<option value="0" selected="selected">No</option>
<option value="1">Yes</option>
</select></td>
</tr>
<tr>
<td>Item ID:</td>
<td><input name="itemid" type="text" /> <a href='#' onClick='window.open("./pop-itemlookup.php","item","width=450,height=400,screenX=50,left=250,screenY=50,top=200,scrollbars=yes,status=no,menubar=no");return false'><strong>[Search for item ID]</strong></a></td>
</tr>
<tr>
<td>Item name:</td>
<td><input name="name" type="text" /> *</td>
</tr>
<tr>
<td>Item color:</td>
<td><select name="color">
<option value="0">Poor (gray)</option>
<option value="1" selected="selected">Common (white)</option>
<option value="2">Uncommon (green)</option>
<option value="3">Rare (blue)</option>
<option value="4">Epic (purple)</option>
<option value="5">Legendary (orange)</option>
</select></td>
</tr>
<tr>
<td>Description:</td>
<td><input name="description" type="text" /></td>
</tr>
<tr>
<td>Cost Points:</td>
<td><input name="points" type="text" value="1" /></td>
</tr>
<tr>
<td>Item Stack:</td>
<td><input name="charges" type="text" value="1" /><br />Default 1 for one item.</td>
</tr>
<tr>
<td>Cat Sort:</td>
<td><input name="cat" type="text" value="0" />
* «<strong>X</strong>-x»</td>
</tr>
<tr>
<td>Sort within Cat:</td>
<td><input name="sort" type="text" value="0" />
* «x-<strong>X</strong>»</td>
</tr>
</table>
<center><br />
If you select "Seperator" then only fields with "*" are required<br /><br />
<input name="additem" type="submit" value="Add Item" />
</center>
</form>
</div>
<img src="res/post_bottom2.png" alt="" align="top" />
</div>
<?php
}
?>
<?php
}
else
{
?>
<div class="post2">
<div class="post_header2">
<center>
Welcome!
</center>
</div>
<div class="post_body2" align="left">
Hello, <strong><?php print $a_user['login']; ?></strong>!<br />
Your account ID is: <strong><?php print $a_user['acct']; ?></strong><br />
Your account was last used on: <strong><?php print $a_user['lastlogin']; ?></strong><br />
Your account was last used by IP: <strong><?php print $a_user['lastip']; ?></strong><br />
Your current IP is: <strong><?php print get_remote_address(); ?></strong><br /><br />
<?php
if ($a_user['flags']=='8')
echo 'Expansion: The Burning Crusaide';
elseif ($a_user['flags']=='24')
echo 'Expansion: Wrath of the Lich King';
else
echo 'Expansion: No expansions enabled';
?>
<br /><br />
Your account is <?php if ($a_user['banned']=='0') { echo "<font color='lime'><strong>not banned.</strong></color>";} else {echo "<font color='red'><strong>banned.</strong></font>";}; ?><br /><br />
<table width="100%" border="0" >
<tr>
<td width="67px" height="74" style="background-image:url(./res/icon_lock.png); background-position:center top"></td>
<td align="left"> <br /><a style="font-size:14px" href="./quest.php?name=passchange">Change Password</a><br />
<i>You should change your password regularly. Do it here.</i></td>
</tr>
<tr>
<td height="64" style="background-image:url(./res/wowstatus.png); background-position:center top"></td>
<td align="left"> <br /><a style="font-size:14px" href="./quest.php?name=expansion">Enable/Disable Expansions</a><br />
<i>This tool can change what expansion packs are enabled on your account.</i></td>
</tr>
<tr>
<td height="74" style="background-image:url(./res/star2.png); background-position:center top"></td>
<td align="left"> <br /><a style="font-size:14px" href="./quest.php?name=account&points=1">Redeem Vote Points</a><br />
<i>This tool will allow you to trade in vote points received by voting for us in the top 100 rankings.</i></td>
</tr>
<tr>
<td height="74" style="background-image:url(./res/star.png); background-position:center top"></td>
<td align="left"> <br /><a style="font-size:14px" href="./quest.php?name=account&points=2">Redeem Donation Points</a><br />
<i>This tool will allow you to trade in donation money received by donating money for us, this money can be spent only to items.</i></td>
</tr>
<!--
<tr>
<td height="65"> </td>
<td align="left"><a style="font-size:14px" href="./quest.php?name=account&points=2">Update Forum Character and Realm </a><br />
<i>This tool will allow you to automaticly update forum profile (character race, class, level and realm).</i></td>
</tr>
-->
<tr>
<td height="74" style="background-image:url(./res/chars.png); background-position:center top"></td>
<td align="left"> <br /><a style="font-size:14px" href="./quest.php?name=char">Character Tools</a><br />
<i>Unstuck and check for character bans here.</i></td>
</tr>
<tr>
<td height="74" style="background-image:url(./res/movecharact.png); background-position:center top"></td>
<td align="left"> <br /><a style="font-size:14px" href="./quest.php?name=transfer">Character Transfer</a><br />
<i>Migrate your character to another account.</i></td>
</tr>
<tr>
<td height="65"> </td>
<td align="left"> </td>
</tr>
</table>
</div>
<img src="res/post_bottom2.png" alt="" align="top" />
</div>
<?php
}
?>
donate.php //Donate Script
Code:
<?php
require "include/common.php";
if (!defined('AXE'))
exit;
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="shortcut icon" href="./favicon.ico">
<title><?php print "Vote - ".$title; ?></title>
<link href="res/style.css" rel="stylesheet" type="text/css">
</head><body>
<?php
if (!$a_user['is_guest'])
{
if(isset($_GET['vote']))
{
$voteurl= ereg_replace("\[i\]","&", $_GET['vote']);
// this is made like this so there is no exploits... getting ids and retrieving their vote time for user
switch ($voteurl) {
case $voteurl1:
$siteid='1';
break;
case $voteurl2:
$siteid='2';
break;
/* case "$voteurl3":
$siteid='3';
break;
case "$voteurl4":
$siteid='4';
break;
case "$voteurl5":
$siteid='5';
break;
*/
default: $siteid='0';
}
} else
{
$voteurl="error.php"; $siteid='0';
}
$getvote="SELECT * from vote_data where userid='".$a_user['acct']."' and siteid='$siteid'";
$getvote2=mysql_query($getvote) or die("Die!".mysql_error());
$getvote3=mysql_fetch_array($getvote2);
$points=$a_user['vp']+1;
$timenow = date("U");
$timefuture = date("U")+43200;//12 hrs
$timeleft = $getvote3[timevoted];
$timeleft2 = gmdate("F j, Y G:i:s",$timeleft); //ex: March 23, 2009 18:25:55 - gmdate so its UTF
$timeleft3 = $getvote3[timevoted]-$timenow;
if ($siteid=='0') {
$text="That site is not in database.";
} else {
if ($getvote3[userid]==$a_user['acct'] && $siteid==$getvote3[siteid] && $getvote3[timevoted]>=$timenow)
{
$timeaz=gmdate("+G:i:s",$timeleft3);
$text="Time until next vote for this site: $timeaz<br><br><a href='$voteurl'>*click here to vote anyway*</a>";//
} else {
//*****************DOING USER UPDATE QUERIES****************
$adding="UPDATE accounts_more SET vp='$points' WHERE acc_login='".$a_user['login']."'";
mysql_query($adding) or die("System Error: ".mysql_error());
//********************ADDING TIME QUERIES******************
$ins="INSERT INTO vote_data (userid,siteid,timevoted) values ('".$a_user['acct']."','$siteid','$timefuture')";
mysql_query($ins) or die("System Error: ".mysql_error());
//*******DELETING TIME QUERIES, ALL THAT ARE EXPIRED******* usefull so there is no useless queries and no space vaste
$del="DELETE FROM vote_data WHERE timevoted < '$timenow'";
mysql_query($del) or die("System Error: ".mysql_error());
//*********************************************************
$text = 'Redirecting to vote site...<meta http-equiv="refresh" content="0;'.$voteurl.'"/>
';
}
}
}//end if logged in
else
{
?>
<?php
}
?> <br />
<br />
<br />
<br />
<br />
<center>
<div class="post">
<img src="res/post_top.png" alt="" align="bottom" height="2">
<div class="post_body" align="center">
<?php
print $text;
?>
</div>
<img src="res/post_bottom.png" alt="" align="top" />
</div>
</center>
</body></html>
vote_links.php
Code:
<?php
if (!defined('AXE'))
exit;
if (!$a_user['is_guest'])
{
$timenow = date("U");
$s=0;
function check($site) {
global $a_user,$timenow,$s,$sitepath;
$getvote="SELECT timevoted FROM vote_data WHERE userid='".$a_user['acct']."' AND siteid='$site'";
$getvote2=mysql_query($getvote) or die("Vote Error!".mysql_error());
$getvote3=mysql_fetch_array($getvote2);
if (!$getvote3[0]) {$getvote3[0]="0";}
if ($getvote3[0]>=$timenow) {$s=$s+1;}
}
function check2($site,$url) {
global $a_user,$timenow,$s,$sitepath;
$getvote="SELECT timevoted FROM vote_data WHERE userid='".$a_user['acct']."' AND siteid='$site'";
$getvote2=mysql_query($getvote) or die("Vote Error!".mysql_error());
$getvote3=mysql_fetch_array($getvote2);
if (!$getvote3[0]) {$getvote3[0]="0";}
$url2= ereg_replace("&","[i]", $url);
if ($getvote3[0]>=$timenow) {}
else
{
print "<a href='./vote.php?vote=".$url2."' target='_blank'><img src='./res/".$site.".jpg' height='54px'></a>";}
}
$s1=0;$s2=0;$s3=0;$s4=0;
check("1");
check("2");
/*
check("3");
check("4");
check("5");
*/
if ($s<=1) {
?>
<div class="post">
<img src="res/post_top.png" alt="" align="bottom" height="2">
<div class="post_body" align="center">
<table width="100%" border="0" cellpadding="3">
<tr>
<td><?php check2("1","$voteurl1"); ?></td>
<td><?php check2("2","$voteurl2"); ?></td>
<td width="225px">You didn't vote within last 12 hours, vote and gain vote points.<br />You gain 1 vote point every time you vote. <u><a href="./quest.php?name=account&points=1">Go To Vote Shop.</a></u></td>
</tr>
</table>
</div>
<img src="res/post_bottom.png" alt="" align="top" />
</div>
<?php
/*
check2("3","$voteurl3");
check2("4","$voteurl4");
check2("5","$voteurl5");
*/
}
?>
<?php
}
?>