-
Posts
2,464 -
Joined
-
Last visited
-
Days Won
8
Content Type
Profiles
Forums
Events
Everything posted by rulerofzu
-
Request: Auto Login upon account creation
rulerofzu replied to Lilith's topic in Requests & In Production
DJK means a meta tag refresh to index.php so they register and auto redirected to the game. Personally I prefer header location header('Location: index.php'); -
Request: Auto Login upon account creation
rulerofzu replied to Lilith's topic in Requests & In Production
what he said :P -
Request: Auto Login upon account creation
rulerofzu replied to Lilith's topic in Requests & In Production
$_SESSION['userid']=$i; // $i is already used for the session id -
How about..... you try and fix it? I know its an out there concept!
-
Does your monkey have less than 10 energy? Is your cron 5 actually running lol.
-
I would want to see that you could string a sentence together for starters. Sorry but in most of the posts you have made it sounds like your under 8 years old. I would have put over 8 but that would be insulting to my own 8 year old child.
-
well im pretty sure by using that neat nifty search function you will find a mission mod and a business (company) mod. not sure if they are the same I signed up for torn logged in and logged out. I wasnt impressed.
-
Skimmed through some of the code. I would suggest not using * where possible. For example the addition to the viewuser. Your using donatordays, userid, username but calling the entire table by using * and the users table is a pretty big table!
-
I dont see why the usage of SELECT DISTINCT in this. Is any user or item going to have a duplicate?
-
DJK's example is using Jquery 8o
-
Well yes you are correct there but on zu for example you can get a item from several different areas so the method I mention is to automatically arrange the items. The duplicate exists but the player never sees it.
-
You can do this by doing a mysql query using count, group_concat and sum to check for duplicates, store the id's and the quantity. Add all the items into the inventory and delete all the duplicates. Which is how its done on zu. Worth looking into :D
-
Its a nice bit of work but i dont think its worth your asking price as it is in the demo.
-
Before or after does it matter trying to use a proxy is a big fail.
-
Dot defender will protect your site against known hacking attacks and rules that you set in place. As its not free then I would think your cheapest option would be to pay someone here to do the work for you then your done. You keep asking for how to test for exploits nobody is going to tell you how you can exploit or hack. If you search the forums you will find information on where to look for exploits. I can highly recommend Paul, Dominion, Equinox, DJK and Danny who have all shown themselves as having significant knowledge in PHP to be able to do this for you at a reasonable price. As for myself I have very little spare time so my time costs a lot more. Im a business man :D If you cannot afford to pay anyone then your left to learning yourself. Now if you want to go down that route and I am pretty sure that if you show signs of trying to learn yourself but are still getting it slightly wrong then you will get help.
-
Is this another one of those cases where he wants to know how to exploit and fix the exploits so he can then go around finding new games to exploit and then say I can fix that for you.... :whistling: Jordan your way too cheap. Im TELLING him ill charge $350 8o
-
LOL good luck with that. No seriously good luck with not wanting to learn anything and just expecting it to be given especially seen as your not asking us politely your telling us too.
-
There is no need for phpmyadmin access either. Secure the files and provide a sql for the client to run if required. Its understood the client gave you the cpanel details. Just not the way I would choose to work.
-
Mccodes Lite - What happened to the re-code?
rulerofzu replied to Rasheed saeed's topic in General Discussion
LOL seriously.... if you have the time to recode mc lite just write your own engine and release that instead. -
FTP login.... download all files....modify....upload all files....done in 2 logins. Seems heck of a lot quicker and easier than using the file manager Each to their own though :P
-
I agree with DJK why are you even asking for cpanel access? You do not require it to secure files. Why are you also using proxies?? FTP access at most and that would not be blocked by the cpanel brute force routine. Unless this is a ldf firewall issue which is probably unlikely as you have to pay extra for that service
-
As nobody can be bothered to go learn even the basics anymore
-
I only charge $290 more than Paul.
-
Forgot to mention..... name it farming.php previous sql's work fine.
-
<?php include("globals.php"); $f_main=$db->query('select * from farmdb where owner='.$_SESSION['userid'].''); $f_result=$db->fetch_row($f_main); function index() { global $ir, $db, $userid, $f_result, $f_main; echo " Welcome to the the city outskirts. Farming ain't just for old losers. Out here we live off the land, and make our own living rather than battling. What would you like to do? "; if($db->num_rows($f_main) == 0) { echo " Registration for farmland and the cost of the initial barn will be 1000 gold. Would you like to buy it? <a href=farming.php?action=barnbou>Yes</a>"; return; } else if ($f_result['barnlevel'] != 10) { echo "[url='farming.php?action=upgrade']Upgrade barn[/url] "; } if ($f_result['plots'] < 50) { echo "[url='farming.php?action=land']Purchase Additional Land[/url] "; } echo "[url='farming.php?action=animals']Buy livestock[/url] [url='farming.php?action=produce']Seed Store[/url] Hire assistants [url='farming.php?action=farm']Visit Farm[/url] "; } function barnbou() { global $ir, $db, $userid, $f_result; if ($ir['money']<'1000') { echo " <center>You can't afford it!</center>"; return; } echo " Here's your license and the keys to your [url='farming.php?action=farm']farm[/url]!"; $db->query("update users set money=money-1000 where userid=$userid"); $db->query("insert into farmdb (id,owner) values ('',$userid)"); } function upgrade() { global $ir, $db, $userid, $f_result; if ($f_result['barnlevel'] == 1) { $dbost = 10000; $next = 2; } if ($f_result['barnlevel'] == 2) { $dbost = 50000; $next = 3; } if ($f_result['barnlevel'] == 3) { $dbost = 150000; $next = 4; } if ($f_result['barnlevel'] == 4) { $dbost = 500000; $next = 5; } if ($f_result['barnlevel'] == 5) { $dbost = 1000000; $next = 6; } if ($f_result['barnlevel'] == 6) { $dbost = 2000000; $next = 7; } if ($f_result['barnlevel'] == 7) { $dbost = 5000000; $next = 8; } if ($f_result['barnlevel'] == 8) { $dbost = 10000000; $next = 9; } if ($f_result['barnlevel'] == 9) { $dbost = 50000000; $next = 10; } echo "Upgrading your barn is easy. As your barn gets bigger, it can process and handle more land."; echo "The next updgrade to your barn will cost ".$dbost.". It will be to level $next. Agree? [url='farming.php?action=upgrade&action2=yes']Yes[/url] "; if($_GET['action2']){ if ($ir['money'] < $dbost) { echo "You can't afford that!"; return; } else { $newmoney = $ir['money']-$dbost; echo "Barn successfully upgraded."; $db->query("Update farmdb set barnlevel='$next' where owner=$userid"); $db->query("Update users set money='$newmoney' where userid=$userid"); } } } function produce() { global $ir, $db, $userid, $f_result; if ($f_result['barnlevel'] ==0) { echo "go get yourself a barn ya city dweller!"; return; } echo "[b]Billy-bob:[/b] Welcome to the seed store. Here you can find the seeds which other farmers delivered to me in exchange for some quick money. You plant these seeds on your land and let 'um grow until you can harvest and sell. But if you leave them too long, they'll dry up and die. [b]Billy-bob:[/b] So what would you like? "; $arraypick = $db->query("select id, cropname, ripeage, spoilage, sellvalue, buyvalue, instock from farm_crop_listdb"); echo "<table><tr><td>[b]Crop Picture[/b]</td><td>[b]Crop Name[/b]</td><td>[b]Crop Price[/b]</td><td>[b]Max Sell value[/b]</td><td>[b]Amount Left[/b]</td><td>[b]Buy amount[/b]</td></tr>"; while ($display = $db->fetch_row($arraypick)) { echo "<tr><td>[img=image/farm/".$display[]</td><td>".$display['cropname']."</td><td><center>".number_format($display['buyvalue'])."</center></td><td><center>".number_format($display['sellvalue'])."</center></td><td><center>".number_format($display['instock'])."</center></td><td><center>[url='farming.php?action=buycrop&id=".$display[']Buy One[/url] [url='farming.php?action=buycrop&id=".$display[']Buy Ten[/url] [url='farming.php?action=buycrop&id=".$display[']Buy Fifty[/url]</center></td></tr>"; } echo "</table> "; } function buycrop() { global $ir, $db, $userid, $f_result; $id=abs((int) $_GET['id']); $amount=abs((int) $_GET['amount']); if($amount==1) { $dbropload = $db->query("select * from farm_crop_listdb where id='$id'"); $dbrop = $db->fetch_row($dbropload); $dbropcheck = $db->query("select * from farm_cropdb where owner=$userid"); $dbropnum = $db->num_rows($dbropcheck); $animload = $db->query("select id, owner, animalname, matureage, age, cost, prod_name, prod_amount, assist_need, food_need, water_need from farm_animdb where owner=$userid"); $animnum = $db->num_rows($animload); $total = $animnum+$dbropnum; $maxplots=($f_result['plots']*10); if ($total > $maxplots) { echo "You do not have enough space to plot this."; return; } if (($ir['money']) < $dbrop['buyvalue']) { echo "You cannot afford this."; return; } else { echo "".$amount." Seed bought and planted."; $db->query("Update users set money=money-".$dbrop['buyvalue']." where userid=$userid"); $db->query("insert into farm_cropdb (id,owner,cropname,sellvalue) values ('',$userid,'".$dbrop['cropname']."','".$dbrop['sellvalue']."')"); $db->query("update farm_crop_listdb set instock=instock-1 where id=".$dbrop['id'].""); return; } } if($amount==10) { $dbropload = $db->query("select * from farm_crop_listdb where id='$id'"); $dbrop = $db->fetch_row($dbropload); $dbropcheck = $db->query("select * from farm_cropdb where owner=$userid"); $dbropnum = $db->num_rows($dbropcheck); $animload = $db->query("select id, owner, animalname, matureage, age, cost, prod_name, prod_amount, assist_need, food_need, water_need from farm_animdb where owner=$userid"); $animnum = $db->num_rows($animload); $total = $animnum+$dbropnum; $maxplots=($f_result['plots']*10); if ($total > $maxplots) { echo "You do not have enough space to plot this."; return; } if (($ir['money']) < $dbrop['buyvalue']) { echo "You cannot afford this."; return; } else { echo "".$amount." Seeds bought and planted."; $i = 1; while ($i <= 10) { $i++; $db->query("Update users set money=money-".$dbrop['buyvalue']." where userid=$userid"); $db->query("insert into farm_cropdb (id,owner,cropname,sellvalue) values ('',$userid,'".$dbrop['cropname']."','".$dbrop['sellvalue']."')"); $db->query("update farm_crop_listdb set instock=instock-10 where id=".$dbrop['id'].""); } return; } } if($amount == 50) { $dbropload = $db->query("select * from farm_crop_listdb where id='$id'"); $dbrop = $db->fetch_row($dbropload); $dbropcheck = $db->query("select * from farm_cropdb where owner=$userid"); $dbropnum = $db->num_rows($dbropcheck); $animload = $db->query("select id, owner, animalname, matureage, age, cost, prod_name, prod_amount, assist_need, food_need, water_need from farm_animdb where owner=$userid"); $animnum = $db->num_rows($animload); $total = $animnum+$dbropnum; $maxplots=($f_result['plots']*10); if ($total > $maxplots) { echo "You do not have enough space to plot this."; return; } if (($ir['money']) < ($dbrop['buyvalue']*50)) { echo "You do not have enough space to plot this."; return; } else { echo "".$amount." Seeds bought and planted. "; $i = 1; while ($i <= 50) { $i++; $db->query("Update users set money=money-".$dbrop['buyvalue']." where userid=$userid"); $db->query("Insert into farm_cropdb (id,owner,cropname,sellvalue) values ('',$userid,'".$dbrop['cropname']."','".$dbrop['sellvalue']."')"); $db->query("update farm_crop_listdb set instock=instock-50 where id=".$dbrop['id'].""); } return; } } echo "Total planted: ".$amount." "; } function animals() { global $ir, $db, $userid, $f_result; if($f_result['barnlevel'] == 0){ echo "You need to get a barn first"; return; } echo "[b]Sarah:[/b] Hi! This is the animals shop. Here you can find the animals that you can use to get you lots of money! You buy these animals, then you feed them and eventually you'll start making money back from their produce. Cool huh? But if you leave them unattended with no assistants, they'll die! [b]Sarah:[/b] So what would you like?"; $arraypick = $db->query("select id, animalname, matureage, cost, prod_name, prod_amount, assist_need, food_need, water_need, instock from farm_anim_listdb"); echo "<table><tr><td>[b]Animal name[/b]</td><td>[b]Animal Price[/b]</td><td>[b]Needs[/b]</td><td>[b]Produces[/b]</td><td>[b]Amount Left[/b]</td><td>[b]Buy[/b]</td></tr>"; while ($display = $db->fetch_row($arraypick)) { echo "<tr><td>".$display['animalname']."</td><td><center>'".number_format($display['cost'])."'</center></td><td>".$display['assist_need']." assistants ".$display['food_need']." food ".$display['water_need']." water</td><td><center>".$display['prod_amount']." ".$display['prod_name']."</center></td><td><center>".$display['instock']."</center></td><td><center>[url='farming.php?action=buyanimals&id=".$display[']Buy[/url]</center></td></tr>"; } echo "</table> "; } function buyanimals(){ global $ir, $db, $userid, $f_result; $id=abs((int) $_GET['id']); $animload = $db->query("select id, animalname, matureage, cost, prod_name, prod_amount, assist_need, food_need, water_need, instock from farm_anim_listdb where id=$id"); $anim_result=$db->fetch_row($animload); $dbropcheck = $db->query("select id, owner, cropname, age, sellvalue, nectadded, plot from farm_cropdb where owner=$userid"); $dbropnum = $db->num_rows($dbropcheck); $animload = $db->query("select id, owner, animalname, matureage, age, cost, prod_name, prod_amount, assist_need, food_need, water_need from farm_animdb where owner=$userid"); $animnum = $db->num_rows($animload); $total = $animnum+$dbropnum; $maxplots=($f_result['plots']*10); if ($total > $maxplots) { echo "You do not have enough space to contain this animal."; return; } if ($ir['money'] < $cost) { echo "You cannot afford this."; return; } else { echo "[b]Sarah:[/b] I'll send that animal right over! "; $db->query("update users set money=money-{$anim_result['cost']} where userid=$userid"); $purchase=sprintf('insert into farm_animdb (owner,animalname,cost,matureage,prod_name,prod_amount,assist_need,food_need,water_need) values (%d,"%s",%d,%d,"%s",%d,%d,%d,%d)', $userid,$anim_result['animalname'],$anim_result['matureage'],$anim_result['cost'],$anim_result['prod_name'], $anim_result['prod_amount'],$anim_result['assist_need'],$anim_result['food_need'],$anim_result['water_need'],$anim_result['instock']); $db->query($purchase); return; $db->query("update farm_anim_listdb set instock=instock-1 where id=$id"); } } function farm() { global $ir, $db, $userid, $f_result; $arraypick = $db->query("select cl.*,fc.* from farm_crop_listdb cl LEFT JOIN farm_cropdb fc ON cl.cropname=fc.cropname where fc.owner=$userid"); echo "You make your way to your dusty, damp old farm. You gaze over your ".$f_result['plots']." acres of land and head towards your barn. [b]Crops:[/b] <table><tr><td>[b]Crop Picture[/b]</td><td>[b]Crop Name[/b]</td><td>[b]Amount[/b]</td><td>[b]Options[/b]</td></tr>"; while ($display = $db->fetch_row($arraypick)) { echo "<tr><td>[img=image/farm/".$display[]</td><td>".$display['cropname']."</td><td><center>".$amount2."</center></td><td><center><a href=farming.php?action=viewcrop&name=".str_replace(" ","%20","".$display['cropname']."").">View</a></center></td></tr>"; } echo "</table>"; $animpick = $db->query("select al.*,fa.* from farm_anim_listdb al LEFT JOIN farm_animdb fa ON al.animalname=fa.animalname where fa.owner=$userid"); echo "[b]Animals:[/b] <table><tr><td>[b]Animal Name[/b]</td><td>[b]Amount[/b]</td><td>[b]Options[/b]</td></tr>"; while ($display = $db->fetch_row($animpick)) { echo "<tr><td>".$display['animalname']."</td><td><center>".$amount2."</center></td><td><center><a href=farming.php?action=viewanimal&name=".str_replace (" ","%20","".$display['animalname']."").">View</a></center></td></tr>"; } echo "</table> [b]Equipment:[/b] "; if ($f_result['waterpump'] > 0){echo "Water pump (".$f_result['waterpump'].") ";} if ($f_result['foodmach'] > 0){echo "Food machine (".$f_result['foodmach'].") ";} echo " [b]Resources:[/b] Food: ".$f_result['food']." Water: ".$f_result['water']." "; } function viewcrop() { global $db, $ir, $userid, $f_result; $name=$db->escape($_GET['name']); $c_query=$db->query("select * from farm_cropdb where owner=".$userid.""); $c_count=$db->num_rows($c_query); if ($c_count == 0) { echo "You do not have any of this crop!"; return; } else { echo "<table><tr><td>[b]Age[/b]</td><td>[b]Options[/b]</td><td>[b]Crop evaluation[/b]</td></tr>"; while ($dbropget = $db->fetch_row($c_query)) { if (!$x) { echo "[b]<u>Viewing crop ".$dbropget['cropname']."[/b]</u> "; $x++; } if ($dbropget['age']==0) { $advice = "There has been no growth yet."; } if ($dbropget['age']>0 && $dbropget['age']<3) { $advice = "This crop is now visible."; } if ($dbropget['age']>2 && $dbropget['age']<5) { $advice = "This crop is still growing."; } if ($dbropget['age']>4 && $dbropget['age']<10) { $advice = "This crop looks edible."; } if ($dbropget['age']>9 && $dbropget['age']<20) { $advice = "This crop looks perfect."; } $name=$dbropget['cropname']; echo "<tr><td><center>".$dbropget['age']."</center></td><td><center><a href=farming.php?action=sellcrop&id=".$dbropget['id'].">Sell</a></center></td><td>".$advice."</td></tr>"; } echo "</table>"; echo "<form action=farming.php?action=sellall&name=$name method=post> [b]Sell all ".$name."'s at <select name=age size=1> <option value=1>1</option> <option value=2>2</option> <option value=3>3</option> <option value=4>4</option> <option value=5>5</option> <option value=6>6</option> <option value=7>7</option> <option value=8>8</option> <option value=9>9</option> <option value=10>10</option> <option value=11>11</option> <option value=12>12</option> <option value=13>13</option> <option value=14>14</option> <option value=15>15</option> <option value=16>16</option> <option value=17>17</option> <option value=18>18</option> <option value=19>19</option> <option value=20>20</option> <option value=21>21</option> <option value=22>22</option> <option value=23>23</option> <option value=24>24</option> <option value=25>25</option> <option value=26>26</option> <option value=27>27</option> <option value=28>28</option> <option value=29>29</option> <option value=30>30</option> </select> days old. <input type=submit value=Confirm></form>"; } } function sellall() { global $db,$ir,$userid; $age=abs((int) $_GET['age']); $name=$db->escape($_GET['name']); echo "All crop's at ".$age." days old sold."; echo " [b]Summary:[/b] "; $arraypick = $db->query("select * from farm_crop_listdb where cropname='$name'"); $dbropcheck = $db->fetch_row($arraypick); $dbrops = $db->query("select * from farm_cropdb where cropname='$name' AND age='$age' and owner=$userid"); while ($display = $db->fetch_row($dbrops)) { $dbropnum++; if ($dbropcheck['ripeage'] != $display['age']) { $nonripe++; $totalmade=$totalmade+($dbropcheck['buyvalue']/2); } else { $ripe++; $totalmade=$totalmade+$dbropcheck['sellvalue']; } $rem = $db->query("delete from farm_cropdb where id='".$display['id']."'"); } echo "[b]Total crops sold:[/b] $dbropnum [b]Total ripe:[/b] $ripe [b]Total unripe:[/b] $nonripe [b]Total money for selling all your ".$name.":[/b] $totalmade "; $end = $db->query("update users set money=money+$totalmade where userid=userid"); } function sellcrop() { global $db,$ir,$userid; $id=abs((int) $_GET['id']); $dbroppick = $db->query("select * from farm_cropdb where id='$id' && owner='$userid'"); $dbropget = $db->fetch_row($dbroppick); $arraypick = $db->query("select * from farm_crop_listdb where cropname='".$dbropget['cropname']."'"); $dbropcheck = $db->fetch_row($arraypick); if (!$dbropget) { echo "This crop does not exist."; } else { echo $dbropget['cropname']." sold."; if ($dbropcheck['ripeage'] != $dbropget['age']) { echo " This crop is not worth anything in that condition. I'm afraid all I can give you is half what you paid."; $rem_crop= $db->query("delete from farm_cropdb where id='$id'"); $newmoney = $ir['money']+($dbropcheck['buyvalue']/2); $add_money= $db->query("update users set money='$newmoney' where userid='$userid'"); } else { echo " This crop is perfect!"; $rem_crop= $db->query("delete from farm_cropdb where id='$id'"); $newmoney = $ir['money']+$dbropcheck['sellvalue']; $add_money= $db->query("update users set money='$newmoney' where userid='$userid'"); } } } function land() { global $f_result,$db,$userid,$ir; echo "Purchasing more land for your barn will allow you to use more plants at one time. 1 Acre can hold 10 plots. Each plant takes 1 plot. Land costs 5000 money each. You may only have 5 land max per level of barn under current laws. Amount to purchase: <form action=farming.php method=post> <input type=text name=amount size=2> <input type=hidden name=action value=land> <input type=submit value=Purchase></form>"; $amount=abs((int) $_POST['amount']); $dbheck = $amount+$f_result['plots']; $dbost = $amount*5000; if(($dbheck > 50) || ($dbheck>($f_result['barnlevel']*5))) { echo "You cannot have that many plots!"; return; } if($amount<0) { echo "This bug has been patched."; return; } if($dbost > $ir['money']) { echo "You cannot afford it!"; return; } else { $newmoney = $ir['money']-$dbost; $newplots = $f_result['plots']+$amount; $db->query("Update farmdb set plots='$newplots' where owner='$userid'"); $db->query("Update users set money='$newmoney' where userid='$userid'"); } } switch($_REQUEST['action']) { case 'barnfi' : barnfi(); break; case 'barnbou' : barnbou(); break; case 'upgrade': upgrade(); break; case 'produce': produce(); break; case 'buycrop': buycrop(); break; case 'animals': animals(); break; case 'buyanimals': buyanimals(); break; case 'farm': farm(); break; case 'viewcrop': viewcrop(); break; case 'sellcrop' : sellcrop(); break; case 'sellall': sellall(); break; case 'land': land(); break; case 'index': default:index();break; } ?> This is now working. Notes....hire assistants and sell animals was not in the code submitted by the original OP. Im not going to do it so your on your own or if someone else wants to make them functions. Tested all functions present do what they should. Errors work where they should. If ive missed anything your own your own from here :P