Re: [mccode] Supporter Packs
This is for V2..
In smenu.php Find
> [url='staff_special.php?action=givedpform']Give User Donator Pack[/url]
";
Change to:
> [url='staff_special.php?action=givedpform']Give User Donator Pack[/url]
> [url='staff_special.php?action=givespform']Give User Supporter Pack[/url]
";
In staff_special.php Find
case 'givedpform': give_dp_form(); break;
case 'givedpsub': give_dp_submit(); break;
Insert below it:
case 'givespform': give_sp_form(); break;
case 'givespsub': give_sp_submit(); break;
Now Find
}
else if($_POST['type']==4)
{
$db->query("UPDATE users u LEFT JOIN userstats us ON u.userid=us.userid SET u.money=u.money+15000,u.crystals=u.crystals+75,
us.IQ=us.IQ+80,u.donatordays=u.donatordays+55 WHERE u.userid={$_POST['user']}");
$d=55;
}
else if($_POST['type']==5)
{
$db->query("UPDATE users u LEFT JOIN userstats us ON u.userid=us.userid SET u.money=u.money+35000,u.crystals=u.crystals+160,
us.IQ=us.IQ+180,u.donatordays=u.donatordays+115 WHERE u.userid={$_POST['user']}");
$d=115;
}
event_add($_POST['user'],"You were given one $d -day donator pack (Pack {$_POST['type']}) from the administration.",$c);
print "User given a DP.";
stafflog_add("Gave ID {$_POST['user']} a $d -day donator pack (Pack {$_POST['type']})");
}
Insert Below It:
function supporters_list()
{
global $ir,$c,$h,$userid;
print "<h3>Donations</h3>This lists the donations that need to be checked with our records and processed.
<table width=75%><tr style='background:white'><th>ID</th><th>Supporter</th><th>Time</th><th> </th></tr>";
$q=$db->query("SELECT u.*,d.* FROM sps_process d LEFT JOIN users u ON u.userid=d.sp_userid",$c);
while($r=$db->fetch_row($q))
{
print "<tr><td>{$r['sp_id']}</td><td>[url='viewuser.php?u={$r[']{$r['username']}</td><td>".date('F j, Y, g:i:s a',$r['sp_time'])."</td><td><a href='staff_special.php?action=acceptsp&ID={$r['sp_id']}'>Accept[/url] | [url='staff_specail.php?action=declinesp&ID={$r[']Decline[/url]</td></tr>";}
}
function accept_sp()
{
global $ir,$c,$h,$userid;
$q=$db->query("SELECT * FROM sps_process WHERE sp_id={$_GET['ID']}",$c);
$r=$db->fetch_row($q);
if($r['sp_type']=='standard')
{
$db->query("UPDATE users u LEFT JOIN userstats us ON u.userid=us.userid SET u.money=u.money+1000000,u.crystals=u.crystals+1000,
us.IQ=us.IQ+200,u.supporterdays=u.supporterdays+30 WHERE u.userid={$r['sp_userid']}",$c);
}
else if($r['sp_type']=='crystals')
{
$db->query("UPDATE users u LEFT JOIN userstats us ON u.userid=us.userid SET u.crystals=u.crystals+100,u.donatordays=u.donatordays+30 WHERE u.userid={$r['dp_userid']}",$c);
}
$db->query("DELETE FROM sps_process WHERE sp_id={$_GET['ID']}",$c);
event_add($r['sp_userid'],"Your Donation has been accepted and credited.",$c);
print "Donation accepted and credited to user.";
}
function decline_sp()
{
global $ir,$c,$h,$userid;
$q=$db->query("SELECT * FROM sps_process WHERE sp_id={$_GET['ID']}",$c);
$r=$db->fetch_row($q);
$db->query("DELETE FROM sps_process WHERE sp_id={$_GET['ID']}",$c);
event_add($r['sp_userid'],"Your Donation has been rejected.",$c);
print "Donation rejected.";
}
function give_sp_form()
{
global $ir,$c,$h,$userid;
print "<h3>Giving User SP</h3>
The user will receive the benefits of one 30-day supporter pack.
<form action='staff_special.php?action=givespsub' method='post'>
User: ".user_dropdown($c,'user')."
<input type='radio' name='type' value='1' /> Pack 1 (Standard)
<input type='submit' value='Give User SP' /></form>";
}
function give_sp_submit()
{
global $db,$ir,$c,$h,$userid;
if($_POST['type']==1)
{
$db->query("UPDATE users u LEFT JOIN userstats us ON u.userid=us.userid SET u.money=u.money+1000000,u.crystals=u.crystals+1000,
us.IQ=us.IQ+200,u.sp_time=u.sp_time+30 WHERE u.userid={$_POST['user']}",$c);
$d=30;
}
event_add($_POST['user'],"You were given one $d -day supporter pack (Pack {$_POST['type']}) from the administration.",$c);
print "User given a SP.";
}
Now open or create supporter.php and add this:
<?php
include "globals.php";
$is=$db->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']);
print<<<EOF
<h3>Supporter</h3>[b][[url='willpotion.php']Buy Will Potions[/url]][/b]
If you become a Supporter to Thug Ways, you will receive each time you donate:
[b]1st Offer:[/b]<ul>[*]$1000000 game money
[*]1000 crystals
[*]200 IQ, the hardest stat to get in the game!
[*]Supporter Only Weapons and Cities
[*]30 days Supporter Status: White name + cross next to your name[*] Friend and Black Lists[*] 25% Energy every 5 mins instead of 8%[/list]
<form action="https://www.paypal.com/cgi-bin/webscr" method="post"><input type=hidden name=cmd value=_xclick><input type="hidden" name="business"
[email protected]><input type="hidden" name="item_name" value="Thug Ways Supporter Status for ($userid) (Pack 1)"><input type="hidden" name="amount" value="10.00"><input type="hidden" name="no_shipping" value="1"><input type="hidden" name="return" value="http://thugways.info/supporterdone.php?action=done&type=standard"><input type="hidden" name="cancel_return" value="http://thugways.info/supporterdone.php?action=cancel"><input type="hidden" name="cn" value="Your Player ID"><input type="hidden" name="currency_code" value="USD"><input type="hidden" name="tax" value="0"><input type="image" src="https://www.paypal.com/en_US/i/btn/x-click-but21.gif" border="0" name="submit" alt="Make payments with PayPal - it's fast, free and secure!">
EOF;
$h->endpage;
?>
Here is the SQL
CREATE TABLE `sps_process` (
```sp_id``` int(11) NOT NULL default '0',
```sp_userid``` int(11) NOT NULL default '0',
```sp_time``` int(11) NOT NULL default '0',
```sp_type``` varchar(255) NOT NULL default ''
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
I didnt do any of this code. So create goes toward those who did. All I did was got it working, LOL. Hope yall enjoy.