Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <html>
- <head>
- <title>Xero Storm</title>
- </head>
- <body bgcolor="#121212">
- <table border="0" width="100%" height="100%" style="font-family: tahoma, verdana; font-size: 10pt; color: #FFFFFF;">
- <tr><td align="center" valign="middle">
- <a href="index.php"><img src="images/smoothgreybb/logo_hover.png" border="0" width="330" height="80"></a><br />
- <?php
- // ------------------------- //
- // Config //
- $shop_mysql_host = "localhost";
- $shop_mysql_user = "xerostor_db";
- $shop_mysql_pass = "lolboll(nejjagdriver)";
- $shop_mysql_db = "xerostor_db";
- // Styles //
- $shop_s['item'] = "text-align: center;";
- $shop_s['description'] = "text-align: left;";
- $shop_s['table'] = "font-family: Tahoma, Verdana; font-size: 10pt; color: #FFFFFF; border: 1px solid #1a1a1a;";
- $shop_s['price'] = "color: #FF0000;";
- $shop_s['buynow'] = "color: #FFFF00";
- // ----------------------------
- // MySQL connect
- $shop_con = mysql_connect($shop_mysql_host, $shop_mysql_user, $shop_mysql_pass);
- mysql_select_db($shop_mysql_db, $shop_con);
- // ----------------------------
- $shop_mybbuser = mysql_real_escape_string($_COOKIE['mybbuser']);
- $shop_mybbuser = explode("_", $shop_mybbuser);
- $shop_uid = $shop_mybbuser[0];
- $shop_loginkey = $shop_mybbuser[1];
- mysql_query("SELECT * FROM mybb_users WHERE uid = '".$shop_uid."' AND loginkey = '".$shop_loginkey."'");
- if (mysql_affected_rows() < 1) {
- exit("You have to be logged in to use the shop.<br />\n<a href=\"index.php\">Login</a>");
- }
- function sendPM($toid, $fromid, $subject, $message) { // Send PM function
- $mybbpms = 'mybb_privatemessages';
- $mybbpmusers = 'mybb_users';
- $recipients = serialize(array("to" => array($toid)));
- $time = time();
- mysql_query("INSERT into $mybbpms(uid,toid,fromid,recipients,folder,subject,message,dateline,status) VALUES('$fromid','$toid','$fromid','$recipients','2','$subject','$message','$time','1')");
- mysql_query("INSERT into $mybbpms(uid,toid,fromid,recipients,folder,subject,message,dateline,receipt) VALUES('$toid','$toid','$fromid','$recipients','1','$subject','$message','$time','1')");
- mysql_query("UPDATE $mybbpmusers SET `pmnotice` = 2 WHERE uid = '$toid'"); //update the pm notify! finally fuck!
- mysql_query("UPDATE $mybbpmusers SET `unreadpms` = `unreadpms` +1 WHERE uid = '$toid'"); //update the pm notify! finally fuck!
- }
- if (!isset($_GET['action'])) $_GET['action'] = "items";
- function genRandString() {
- $chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
- $string = "";
- for ($i=0; $i<5; $i++) {
- for($ii=0; $ii<4; $ii++) {
- $string .= $chars[rand(0,strlen($chars)-1)];
- }
- if ($i !== 4) $string .= "-";
- }
- return $string;
- }
- $shop_q = mysql_query("SELECT * FROM mybb_users WHERE uid = '".$shop_uid."'"); // MySQL query
- $shop_row = mysql_fetch_array($shop_q); // Fetch array
- $shop_users_points = $shop_row['newpoints'];
- $shop_key = md5($shop_uid."s5vkmG6ZwaJyyCav5h".$shop_row['my_post_key']);
- echo "You currently have <b>".$shop_users_points."</b> on your account.<br /><br />\n\n";
- switch($_GET['action']) {
- case "items": // The items table
- echo "<table border=\"1\" style=\"".$shop_s['table']."\" style=\"font-family: tahoma, verdana; font-size: 10pt; color: #FFFFFF;\">\n";
- echo "<tr><td> </td><td width=\"500\"><b>Item name</b></td><td width=\"75\"><b>Price</b></td><td width=\"75\"><b>Stock</b><td width=\"75\"><b>Buy now</b></td></td>\n";
- echo "<tr style=\"".$shop_s['item']."\"><td><img src=\"images/newpoints/default.png\"></td><td style=\"".$shop_s['description']."\"><b>Professional Upgrade</b><br />Use this item to upgrade yourself or another member to professional.</td><td style=\"".$shop_s['price']."\"><b>5000 P</b></td><td><b>Infinite</b><td><b><a href=\"shop.php?action=buy&item=professional_upgrade&shop_key=".$shop_key."\" style=\"".$shop_s['buynow']."\">Buy now</a></b></td></td></tr>\n";
- echo "<tr style=\"".$shop_s['item']."\"><td><img src=\"images/newpoints/default.png\"></td><td style=\"".$shop_s['description']."\"><b>Group Creation Badge</b><br />Use this item to to create your own offical group.</td><td style=\"".$shop_s['price']."\"><b>10000 P</b></td><td><b>15</b><td><b><a href=\"shop.php?action=buy&item=group_creation_Badge&shop_key=".$shop_key."\" style=\"".$shop_s['buynow']."\">Buy now</a></b></td></td></tr>\n";
- echo "<tr style=\"".$shop_s['item']."\"><td><img src=\"images/newpoints/default.png\"></td><td style=\"".$shop_s['description']."\"><b>Video Badge</b><br />With this item you can choose video of the day.</td><td style=\"".$shop_s['price']."\"><b>1000 P</b></td><td><b>15</b><td><b><a href=\"shop.php?action=buy&item=video_Badge&shop_key=".$shop_key."\" style=\"".$shop_s['buynow']."\">Buy now</a></b></td></td></tr>\n";
- echo "</table>";
- break;
- case "buy":
- if ($_GET['shop_key'] == $shop_key) { // Check if the shop key is valid
- switch($_GET['item']) {
- case "professional_upgrade": // ITEM: Professional Upgrade
- if ($shop_users_points >= 5000) {
- // Change usergroup and remove points from account
- mysql_query("UPDATE mybb_users SET usergroup = 9, newpoints = newpoints - 5000 WHERE uid = ".$shop_uid);
- // PM to eXore
- sendPM(1, 373, "Purchase from point store", "User ID: ".$shop_uid." just purchased the item [b]Professional Upgrade[/b]!");
- // PM to buyer
- sendPM($shop_uid, 373, "Purchase from point store", "Hello!\nYou just purchased a Professional Upgrade from the pointstore.\nYou have already been upgraded as you read this.\nContact eXore if you have any questions about the purchase.");
- // Add 1500 credits to account
- mysql_query("UPDATE mybb_users SET newpoints = newpoints + 1500 WHERE uid = ".$shop_uid);
- // Echo thanks
- echo "You are now upgraded!<br />Enjoy your new benefits of being a Professional member.<br /><br /><a href=\"shop.php\"><< Back to the shop</a>";
- } else {
- echo "Sorry, you do not have enough points to buy this item.<br /><br /><a href=\"shop.php\"><< Back to the shop</a>";
- }
- break;
- case "group_creation_Badge": // ITEM: Group Creation Badge
- if ($shop_users_points >= 10000) {
- // Generate code
- $store_Badge_code = genRandString();
- // PM to eXore
- sendPM(1, 373, "Purchase from point store", "User ID: ".$shop_uid." just purchased the item [b]Group Creation Badge[/b]!\nBadge code: ".$store_Badge_code);
- // PM to buyer
- sendPM($shop_uid, 373, "Purchase from point store", "Hello!\nYou just purchased a Group Creation Badge from the pointstore.\n\nYour Badge code is: ".$store_Badge_code."\n\nThis PM is just a notification that everything went good.\nContact eXore if you have any questions about the purchase.");
- // Remove points from buyers account
- mysql_query("UPDATE mybb_users SET newpoints = newpoints - 10000 WHERE uid = ".$shop_uid);
- // Echo thanks
- echo "Your purchase is completed!<br />You have been PMd your code.<br />When you want to create your group, just shout a PM to eXore with the<br />name of the group and your Badge code.<br /><br /><a href=\"shop.php\"><< Back to the shop</a>";
- } else {
- echo "Sorry, you do not have enough points to buy this item.<br /><a href=\"shop.php\"><< Back to the shop</a>";
- }
- break;
- case "video_Badge": // ITEM: Video Badge
- if ($shop_users_points >= 1000) {
- // Generate code
- $store_video_code = genRandString();
- // PM to eXore
- sendPM(1, 373, "Purchase from point store", "User ID: ".$shop_uid." just purchased the item [b]Video Badge[/b]!\nBadge code: ".$store_video_code);
- // PM to buyer
- sendPM($shop_uid, 373, "Purchase from point store", "Hello!\nYou just purchased a Video Badge from the pointstore.\n\nYour Badge code is: ".$store_video_code."\n\nThis PM is just a notification that everything went good.\nContact eXore if you have any questions about the purchase.");
- // Remove points from buyers account
- mysql_query("UPDATE mybb_users SET newpoints = newpoints - 1000 WHERE uid = ".$shop_uid); // Remove points from account
- // Echo thanks
- echo "Your purchase is completed!<br />You have been PMd your code.<br />When you want your video to be video of the day, just shout a PM to eXore with the<br />link to the video and your Badge code.<br /><br /><a href=\"shop.php\"><< Back to the shop</a>";
- } else {
- echo "Sorry, you do not have enough points to buy this item.<br /><a href=\"shop.php\"><< Back to the shop</a>";
- }
- break;
- }
- } else {
- echo "Your shop-key is invalid.<br />If you really wanted to buy this item, please contact an admin.<br /><br /><a href=\"shop.php\"><< Back to the shop</a>";
- }
- break;
- }
- mysql_close($shop_con);
- ?>
- </td></tr>
- </body>
- </html>
Add Comment
Please, Sign In to add comment