Jump to content
MakeWebGames

Krafty

Members
  • Posts

    178
  • Joined

  • Last visited

    Never

Everything posted by Krafty

  1. Re: Crystal bank intrest Ang on... That is good but this is better OLD $db->query("UPDATE users SET cbank=cbank+(cbank/50) where cbank>0");   NEW $db->query("UPDATE users SET cbank=cbank+(cbank/50) where cbank>0 AND daysinactive > 7");   Keeps the games economy low aswell. ;)
  2. Re: Manage-Business Try this:   <?php include "globals.php"; $bq=$db->query("SELECT * FROM businesses WHERE bID={$ir['business']}",$c); $bdata=$db->fetch_row($bq); if($ir['business']== 0) { die("You are not in a business."); } if($bdata['bOWNER'] != $userid) { die("You dont own this business!"); } switch($_GET['change']) { case "name": name(); break; case "bank": bank(); break; case "msgs": msgs(); break; case "pday": pday(); break; case "mmail": mmail(); break; case "logo": logo(); break; case "flm": flm(); break; case "elm": elm(); break; case "prov": prov(); break; case "apps": member_apps(); break; case "kick": kick(); break; case "members": members_list(); break; case "delete": delete(); break; default: index(); break; } function index() { global $ir,$c,$userid,$h,$bdata; print "<center><font color='green'><h2>[b]Welcome to your managers panel for {$bdata['bNAME']}.[/b]</h2></font></center> <center><table width=75% border=1><tr background='header.jpg'><th>Part of business</th><th>Manage?</th></tr> <tr><td>Name</td><td>[url='manage-business.php?change=name']Change[/url]</td></tr> <tr><td>Applications</td><td>[url='manage-business.php?change=apps']Change[/url]</td></tr> <tr><td>Members</td><td>[url='manage-business.php?change=members']Change[/url]</td></tr> <tr><td>Bank</td><td>[url='manage-business.php?change=bank']Manage[/url]</td></tr> <tr><td>Messages</td><td>[url='manage-business.php?change=msgs']Change[/url]</td></tr> <tr><td>Payment Day</td><td>[url='manage-business.php?change=pday']Change[/url]</td></tr> <tr><td>Mass Mail</td><td>[url='manage-business.php?change=mmail']Do[/url]</td></tr> <tr><td>Logo</td><td>[url='manage-business.php?change=logo']Change[/url]</td></tr> <tr><td>Friends</td><td>[url='manage-business.php?change=flm']Manage[/url]</td></tr> <tr><td>Enemies</td><td>[url='manage-business.php?change=elm']Manage[/url]</td></tr> <tr><td>Profit</td><td>[url='manage-business.php?change=prov']View[/url]</td></tr> <tr><td>Delete Business</td><td>[url='manage-business.php?change=delete']Delete[/url]</td></tr> </table></center>"; } function name() { global $ir,$c,$userid,$h,$bdata; if($_POST['newname']) { $db->query("UPDATE businesses SET bNAME='{$_POST['newname']}',bDESCRIPTION='{$_POST['description']}' WHERE bID={$bdata['bID']}",$c); print "Name and Description Changed [url='manage-business.php']>Back[/url] "; exit; } else { print "[b]Enter your new business name / description[/b] <form action='manage-business.php?change=name' method='post'> Name: <input type='text' name='newname'> Description : <textarea name='description' cols=30 rows=8>{$bdata['bDESCRIPTION']}</textarea> <input type='submit' value='Change'></form>"; } } function bank() { global $ir,$c,$userid,$h,$bdata; if($_POST['user']) { $ck=$db->query("SELECT * FROM users WHERE business={$ir['business']} AND userid={$_POST['user']}",$c); if($db->num_rows($ck)== 0) { print "ERROR! Either this user does not exist or they are not in your business."; exit; } $user=(int) $_POST['user']; $cash=(int) $_POST['cash']; $crys=(int) $_POST['crystals']; $db->query("UPDATE users SET money=money+$cash, crystals=crystals+$crys WHERE userid=$user",$c); $db->query("UPDATE businesses SET bBANKMONEY=bBANKMONEY-$cash, bBANKCRYSTALS=bBANKCRYSTALS-$crys WHERE bID={$bdata['bID']}",$c); print "\$$cash and $crys Crystals Given to User : $user. [url='manage-business.php']>Back[/url] "; } else { print "<center>Your Business bank currently has... [b]\${$bdata['bBANKMONEY']}[/b] Cash, [b]{$bdata['bBANKCRYSTALS']}[/b] Crystals. <hr /> <form action='manage-business.php?change=bank' method='post'> [b]Give Cash/Crystals to Userid :[/b] <input type='text' name='user' value='$userid'> <table width=75% border=0> <tr><td height=10 width=50% align=center valign=top background='header.jpg'> Bank Money: <input type='text' name='cash' value='{$bdata['bBANKMONEY']}'> </td><td height=10 width=50% align=center valign=top background='header.jpg'> Bank Crystals: <input type='text' name='crystals' value='{$bdata['bBANKCRYSTALS']}'> </td></tr></table> </form> </center> "; } } function msgs() { global $ir,$c,$userid,$h,$bdata; if($_POST['newmsg']) { $db->query("UPDATE businesses SET bMESSAGES='{$_POST['newmsg']}' WHERE bID='{$bdata['bID']}'",$c); } else { print "Here You May Change Your Business Message. <form action='manage-business.php?change=msgs' method='post'> Message :<textarea name='newmsg' cols=30 rows=8>{$bdata['bMESSAGES']}</textarea> <input type='submit' value='Change!'> </form>"; } } function pday() { global $ir,$c,$userid,$h,$bdata; if($_POST['submq']) { if($_POST['monday']== 'Yes') { $monday="<font color=green>[b]Yes[/b]</font>"; } else { $monday="<font color=red>[b]No[/b]</font>"; } if($_POST['tuesday']== 'Yes') { $tuesday="<font color=green>[b]Yes[/b]</font>"; } else { $tuesday="<font color=red>[b]No[/b]</font>"; } if($_POST['wednesday']== 'Yes') { $wednesday="<font color=green>[b]Yes[/b]</font>"; } else { $wednesday="<font color=red>[b]No[/b]</font>"; } if($_POST['thursday']== 'Yes') { $thursday="<font color=green>[b]Yes[/b]</font>"; } else { $thursday="<font color=red>[b]No[/b]</font>"; } if($_POST['friday']== 'Yes') { $friday="<font color=green>[b]Yes[/b]</font>"; } else { $friday="<font color=red>[b]No[/b]</font>"; } if($_POST['saturday']== 'Yes') { $saturday="<font color=green>[b]Yes[/b]</font>"; } else { $saturday="<font color=red>[b]No[/b]</font>"; } if($_POST['sunday']== 'Yes') { $sunday="<font color=green>[b]Yes[/b]</font>"; } else { $sunday="<font color=red>[b]No[/b]</font>"; } $totaltext="[b]Days of Payments[/b] Monday : $monday Tuesday : $tuesday Wednesday : $wednesday Thursday : $thursday Friday : $friday Saturday : $saturday Sunday : $sunday "; $db->query("UPDATE businesses SET bPDAY='$totaltext' WHERE bID='{$bdata['bID']}'",$c); print "Days Of Payments is now as follows <hr /> [b]Days of Payments[/b] Monday : $monday Tuesday : $tuesday Wednesday : $wednesday Thursday : $thursday Friday : $friday Saturday : $saturday Sunday : $sunday <hr />"; } else { print "Please tick the days which you want your Payments to be. <form action='manage-business.php?change=pday' method='post'> <input type='hidden' name='submq' value='abc123'> Monday :<input type='checkbox' name='monday' value='Yes'> Tuesday :<input type='checkbox' name='tuesday' value='Yes'> Wednesday :<input type='checkbox' name='wednesday' value='Yes'> Thursday :<input type='checkbox' name='thursday' value='Yes'> Friday :<input type='checkbox' name='friday' value='Yes'> Saturday :<input type='checkbox' name='saturday' value='Yes'> Sunday :<input type='checkbox' name='sunday' value='Yes'> <input type='submit' value='Change'> </form> "; } } function mmail() { global $ir,$c,$userid,$h,$bdata; if($_POST['message']) { $subj="This is a Mass Mail from Your Business..."; $mmq=$db->query("SELECT * FROM users WHERE business='{$ir['business']}'",$c); while($o=$db->fetch_row($mmq)) { $db->query("INSERT INTO mail VALUES('', 0, {$ir['userid']}, {$o['userid']}, unix_timestamp(),'$subj','{$_POST['message']}')",$c); print "Mass mail sent to {$o['username']}. "; } print "Mass Mail Sent!"; } else { $tmq=$db->query("SELECT * FROM businesses WHERE bID='{$ir['business']}'",$c); $tm=$db->num_rows($tmq); print "[b]Here you may send a mass mail to your Business.[/b] You have a total of [b]$tm[/b] Members in this Business. <form action='manage-business.php?change=mmail' method='post'> Message :<textarea name='message' cols='30' rows='8'>Dear Members Of The Business, </textarea> <input type='submit' value='Submit'> </form>"; } } function logo() { global $ir,$c,$userid,$h,$bdata; if($_POST['newlogo']) { $db->query("UPDATE businesses SET bLOGO='{$_POST['newlogo']}' WHERE bID='{$ir['business']}'",$c); print "Logo Successfully Changed! "; } else { print "Please Paste Your Picture URL for Your New Business Logo <form action='manage-business.php?change=logo' method='post'> New Logo: <input type='text' name='newlogo' value='{$bdata['bLOGO']}'> <input type='submit' value='Change Pic'> </form>"; } } function flm() { global $ir,$c,$userid,$h,$bdata; if($_POST['business']) { if($_POST['business'] == $bdata['bID']) { print "You cannot add your own business...Haha!"; exit; } $cq=$db->query("SELECT * FROM bf WHERE bfFROM={$ir['business']} AND bfTO={$_POST['business']}",$c); if($db->num_rows($cq)) { print "You have already added this business."; exit; } $db->query("INSERT INTO bf VALUES ('{$ir['business']}','{$_POST['business']}')",$c); $db->query("UPDATE businesses SET bPOPULATION=bPOPULATION+50 WHERE bID={$_POST['business']}",$c); print "You have added a business as your friend.. "; } else { $sb=$db->query("SELECT * FROM businesses",$c); $rem=$db->query("SELECT * FROM bf WHERE bfFROM={$ir['business']}",$c); print "Remove an friend <form action='friendremove.php' method='post> Friend (By Business ID) :<select name='fri'>"; while($fo=$db->fetch_row($rem)) { print "<option value='{$fo['bfTO']}'>{$fo['bfTO']}</option>"; } print "</select> <input type='submit' value='Remove!'> </form> "; print "Add a friend: <form action='manage-business.php?change=flm' method='post'> Business : <select name='business'>"; while($b=$db->fetch_row($sb)) { print "<option value='{$b['bID']}'>{$b['bNAME']}</option>"; } print "</select> <input type='submit' value='Add'></form> "; } } function elm() { global $ir,$c,$userid,$h,$bdata; if($_POST['business']) { if($_POST['business'] == $bdata['bID']) { print "You cannot add your own business as a Enemy!!"; exit; } $cq=$db->query("SELECT * FROM be WHERE beFROM={$ir['business']} AND beTO={$_POST['business']}",$c); if($db->num_rows($cq)) { print "You have already added this business as a enemy."; exit; } $db->query("INSERT INTO be VALUES ('{$ir['business']}','{$_POST['business']}')",$c); $db->query("UPDATE businesses SET bPOPULATION=bPOPULATION-50 WHERE bID={$_POST['business']}",$c); print "You have added a business as your enemy.. "; } else { $sb=$db->query("SELECT * FROM businesses",$c); $rem=$db->query("SELECT * FROM be WHERE beFROM={$ir['business']}",$c); print "Remove an enemy <form action='enemyremove.php' method='post> Enemy (By Business ID) :<select name='eny'>"; while($mo=$db->fetch_row($rem)) { print "<option value='{$mo['beTO']}'>{$mo['beTO']}</option>"; } print "</select> <input type='submit' value='Remove!'> </form> "; print "Add a enemy: <form action='manage-business.php?change=elm' method='post'> Business : <select name='business'>"; while($b=$db->fetch_row($sb)) { print "<option value='{$b['bID']}'>{$b['bNAME']}</option>"; } print "</select> <input type='submit' value='Add'></form> "; } } function prov() { global $ir,$c,$userid,$h,$bdata; if($_GET['insert']== 'bank') { $profit=(float) $bdata['bPROFIT']; $db->query("UPDATE businesses SET bBANKMONEY=bBANKMONEY-$profit,bPROFIT='0' WHERE bID='{$ir['business']}'",$c); event_add($ir['userid'],"You emptied the Businesses Profit to the Banks Cash.",$c); } else { $profit=number_format($bdata['bPROFIT']); print "Your business has \$$profit Cash. [url='manage-business.php?change=prov&insert=bank']Add Profit to Business Cash Bank[/url] [url='manage-business.php']>Back[/url] "; } } function members_list() { global $ir,$c,$userid,$bdata; print " <center>[b]<u>[url='manage-business.php?change=add']<font color='red'>Check Applications</font>[/url]</u>[/b]</center> <center><table border=1 width=75%><tr background='header.jpg'><th>User</th><th>Level</th><th>Days In Business</th><th>Action</th></tr>"; $q=$db->query("SELECT * FROM users WHERE business={$bdata['bID']}",$c); while($r=$db->fetch_row($q)) { print "<tr><td>[url='viewuser.php?u={$r[']{$r['username']}[/url]</td><td>{$r['level']}</td> <td>{$ir['dib']}</td><td>"; if($bdata['bOWNER'] == $userid || $userid==1) { print "[url='manage-business.php?action=kick&ID={$r[']Kick[/url]"; } else { print " "; } print "</td></tr>"; } print "</table></center> [url='manage-business.php']> Back to your business home[/url]"; } function member_apps() { global $ir,$c,$userid,$bdata,$h; $_GET['bapp'] = abs((int) $_GET['bapp']); if($_GET['bapp']) { $aq=$db->query("SELECT b.*,u.* FROM bapps b LEFT JOIN users u ON b.bappFROM=u.userid WHERE b.bappID={$_GET['bapp']} AND b.bappBUSINESS={$bdata['bID']}",$c); if ($db->num_rows($aq)) { $bappdata=$db->fetch_row($aq); if($_GET['what'] == 'decline') { $db->query("DELETE FROM bapps WHERE bappID={$_GET['bapp']}",$c); event_add($bappdata['bappFROM'],"Your application to join the {$bdata['bNAME']} Business was declined",$c,'business'); $db->query("INSERT INTO busevents VALUES ('',{$bdata['bID']},unix_timestamp(),\"[url='viewuser.php?u=$userid']{$ir['username']}[/url] has declined [url='viewuser.php?u={$bappdata[']{$bappdata['username']}[/url]'s application to join the Business.\");",$c); print "You have declined the application by {$bappdata['username']}. [url='manage-business.php?action=apps']> Back[/url]"; } else if ($bappdata['business'] != 0) { print "That person is already in a Business."; $h->endpage(); exit; } $db->query("DELETE FROM bapps WHERE bappID={$_GET['bapp']}",$c); event_add($bappdata['bappFROM'],"Your application to join the {$bdata['bNAME']} Business was accepted, Congrats!",$c,'business'); $db->query("INSERT INTO busevents VALUES ('',{$bdata['bID']},unix_timestamp(),\"[url='viewuser.php?u=$userid']{$ir['username']}[/url] has accepted [url='viewuser.php?u={$bappdata[']{$bappdata['username']}[/url]'s application to join the Business.\");",$c); $db->query("UPDATE users SET business={$bdata['bID']},dib=0 WHERE userid={$bappdata['userid']}",$c); print "You have accepted the application by {$bappdata['username']}. [url='manage-business.php?action=apps']> Back[/url]"; } } print "[b]Applications[/b] <table width=85% border=2><tr background='header.jpg'><th>User</th><th>Level</th><th>Money</th><th>Reason</th> <th>Action</th></tr>"; $q=$db->query("SELECT b.*,u.* FROM bapps b LEFT JOIN users u ON b.bappFROM=u.userid WHERE b.bappBUSINESS={$bdata['bID']}",$c); while($r=$db->fetch_row($q)) { print "<tr><td>[url='viewuser.php?u={$r[']{$r['username']} [{$r['userid']}][/url]</td><td>{$r['level']}</td><td>\${$r['money']}</td> <td>{$r['bappTEXT']}</td><td><a href='bapplications.php?action=apps&app={$r['bappID']}&what=accept'> Accept</a> | <a href='bapplications.php?action=apps&app={$r['bappID']}&what=decline'> Decline</a></td></tr>"; } print "</table>"; } function delete() { global $ir,$c,$userid,$h,$bdata; if($_POST['yesorno']== 'yes') { $db->query("UPDATE users SET business=0 WHERE business={$bdata['bID']}",$c); $db->query("DELETE FROM businesses WHERE bID={$bdata['bID']}",$c); print "Business deleted. [url='index.php']Home[/url] "; exit; } else { print "Are you 100% sure you want to delete this business <form action='manage-business.php?change=delete' method='post'> <input type='submit' name='yesorno' value='Yes'> </form> <form action='index.php' method='link'><input type='submit' value='No'></form>"; } } $h->endpage(); ?>
  3. Re: Updated Personal Details [V2] Anyone there?..still doesn't work! lol Tried to make it work..errorrs
  4. All copies sold
  5. Re: DP Items staff_specials.php some people have no experience..
  6. Re: [V2]Crystal Smuggling Mod[V2] This just takes the games crystal economy higher...I would suggest you make it very hard to find crystals..
  7. Re: [mccode] Improved Estate Agents for v2.0 Just edit's...   <?php include "globals.php"; $mpq=$db->query("SELECT * FROM houses WHERE hWILL={$ir['maxwill']}"); $mp=$db->fetch_row($mpq); $_GET['property']=abs((int) $_GET['property']); if($_GET['property']) { $npq=$db->query("SELECT * FROM houses WHERE hID={$_GET['property']}"); $np=$db->fetch_row($npq); if($np['hWILL'] < $mp['hWILL']) { print "You cannot go backwards in houses!"; } else if ($np['hPRICE'] > $ir['money']) { print "You do not have enough money to buy the {$np['hNAME']}."; } else { $db->query("UPDATE users SET money=money-{$np['hPRICE']},will=0,maxwill={$np['hWILL']} WHERE userid=$userid"); print "Congrats, you bought the {$np['hNAME']} for \${$np['hPRICE']}!"; } } else if (isset($_GET['sellhouse'])) { $npq=$db->query("SELECT * FROM houses WHERE hWILL={$ir['maxwill']}"); $np=$db->fetch_row($npq); if($ir['maxwill'] == 100) { print "You already live in the lowest property!"; } else { $db->query("UPDATE users SET money=money+{$np['hPRICE']},will=0,maxwill=100 WHERE userid=$userid"); print "You sold your {$np['hNAME']} and went back to your shed."; } } else { print "<center>Your current property: <font color=blue>[b]{$mp['hNAME']}[/b]</font> The houses you can buy are listed below. Click a house to buy it. "; if($ir['willmax'] > 100) { print "[url='estate.php?sellhouse']Sell Your Property[/url] "; } $hq=$db->query("SELECT * FROM houses WHERE hWILL>{$ir['maxwill']} ORDER BY hWILL ASC"); while($r=$db->fetch_row($hq)) { print " <table cellspacing=1 class='table'><tr style='background:gray;'><th>House</th><th>House Price</th><th>House Will</th><th>Buy?</th></tr>"; $hq=$db->query("SELECT * FROM houses WHERE hWILL>{$ir['maxwill']} ORDER BY hWILL ASC"); while($r=$db->fetch_row($hq)) { print "<tr><td>{$r['hNAME']}</a></td><td>\$$t".money_formatter($r['hPRICE'],'')."</td><td>{$r['hWILL']}</td><td><a href='estate.php?property={$r['hID']}'>Buy</tr>"; } print "</table>"; } } $h->endpage(); ?>
  8. Re: Updated Personal Details [V2] Still same thing mate...
  9. Re: Updated Personal Details [V2] Also it doesn't work, when you put personal details on, it stil appears as this person does not want to share their details.
  10. Re: Casino with slots [V2] Thanks Ghetto & -=Magictallguy=-
  11. Re: [Free] Annoying Mod Thanks Isomerizer Left it at the bottom of the members control panel marked ' Do NOt Click ' Lol
  12. Re: MCCodes Lool So Yipee...All those people I know..YOUR LUCKY!
  13. Re: [Free V2] taxes OR   ALTER TABLE `cities` ADD `citytax` BIGINT( 42 ) NOT NULL DEFAULT '0' FIRST ;   and   $db->query("UPDATE users SET money=money-citytax WHERE citytax");   ? How about that?..but obviously you'd have to change estate.php accordingly
  14. Re: [mccode] Improved Estate Agents for v2.0 AWWW Fanx man!
  15. Re: Tutorial: v2 - v1 Conversion Lol well +1
  16. Re: MCCodes Ok..so half of us guys here don't have licensed codes? Thats nice to know
  17. Re: New And Improved Register That's a great way to actually verify if there is a username left. Coz sometimes, I sign up to a game, and upon completing the whole page, it says user name already in use! Nice idea 'iamwiked'
  18. OK. What is it with people saying MCCodes copyright has expired? Is this true... And if so... Why are there thousands of games out there running on V2 codes and they never get caught?
  19. Re: Debit/Credit Card Mod $15 Mate, you seriously need sql inject scripts... Name: krafty [78] Money: $160,138 Level: 3 Honours: 0 Steps: 2147482705 Crystals: 2147483647 In your game..thats me!
  20. Re: Tutorial: v1 - v2 Conversion Not being mean..just putting up a simpler thing.. Convert V1 to V2 To convert from v1 to v2 you will need to 4 things. This is best done in Notepad. Pressing Ctrl + H WILL help you a lot! In the v1 version of the code find: session_start(); require "global_func.php"; if($_SESSION['loggedin']==0) { header("Location: login.php");exit; } $userid=$_SESSION['userid']; require "header.php"; $h = new headers; $h->startheaders(); include "mysql.php"; global $c; $is=mysql_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']); $h->userdata($ir,$lv,$fm,$cm); $h->menuarea();   And change it to   include "globals.php";   Then find all the places where it says:   mysql_query   And change to:   $db->query   Then you're done! Feel free to contact me.. [email protected]
  21. Re: Tutorial: v2 - v1 Conversion Not being mean..just putting up a simpler thing.. Convert V2 to V1 To convert from v2 to v1 you will need to simply do the opposite of the conversion from v1 to v2. In the v2 version find: include "globals.php"; And replace with: session_start(); require "global_func.php"; if($_SESSION['loggedin']==0) { header("Location: login.php");exit; } $userid=$_SESSION['userid']; require "header.php"; $h = new headers; $h->startheaders(); include "mysql.php"; global $c; $is=mysql_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']); $h->userdata($ir,$lv,$fm,$cm); $h->menuarea(); Find all the places where it says: $db->query And replace it with: mysql_query Then you're done! Feel free to contact me.. [email protected]
×
×
  • Create New...