-
Posts
65 -
Joined
-
Last visited
Personal Information
-
Location
Québec, Canada
Recent Profile Visitors
The recent visitors block is disabled and is not being shown to other users.
secret_life's Achievements
Newbie (1/14)
1
Reputation
-
why this line if($ir['user_level'] != 2 && $ir['userid'] != 288) { echo "New Roulette being placed"; $h->endpage(); exit();
-
yep is what i have do ;)
-
line 2 at 24 ??? V2
-
Do you thinks Newspaper is important in game ?
secret_life replied to secret_life's topic in General Discussion
I have think take it off, so i will add some feature to it later i don't want put energy on it for now because i have to many thing to think in other feature -
Do you thinks Newspaper is important in game ?
secret_life replied to secret_life's topic in General Discussion
I made this poll because I dont know what to add inside. I think I'll put important updates and advertising -
Looking for beta testers for my upcoming game.
secret_life replied to DopeboyGFX's topic in Generic RPG
When signup Fatal error: Cannot redeclare url_exists() (previously declared in /home/themafi5/public_html/classes.php:3) in /home/themafi5/public_html/classes.php on line 9 activation link is in the subjet of the message *** ? in classified.php error you can see Table 'themafi5_themafiakings.ads' doesn't exist hitlist not protected for sql injection Warning: mysql_fetch_array() expects parameter 1 to be resource, boolean given in /home/themafi5/public_html/classes.php on line 959 I sugest close beta and pass trougt all file to protect it -
All is in poll :)
-
dont find answer to this question to we need to compare all this vote1,vote2,vote3,vote4,vote5,vote6,vote7,vote8,vote9,vote10 and select high value and associate to choice1,choice2,choice3,choice4,choice5,choice6,choice7,choice8,choice9,choice10 and enter choice with more vote in winner field. But i dont know how to do it. I know max() is for column but i this case i don't know how do it anyone can help ? Thanks
-
ok i have found other bug corected here <?php include "globals.php"; echo "<center><h3>Trading</h3><hr width=75%>"; $_GET['act'] = isset($_GET['action']) && ctype_alpha($_GET['action']) ? trim($_GET['action']) : 'Index'; switch($_GET['action']) { default: Index(); break; case 'accept': accept_request(); break; case 'decline': decline_request(); break; case 'acctrade': accept_trade(); break; case 'dectrade': decline_trade(); break; case 'view': view_trade(); break; case 'begin': begin_trade(); break; case 'cancel': cancel_trade(); break; } function Index() { global $db,$ir,$c,$userid,$h; $_GET['ID'] = abs((int) $_GET['ID']); $_POST['user'] = abs((int) $_POST['user']); $chek=$db->query("SELECT * FROM usertrades WHERE trFROM=$userid OR trUSER=$userid"); $chek2=$db->query("SELECT * FROM users WHERE userid={$_POST['user']}"); if(!$_POST['user']) { echo " <form action='trade.php' method='post'> Please type the ID# of the user you wish to trade with below. ID: <input type='text' name='user' value='{$_GET['ID']}' maxlength='10' length='10' size='10' width='10' /> <input type='submit' value='Send Request' /> </form> <hr width=75%> <a href='explore.php'>Back</a><hr width=75%>"; } else if($ir['trade']) { echo " You already have a trade pending completion. Please wait until it is over. <hr width=75%> <a href='trade.php'>Back</a><hr width=75%>"; } else if($_POST['user'] == $userid) { echo " You cannot trade with yourself! <hr width=75%> <a href='trade.php'>Back</a><hr width=75%>"; } else if($db->num_rows($chek2) == 0) { echo "User do not exist <hr width=75%> <a href='trade.php'>Back</a><hr width=75%>"; } else if($db->num_rows($chek)) { echo "You already have send a trade request. <hr width=75%> <a href='trade.php'>Back</a><hr width=75%>"; } else { mysql_query("INSERT INTO usertrades VALUES ('', '$userid', '{$_POST['user']}')", $c); $q=$db->query("SELECT * FROM usertrades WHERE trFROM=$userid"); $r=$db->fetch_row($q); event_add($_POST['user'], "<a href='viewuser.php?u={$ir['userid']}'>{$ir['username']}</a> would like to trade with you: • <a href='trade.php?action=accept&ID={$r['trID']}'>Accept Offer</a> • <a href='trade.php?action=decline&ID={$r['trID']}'>Decline Offer</a>", $c,'general'); echo " Trade request sent! <hr width=75%>> <a href='explore.php'>Back</a><hr width=75%>"; } } function accept_request() { global $db,$ir,$c,$userid,$h; $_GET['ID'] = abs((int) $_GET['ID']); $q=$db->query("SELECT * FROM usertrades WHERE trID={$_GET['ID']}"); $r=$db->fetch_row($q); if(!$_GET['ID']) { echo " Invalid trade ID! <hr width=75%>> <a href='explore.php'>Back</a><hr width=75%>"; } else if($r['trUSER'] != $userid) { echo " You cannot accept this trade! <hr width=75%>> <a href='explore.php'>Back</a><hr width=75%>"; } else { $q=$db->query("SELECT * FROM usertrades WHERE trUSER=$userid"); $r=$db->fetch_row($q); event_add($r['trFROM'], "<a href='viewuser.php?u={$ir['userid']}'>{$ir['username']}</a> has accepted your trade offer: • <a href='trade.php?action=begin'>Begin Trade</a> • <a href='trade.php?action=cancel'>Cancel Trade</a> ", $c); mysql_query("UPDATE users SET trade={$r['trFROM']} WHERE userid=$userid"); mysql_query("UPDATE users SET trade=$userid WHERE userid={$r['trFROM']}"); echo " Trade request accepted! <hr width=75%>> <a href='explore.php'>Back</a><hr width=75%>"; } } function decline_request() { global $db,$ir,$c,$userid,$h; $_GET['ID'] = abs((int) $_GET['ID']); $q=$db->query("SELECT * FROM usertrades WHERE trID={$_GET['ID']}"); $r=$db->fetch_row($q); if(!$_GET['ID']) { echo " Invalid trade ID! <hr width=75%>> <a href='explore.php'>Back</a><hr width=75%>"; } else if($r['trUSER'] != $userid) { echo " You cannot decline this trade! <hr width=75%>> <a href='explore.php'>Back</a><hr width=75%>"; } else { $q=$db->query("SELECT * FROM usertrades WHERE trID={$_GET['ID']}"); $r=$db->fetch_row($q); event_add($r['trFROM'], "<a href='viewuser.php?u={$ir['userid']}'>{$ir['username']}</a> has declined your trade offer.", $c); mysql_query("DELETE FROM usertrades WHERE trID={$_GET['ID']}"); echo " Trade request declined! <hr width=75%>> <a href='explore.php'>Back</a><hr width=75%>"; } } function cancel_trade() { global $db,$ir,$c,$userid,$h; $q=$db->query("SELECT * FROM users WHERE trade=$userid"); $r=$db->fetch_row($q); if(!$ir['trade']) { echo " You are not in a trade! <hr width=75%>> <a href='explore.php'>Back</a><hr width=75%>"; } else if($r['trade'] != $userid) { echo " This user is not in a trade with you! <hr width=75%>> <a href='explore.php'>Back</a><hr width=75%>"; } else { $q=$db->query("SELECT * FROM users WHERE trade=$userid"); $r=$db->fetch_row($q); event_add($r['userid'], "<a href='viewuser.php?u={$ir['userid']}'>{$ir['username']}</a> has cancelled the trade.", $c); mysql_query("UPDATE users SET trade=0 WHERE userid=$userid"); mysql_query("UPDATE users SET trade=0 WHERE userid={$r['userid']}"); mysql_query("DELETE FROM usertrades WHERE trUSER=$userid OR trFROM=$userid"); echo " Trade cancelled! <hr width=75%>> <a href='explore.php'>Back</a><hr width=75%>"; } } function view_trade() { global $db,$ir,$c,$userid,$h; $q=$db->query("SELECT * FROM trades WHERE trUSER=$userid"); $r=$db->fetch_row($q); $rs=$db->num_rows($q); if($r['trUSER'] != $userid) { echo " This is not your trade! <hr width=75%>> <a href='explore.php'>Back</a><hr width=75%>"; } else if(!$rs) { echo " This trade has not yet been started! <hr width=75%>> <a href='explore.php'>Back</a><hr width=75%>"; } else { $q=$db->query("SELECT * FROM trades WHERE trUSER=$userid"); $r=$db->fetch_row($q); echo " <b><u>Trade Details</b></u><br><br><br> <b>OFFER</b><br><br> Money: \${$r['trCASH']}<br> Golds: {$r['trCRYS']}<br> "; $x=$db->query("SELECT * FROM items WHERE itmid={$r['trITEM']}"); $i=$db->fetch_row($x); if ($r['trITEM']) { echo "Item: {$i['itmname']}<br><br> "; } else { echo "Item: <font color=red>None</font><br><br> "; } echo " <b>REQUEST</b><br><br> Money: \${$r['trRCASH']}<br> Golds: {$r['trRCRYS']}<br> "; $x2=$db->query("SELECT * FROM items WHERE itmid={$r['trRITEM']}"); $i2=$db->fetch_row($x2); if ($r['trRITEM']) { echo "Item: {$i2['itmname']}<br><br>"; } else { echo "Item: <font color=red>None</font><br><br>"; } if ($userid == $r['trUSER']) { echo " • <a href='trade.php?action=acctrade&ID={$r['trID']}'>Accept Trade</a> • <a href='trade.php?action=dectrade&ID={$r['trID']}'>Decline Trade</a>"; } echo " <hr width=75%>> <a href='explore.php'>Back</a><hr width=75%>"; } } function begin_trade() { global $db,$ir,$c,$userid,$h; $chek=$db->query("SELECT * FROM trades WHERE trFROM=$userid OR trUSER=$userid"); $chek2=$db->query("SELECT * FROM usertrades WHERE trFROM=$userid"); if($db->num_rows($chek)) { echo "You have already send a trade <hr width=75%> <a href='trade.php'>Back</a><hr width=75%>"; $h->endpage(); exit; } if($db->num_rows($chek2) == 0) { echo "This is not your trade <hr width=75%> <a href='trade.php'>Back</a><hr width=75%>"; $h->endpage(); exit; } if (!$ir['trade']) { echo " You are not in a trade. <hr width=75%>> <a href='explore.php'>Back</a><hr width=75%>"; $h->endpage(); exit; } if($_POST['crys'] || $_POST['cash'] || $_POST['item'] || $_POST['rcrys'] || $_POST['rcash'] || $_POST['ritem']) { $_POST['crys'] = abs((int) $_POST['crys']); $_POST['cash'] = abs((int) $_POST['cash']); $_POST['item'] = abs((int) $_POST['item']); $_POST['rcrys'] = abs((int) $_POST['rcrys']); $_POST['rcash'] = abs((int) $_POST['rcash']); $_POST['ritem'] = abs((int) $_POST['ritem']); $db->query("INSERT INTO trades VALUES(NULL, '{$ir['userid']}', '{$ir['trade']}', '{$_POST['crys']}', '{$_POST['cash']}', '{$_POST['item']}', '{$_POST['rcrys']}', '{$_POST['rcash']}', '{$_POST['ritem']}')"); mysql_query("DELETE FROM usertrades WHERE trFROM=$userid"); event_add($ir['trade'], "This is the trade offer: • <a href='trade.php?action=view'>View Trade</a> ", $c); echo " Your trade was submitted. <hr width=75%>> <a href='explore.php'>Back</a><hr width=75%>"; } else { echo "<form action='trade.php?action=begin' method='post'> <b>OFFER</b><br><br> Golds: <input type='text' name='crys' /><br> Cash: <input type='text' name='cash' /><br> Item: <select name='item' type=dropdown> <option value=0 selected>None</option>"; $q=$db->query("SELECT inv.*,i.* FROM inventory inv LEFT JOIN items i ON inv.inv_itemid=i.itmid WHERE inv.inv_userid={$userid} ORDER BY i.itmname ASC",$c); while($r=mysql_fetch_array($q)) { echo "\n<option value='{$r['itmid']}'>{$r['itmname']}</option>"; } echo "</select><br><br>"; echo " <b>REQUEST</b><br><br> Golds: <input type='text' name='rcrys' /><br> Cash: <input type='text' name='rcash' /><br> Item: <select name='ritem' type=dropdown> <option value=0 selected>None</option>"; $q=$db->query("SELECT inv.*,i.* FROM inventory inv LEFT JOIN items i ON inv.inv_itemid=i.itmid WHERE inv.inv_userid={$ir['trade']} ORDER BY i.itmname ASC",$c); while($r=mysql_fetch_array($q)) { echo "\n<option value='{$r['itmid']}'>{$r['itmname']}</option>"; } echo "</select><br><br>"; echo "<input type='submit' value='Submit' /></form> <hr width=75%>> <a href='explore.php'>Back</a><hr width=75%>"; } } function accept_trade() { global $db,$ir,$c,$userid,$h; $_GET['ID'] = abs((int) $_GET['ID']); $q=$db->query("SELECT * FROM trades WHERE trID={$_GET['ID']}"); $r=$db->fetch_row($q); $x=$db->query("SELECT * FROM users WHERE userid={$ir['trade']}"); $y=$db->fetch_row($x); $m=$db->query("SELECT * FROM inventory WHERE inv_itemid={$r['trITEM']} AND inv_userid={$r['trFROM']}"); $n=$db->num_rows($m); $o=$db->query("SELECT * FROM inventory WHERE inv_itemid={$r['trRITEM']} AND inv_userid={$r['trUSER']}"); $p=$db->num_rows($o); if(!$_GET['ID']) { echo " Invalid trade ID! <hr width=75%>> <a href='explore.php'>Back</a><hr width=75%>"; } else if($r['trUSER'] != $userid) { echo " You cannot accept this trade! <hr width=75%>> <a href='explore.php'>Back</a><hr width=75%>"; } else if($r['trRCASH'] > $ir['money'] || $r['trRCRYS'] > $ir['crystals']) { echo " You do not meet one or more of the requirements! <hr width=75%>> <a href='explore.php'>Back</a><hr width=75%>"; } else if($y['money'] < $r['trCASH'] || $y['crystals'] < $r['trCRYS'] ) { echo " Your friend does not meet one or more of the requirements! <hr width=75%>> <a href='explore.php'>Back</a><hr width=75%>"; } else if(!$n < 0) { echo " Your friend does not meet one or more of the requirements! <hr width=75%>> <a href='explore.php'>Back</a><hr width=75%>"; } else if(!$p < 0) { echo " You do not meet one or more of the requirements! <hr width=75%>> <a href='explore.php'>Back</a><hr width=75%>"; } else { $q=$db->query("SELECT * FROM trades WHERE trUSER=$userid"); $r=$db->fetch_row($q); event_add($r['trFROM'], "<a href='viewuser.php?u={$ir['userid']}'>{$ir['username']}</a> has accepted your trade.", $c); if ($r['trITEM'] > 0) { mysql_query("UPDATE inventory SET inv_qty=inv_qty-1 WHERE inv_itemid={$r['trITEM']} AND inv_userid={$r['trFROM']}",$c); mysql_query("DELETE FROM inventory WHERE inv_qty=0",$c); item_add($userid, $r['trITEM'], 1); } if ($r['trRITEM'] > 0) { mysql_query("UPDATE inventory SET inv_qty=inv_qty-1 WHERE inv_itemid={$r['trRITEM']} AND inv_userid=$userid",$c); mysql_query("DELETE FROM inventory WHERE inv_qty=0",$c); item_add($r['trFROM'], $r['trRITEM'], 1); } mysql_query("UPDATE users SET trade=0, money=money+{$r['trCASH']}, crystals=crystals+{$r['trCRYS']}, money=money-{$r['trRCASH']}, crystals=crystals-{$r['trRCRYS']} WHERE userid=$userid"); mysql_query("UPDATE users SET trade=0, money=money+{$r['trRCASH']}, crystals=crystals+{$r['trRCRYS']}, money=money-{$r['trCASH']}, crystals=crystals-{$r['trCRYS']} WHERE userid={$r['trFROM']}"); mysql_query("DELETE FROM trades WHERE trUSER=$userid"); echo " Trade request accepted! <hr width=75%>> <a href='explore.php'>Back</a><hr width=75%>"; } } function decline_trade() { global $db,$ir,$c,$userid,$h; $_GET['ID'] = abs((int) $_GET['ID']); $q=$db->query("SELECT * FROM trades WHERE trID={$_GET['ID']}"); $r=$db->fetch_row($q); if(!$_GET['ID']) { echo " Invalid trade ID! <hr width=75%>> <a href='explore.php'>Back</a><hr width=75%>"; } else if($r['trUSER'] != $userid) { echo " You cannot decline this trade! <hr width=75%>> <a href='explore.php'>Back</a><hr width=75%>"; } else { $q=$db->query("SELECT * FROM trades WHERE trID={$_GET['ID']}"); $r=$db->fetch_row($q); event_add($r['trFROM'], "<a href='viewuser.php?u={$ir['userid']}'>{$ir['username']}</a> has declined your trade offer.", $c); mysql_query("DELETE FROM trades WHERE trID={$_GET['ID']}"); mysql_query("UPDATE users SET trade=0 WHERE userid={$ir['trade']}"); mysql_query("UPDATE users SET trade=0 WHERE userid=$userid"); echo " Trade declined! <hr width=75%>> <a href='explore.php'>Back</a><hr width=75%>"; } } $h->endpage(); ?> Seker i dont know which language you speak but i don't understand sorry
-
sooo nobody post a working version sooo i made it. I have make corection in code and add some security. I re coded it for myself but i share it for other <?php include "globals.php"; echo "<center><h3>Trading</h3><hr width=75%>"; $_GET['act'] = isset($_GET['action']) && ctype_alpha($_GET['action']) ? trim($_GET['action']) : 'Index'; switch($_GET['action']) { default: Index(); break; case 'accept': accept_request(); break; case 'decline': decline_request(); break; case 'acctrade': accept_trade(); break; case 'dectrade': decline_trade(); break; case 'view': view_trade(); break; case 'begin': begin_trade(); break; case 'cancel': cancel_trade(); break; } function Index() { global $db,$ir,$c,$userid,$h; $_GET['ID'] = abs((int) $_GET['ID']); $_POST['user'] = abs((int) $_POST['user']); $chek=$db->query("SELECT * FROM usertrades WHERE trFROM=$userid AND trUSER={$_POST['user']} OR trFROM={$_POST['user']} AND trUSER=$userid"); $chek2=$db->query("SELECT * FROM users WHERE userid={$_POST['user']}"); if(!$_POST['user']) { echo " <form action='trade.php' method='post'> Please type the ID# of the user you wish to trade with below. ID: <input type='text' name='user' value='{$_GET['ID']}' maxlength='10' length='10' size='10' width='10' /> <input type='submit' value='Send Request' /> </form> <hr width=75%> <a href='explore.php'>Back</a><hr width=75%>"; } else if($ir['trade']) { echo " You already have a trade pending completion. Please wait until it is over. <hr width=75%> <a href='trade.php'>Back</a><hr width=75%>"; } else if($_POST['user'] == $userid) { echo " You cannot trade with yourself! <hr width=75%> <a href='trade.php'>Back</a><hr width=75%>"; } else if($db->num_rows($chek2) == 0) { echo "User do not exist <hr width=75%> <a href='trade.php'>Back</a><hr width=75%>"; } else if($db->num_rows($chek)) { echo "You already have send a trade request to this user or he already send you a request. Please go see your Events or contact other user. <hr width=75%> <a href='trade.php'>Back</a><hr width=75%>"; } else { mysql_query("INSERT INTO usertrades VALUES ('', '$userid', '{$_POST['user']}')", $c); $q=$db->query("SELECT * FROM usertrades WHERE trFROM=$userid"); $r=$db->fetch_row($q); event_add($_POST['user'], "{$ir['username']} would like to trade with you: • <a href='trade.php?action=accept&ID={$r['trID']}'>Accept Offer</a> • <a href='trade.php?action=decline&ID={$r['trID']}'>Decline Offer</a>", $c,'general'); echo " Trade request sent! <hr width=75%>> <a href='explore.php'>Back</a><hr width=75%>"; } } function accept_request() { global $db,$ir,$c,$userid,$h; $_GET['ID'] = abs((int) $_GET['ID']); $q=$db->query("SELECT * FROM usertrades WHERE trID={$_GET['ID']}"); $r=$db->fetch_row($q); if(!$_GET['ID']) { echo " Invalid trade ID! <hr width=75%>> <a href='explore.php'>Back</a><hr width=75%>"; } else if($r['trUSER'] != $userid) { echo " You cannot accept this trade! <hr width=75%>> <a href='explore.php'>Back</a><hr width=75%>"; } else { $q=$db->query("SELECT * FROM usertrades WHERE trUSER=$userid"); $r=$db->fetch_row($q); event_add($r['trFROM'], "{$ir['username']} has accepted your trade offer: • <a href='trade.php?action=cancel&ID={$r['trID']}'>Cancel Trade</a> • <a href='trade.php?action=begin'>Begin Trade</a> ", $c); mysql_query("UPDATE users SET trade={$r['trFROM']} WHERE userid=$userid"); mysql_query("UPDATE users SET trade=$userid WHERE userid={$r['trFROM']}"); mysql_query("DELETE FROM usertrades WHERE trID={$_GET['ID']}"); echo " Trade request accepted! <hr width=75%>> <a href='explore.php'>Back</a><hr width=75%>"; } } function decline_request() { global $db,$ir,$c,$userid,$h; $_GET['ID'] = abs((int) $_GET['ID']); $q=$db->query("SELECT * FROM usertrades WHERE trID={$_GET['ID']}"); $r=$db->fetch_row($q); if(!$_GET['ID']) { echo " Invalid trade ID! <hr width=75%>> <a href='explore.php'>Back</a><hr width=75%>"; } else if($r['trUSER'] != $userid) { echo " You cannot decline this trade! <hr width=75%>> <a href='explore.php'>Back</a><hr width=75%>"; } else { $q=$db->query("SELECT * FROM usertrades WHERE trID={$_GET['ID']}"); $r=$db->fetch_row($q); event_add($r['trFROM'], "{$ir['username']} has declined your trade offer.", $c); mysql_query("DELETE FROM usertrades WHERE trID={$_GET['ID']}"); echo " Trade request declined! <hr width=75%>> <a href='explore.php'>Back</a><hr width=75%>"; } } function cancel_trade() { global $db,$ir,$c,$userid,$h; $q=$db->query("SELECT * FROM users WHERE trade=$userid"); $r=$db->fetch_row($q); if(!$ir['trade']) { echo " You are not in a trade! <hr width=75%>> <a href='explore.php'>Back</a><hr width=75%>"; } else if($r['trade'] != $userid) { echo " This user is not in a trade with you! <hr width=75%>> <a href='explore.php'>Back</a><hr width=75%>"; } else { $q=$db->query("SELECT * FROM users WHERE trade=$userid"); $r=$db->fetch_row($q); event_add($r['userid'], "{$ir['username']} has cancelled the trade.", $c); mysql_query("UPDATE users SET trade=0 WHERE userid=$userid"); mysql_query("UPDATE users SET trade=0 WHERE userid={$r['userid']}"); echo " Trade cancelled! <hr width=75%>> <a href='explore.php'>Back</a><hr width=75%>"; } } function view_trade() { global $db,$ir,$c,$userid,$h; $q=$db->query("SELECT * FROM trades WHERE trUSER=$userid"); $r=$db->fetch_row($q); $rs=$db->num_rows($q); if($r['trUSER'] != $userid) { echo " This is not your trade! <hr width=75%>> <a href='explore.php'>Back</a><hr width=75%>"; } else if(!$rs) { echo " This trade has not yet been started! <hr width=75%>> <a href='explore.php'>Back</a><hr width=75%>"; } else { $q=$db->query("SELECT * FROM trades WHERE trUSER=$userid"); $r=$db->fetch_row($q); echo " <b><u>Trade Details</b></u><br><br><br> <b>OFFER</b><br><br> Money: \${$r['trCASH']}<br> Crystals: {$r['trCRYS']}<br> "; $x=$db->query("SELECT * FROM items WHERE itmid={$r['trITEM']}"); $i=$db->fetch_row($x); if ($r['trITEM']) { echo "Item: {$i['itmname']}<br><br> "; } else { echo "Item: <font color=red>None</font><br><br> "; } echo " <b>REQUEST</b><br><br> Money: \${$r['trRCASH']}<br> Crystals: {$r['trRCRYS']}<br> "; $x2=$db->query("SELECT * FROM items WHERE itmid={$r['trRITEM']}"); $i2=$db->fetch_row($x2); if ($r['trRITEM']) { echo "Item: {$i2['itmname']}<br><br>"; } else { echo "Item: <font color=red>None</font><br><br>"; } if ($userid == $r['trUSER']) { echo " • <a href='trade.php?action=acctrade&ID={$r['trID']}'>Accept Trade</a> • <a href='trade.php?action=dectrade&ID={$r['trID']}'>Decline Trade</a>"; } echo " <hr width=75%>> <a href='explore.php'>Back</a><hr width=75%>"; } } function begin_trade() { global $db,$ir,$c,$userid,$h; if($_POST['crys'] || $_POST['cash'] || $_POST['item'] || $_POST['rcrys'] || $_POST['rcash'] || $_POST['ritem']) { $q=$db->query("SELECT * FROM users WHERE userid=$userid"); $r=mysql_fetch_array($q); if (!$ir['trade']) { echo " You are not in a trade. <hr width=75%>> <a href='explore.php'>Back</a><hr width=75%>"; $h->endpage(); exit; } $_POST['crys'] = abs((int) $_POST['crys']); $_POST['cash'] = abs((int) $_POST['cash']); $_POST['item'] = abs((int) $_POST['item']); $_POST['rcrys'] = abs((int) $_POST['rcrys']); $_POST['rcash'] = abs((int) $_POST['rcash']); $_POST['ritem'] = abs((int) $_POST['ritem']); $db->query("INSERT INTO trades VALUES(NULL, '{$ir['userid']}', '{$ir['trade']}', '{$_POST['crys']}', '{$_POST['cash']}', '{$_POST['item']}', '{$_POST['rcrys']}', '{$_POST['rcash']}', '{$_POST['ritem']}')"); event_add($ir['trade'], "Your trade offer has been sent: • <a href='trade.php?action=view'>View Trade</a> • <a href='trade.php?action=cancel&ID={$r['trID']}'>Cancel Trade</a> ", $c); echo " Your trade was submitted. <hr width=75%>> <a href='explore.php'>Back</a><hr width=75%>"; } else { echo "<form action='trade.php?action=begin' method='post'> <b>OFFER</b><br><br> Crystals: <input type='text' name='crys' /><br> Cash: <input type='text' name='cash' /><br> Item: <select name='item' type=dropdown> <option value=0 selected>None</option>"; $q=$db->query("SELECT inv.*,i.* FROM inventory inv LEFT JOIN items i ON inv.inv_itemid=i.itmid WHERE inv.inv_userid={$userid} ORDER BY i.itmname ASC",$c); while($r=mysql_fetch_array($q)) { echo "\n<option value='{$r['itmid']}'>{$r['itmname']}</option>"; } echo "</select><br><br>"; echo " <b>REQUEST</b><br><br> Crystals: <input type='text' name='rcrys' /><br> Cash: <input type='text' name='rcash' /><br> Item: <select name='ritem' type=dropdown> <option value=0 selected>None</option>"; $q=$db->query("SELECT inv.*,i.* FROM inventory inv LEFT JOIN items i ON inv.inv_itemid=i.itmid WHERE inv.inv_userid={$ir['trade']} ORDER BY i.itmname ASC",$c); while($r=mysql_fetch_array($q)) { echo "\n<option value='{$r['itmid']}'>{$r['itmname']}</option>"; } echo "</select><br><br>"; echo "<input type='submit' value='Submit' /></form> <hr width=75%>> <a href='explore.php'>Back</a><hr width=75%>"; } } function accept_trade() { global $db,$ir,$c,$userid,$h; $_GET['ID'] = abs((int) $_GET['ID']); $q=$db->query("SELECT * FROM trades WHERE trID={$_GET['ID']}"); $r=$db->fetch_row($q); $x=$db->query("SELECT * FROM users WHERE userid={$ir['trade']}"); $y=$db->fetch_row($x); $m=$db->query("SELECT * FROM inventory WHERE inv_itemid={$r['trITEM']} AND inv_userid={$r['trFROM']}"); $n=$db->num_rows($m); $o=$db->query("SELECT * FROM inventory WHERE inv_itemid={$r['trRITEM']} AND inv_userid={$r['trUSER']}"); $p=$db->num_rows($o); if(!$_GET['ID']) { echo " Invalid trade ID! <hr width=75%>> <a href='explore.php'>Back</a><hr width=75%>"; } else if($r['trUSER'] != $userid) { echo " You cannot accept this trade! <hr width=75%>> <a href='explore.php'>Back</a><hr width=75%>"; } else if($r['trRCASH'] > $ir['money'] || $r['trRCRYS'] > $ir['crystals']) { echo " You do not meet one or more of the requirements! <hr width=75%>> <a href='explore.php'>Back</a><hr width=75%>"; } else if($y['money'] < $r['trCASH'] || $y['crystals'] < $r['trCRYS'] ) { echo " Your friend does not meet one or more of the requirements! <hr width=75%>> <a href='explore.php'>Back</a><hr width=75%>"; } else if(!$n < 0) { echo " Your friend does not meet one or more of the requirements! <hr width=75%>> <a href='explore.php'>Back</a><hr width=75%>"; } else if(!$p < 0) { echo " You do not meet one or more of the requirements! <hr width=75%>> <a href='explore.php'>Back</a><hr width=75%>"; } else { $q=$db->query("SELECT * FROM trades WHERE trUSER=$userid"); $r=$db->fetch_row($q); event_add($r['trFROM'], "{$ir['username']} has accepted your trade.", $c); if ($r['trITEM'] > 0) { mysql_query("UPDATE inventory SET inv_qty=inv_qty-1 WHERE inv_itemid={$r['trITEM']} AND inv_userid={$r['trFROM']}",$c); mysql_query("DELETE FROM inventory WHERE inv_qty=0",$c); item_add($userid, $r['trITEM'], 1); } if ($r['trRITEM'] > 0) { mysql_query("UPDATE inventory SET inv_qty=inv_qty-1 WHERE inv_itemid={$r['trRITEM']} AND inv_userid=$userid",$c); mysql_query("DELETE FROM inventory WHERE inv_qty=0",$c); item_add($r['trFROM'], $r['trRITEM'], 1); } mysql_query("UPDATE users SET trade=0, money=money+{$r['trCASH']}, crystals=crystals+{$r['trCRYS']}, money=money-{$r['trRCASH']}, crystals=crystals-{$r['trRCRYS']} WHERE userid=$userid"); mysql_query("UPDATE users SET trade=0, money=money+{$r['trRCASH']}, crystals=crystals+{$r['trRCRYS']}, money=money-{$r['trCASH']}, crystals=crystals-{$r['trCRYS']} WHERE userid={$r['trFROM']}"); mysql_query("DELETE FROM trades WHERE trUSER=$userid"); echo " Trade request accepted! <hr width=75%>> <a href='explore.php'>Back</a><hr width=75%>"; } } function decline_trade() { global $db,$ir,$c,$userid,$h; $_GET['ID'] = abs((int) $_GET['ID']); $q=$db->query("SELECT * FROM trades WHERE trID={$_GET['ID']}"); $r=$db->fetch_row($q); if(!$_GET['ID']) { echo " Invalid trade ID! <hr width=75%>> <a href='explore.php'>Back</a><hr width=75%>"; } else if($r['trUSER'] != $userid) { echo " You cannot decline this trade! <hr width=75%>> <a href='explore.php'>Back</a><hr width=75%>"; } else { $q=$db->query("SELECT * FROM trades WHERE trID={$_GET['ID']}"); $r=$db->fetch_row($q); event_add($r['trFROM'], "{$ir['username']} has declined your trade offer.", $c); mysql_query("DELETE FROM trades WHERE trID={$_GET['ID']}"); mysql_query("UPDATE users SET trade=0 WHERE userid={$ir['trade']}"); mysql_query("UPDATE users SET trade=0 WHERE userid=$userid"); echo " Trade declined! <hr width=75%>> <a href='explore.php'>Back</a><hr width=75%>"; } } $h->endpage(); ?>
-
Up Any update on when this is going to be finished MTG?
-
Is not an error is a warning he dont bug your code Another warning : protect your user entry at least: $id=abs((int) $_GET['ID']); $amount=abs((int) $_POST['amount'];
-
Ok i have converted it and remove $rm because i dont know what this supposed to be. I have a table for crime stat, so change it to your stat table to fit your game. <?php //Made by 21lockdown //This wont damage or affect the code //Please don't remove it include "globals.php"; $allstat=$db->query("SELECT crimew,crimef FROM more_stat WHERE userid='{$ir['userid']}'"); $asee=$db->fetch_row($allstat); $crimestat= $asee['crimew']+$asee['crimef']; $level = ($ir['level'] >= 5); $level2 = ($ir['level'] >= 10); $level3 = ($ir['level'] >= 20); $level4 = ($ir['level'] >= 50); $level5 = ($ir['level'] >= 100); $crimetotal = ($crimestat >= 10); $crimetotal2 = ($crimestat >= 50); $crimetotal3 = ($crimestat >= 500); $crimetotal4 = ($crimestat >= 10000); $crimewon = ($asee['crimew'] >= 10); $crimewon2 = ($asee['crimew'] >= 50); $crimewon3 = ($asee['crimew'] >= 500); $crimewon4 = ($asee['crimew'] >= 5000); $crimewon5 = ($asee['crimew'] >= 1000); $strength = ($ir['strength'] >= 1000); $strength2 = ($ir['strength'] >= 50000); $strength3 = ($ir['strength'] >= 1000000); ?> Here you can view your past milestones you have achieved <table class='topbar'> <tr> <td> <?php if($level){ echo "[img=/icons/accept.png] You have reached level 5"; } else { echo"[img=/icons/lock.png] Reach level 5 to unlock this!"; } ?> </td> </tr> </table> <table class='topbar'> <tr> <td> <?php if($level2){ echo "[img=/icons/accept.png] You have reached level 10"; } else { echo"[img=/icons/lock.png] Reach level 10 to unlock this!"; } ?> </td> </tr> </table> <table class='topbar'> <tr> <td> <?php if($level3){ echo "[img=/icons/accept.png] You have reached level 20"; } else { echo"[img=/icons/lock.png] Reach level 20 to unlock this!"; } ?> </td> </tr> </table> <table class='topbar'> <tr> <td> <?php if($level4){ echo "[img=/icons/accept.png] You have reached level 50"; } else { echo"[img=/icons/lock.png] Reach level 50 to unlock this!"; } ?> </td> </tr> </table> <table class='topbar'> <tr> <td> <?php if($level5){ echo "[img=/icons/accept.png] You have reached level 100"; } else { echo"[img=/icons/lock.png] Reach level 100 to unlock this!"; } ?> </td> </tr> </table> <table class='topbar'> <tr> <td> <?php if($crimetotal){ echo "[img=/icons/accept.png] You have done 10 crimes"; } else { echo"[img=/icons/lock.png] Do 10 crimes to unlock this!"; } ?> </td> </tr> </table> <table class='topbar'> <tr> <td> <?php if($crimetotal2){ echo "[img=/icons/accept.png] You have done 50 crimes"; } else { echo"[img=/icons/lock.png] Do 50 crimes to unlock this!"; } ?> </td> </tr> </table> <table class='topbar'> <tr> <td> <?php if($crimetotal3){ echo "[img=/icons/accept.png] You have done 500 crimes"; } else { echo"[img=/icons/lock.png] Do 500 crimes to unlock this!"; } ?> </td> </tr> </table> <table class='topbar'> <tr> <td> <?php if($crimetotal4){ echo "[img=/icons/accept.png] You have done 10000 crimes"; } else { echo"[img=/icons/lock.png] Do 10000 crimes to unlock this!"; } ?> </td> </tr> </table> <table class='topbar'> <tr> <td> <?php if($crimewon){ echo "[img=/icons/accept.png] You have completed 10 crimes successfully!"; } else { echo"[img=/icons/lock.png] Successfully complete 10 crimes to unlock this!"; } ?> </td> </tr> </table> <table class='topbar'> <tr> <td> <?php if($crimewon2){ echo "[img=/icons/accept.png] You have completed 50 crimes successfully!"; } else { echo"[img=/icons/lock.png] Successfully complete 50 crimes to unlock this!"; } ?> </td> </tr> </table> <table class='topbar'> <tr> <td> <?php if($crimewon3){ echo "[img=/icons/accept.png] You have completed 500 crimes successfully!"; } else { echo"[img=/icons/lock.png] Successfully complete 500 crimes to unlock this!"; } ?> </td> </tr> </table> <table class='topbar'> <tr> <td> <?php if($crimewon4){ echo "[img=/icons/accept.png] You have completed 5000 crimes successfully!"; } else { echo"[img=/icons/lock.png] Successfully complete 5000 crimes to unlock this!"; } ?> </td> </tr> </table> <table class='topbar'> <tr> <td> <?php if($crimewon5){ echo "[img=/icons/accept.png] You have completed 10000 crimes successfully!"; } else { echo"[img=/icons/lock.png] Successfully complete 10000 crimes to unlock this!"; } ?> </td> </tr> </table> <table class='topbar'> <tr> <td> <?php if($strength){ echo "[img=/icons/accept.png] You have 1000 strength!"; } else { echo"[img=/icons/lock.png] Get 1000 strength!"; } ?> </td> </tr> </table> <table class='topbar'> <tr> <td> <?php if($strength2){ echo "[img=/icons/accept.png] You have 50000 strength!"; } else { echo"[img=/icons/lock.png] Get 50000 strength!"; } ?> </td> </tr> </table> <table class='topbar'> <tr> <td> <?php if($strength3){ echo "[img=/icons/accept.png] You have 1000000 strength!"; } else { echo"[img=/icons/lock.png] Get 1000000 strength!"; } ?> </td> </tr> </table> <?php $h->endpage(); ?>
-
That mod has been converted to Mccode v2 finaly?
-
google translator don't have lack, he just translate word to word and tries to give the sentences in the right order. I am French and i create my game in english and it is very hard to create a game without mistake. If you think english is complicate try to make no mistake in French. To have a good translate version, you need to rent a translator in a compagny to have warranty. Because if your translator make a mistake, user can make legal action on you. How do you know he translate correctly if you can't read this language. This reminds me of a Chinese tattoo that this guy is doing on the arm believing the seller on the translation. But it is all your choice, you make what you want ;)