-
Posts
65 -
Joined
-
Last visited
Content Type
Profiles
Forums
Events
Everything posted by secret_life
-
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 ;)
-
i thinks you should separate in 2 server. Don't mix English people with French people for exemple. If english user cannot communicate with other.
-
Thanks for reply I got McCodes 2.0.2b my staff files was move to an other folder This is my sglobals.php <?php /*--------------------------------- -- MCCodes 2.0 -- By Dabomstew ---------------------------------*/ session_start(); if(get_magic_quotes_gpc() == 0) { foreach($_POST as $k => $v) { $_POST[$k]=addslashes($v); } foreach($_GET as $k => $v) { $_GET[$k]=addslashes($v); } } require "../global_func.php"; if($_SESSION['loggedin']==0) { header("Location: ../index.html");exit; } $userid=$_SESSION['userid']; require "../header.php"; include "../config.php"; global $_CONFIG; define("MONO_ON", 1); require "../class/class_db_{$_CONFIG['driver']}.php"; $db=new database; $db->configure($_CONFIG['hostname'], $_CONFIG['username'], $_CONFIG['password'], $_CONFIG['database'], $_CONFIG['persistent']); $db->connect(); $c=$db->connection_id; $set=array(); $settq=$db->query("SELECT * FROM settings"); while($r=$db->fetch_row($settq)) { $set[$r['conf_name']]=$r['conf_value']; } $domain=$_SERVER['HTTP_HOST']; global $jobquery, $housequery; if($jobquery) { $is=$db->query("SELECT u.*,us.*,j.*,jr.* FROM users u LEFT JOIN userstats us ON u.userid=us.userid LEFT JOIN jobs j ON j.jID=u.job LEFT JOIN jobranks jr ON jr.jrID=u.jobrank WHERE u.userid=$userid"); } else if($housequery) { $is=$db->query("SELECT u.*,us.*,h.* FROM users u LEFT JOIN userstats us ON u.userid=us.userid LEFT JOIN houses h ON h.hWILL=u.maxwill WHERE u.userid=$userid"); } else { $is=$db->query("SELECT u.*,us.* FROM users u LEFT JOIN userstats us ON u.userid=us.userid WHERE u.userid=$userid"); } $ir=$db->fetch_row($is); if($ir['force_logout']) { $db->query("UPDATE users SET force_logout=0 WHERE userid=$userid"); session_unset(); session_destroy(); header("Location: ../login.php"); exit; } if($ir['user_level'] <= 1) { die("403: Access Denied"); } global $macropage; if($macropage && !$ir['verified'] && $set['validate_on']==1) { header("Location: ../macro1.php?refer=$macropage"); } check_level(); $h = new headers; $h->startheaders(); $fm=money_formatter($ir['money']); $cm=money_formatter($ir['crystals'],''); $lv=date('F j, Y, g:i a',$ir['laston']); global $atkpage; $staffpage=1; if($atkpage) { $h->userdata($ir,$lv,$fm,$cm,0); } else { $h->userdata($ir,$lv,$fm,$cm); } $h->smenuarea(); ?> I have create an other sglobals2.php without this line if(get_magic_quotes_gpc() == 0) { foreach($_POST as $k => $v) { $_POST[$k]=addslashes($v); } foreach($_GET as $k => $v) { $_GET[$k]=addslashes($v); } } Now All work but i have this line appears in chat box array(1) { [0]=> array(3) { [0]=> string(5) "level" [1]=> string(1) ">" [2]=> string(1) "0" } } I think this is my requirement unserialize. Why this appears in my chat box ? thanks
-
Ok so many thing don't work. I can't enter any requirement for chat channel. In my game and in your demo on your website. What going wrong ? Saving setting in chat setting do nothing. ( no probleme with this in your demo ) Warning: Invalid argument supplied for foreach() in /staff_chat.php on line 94 I dont want post line of code because is a paid code Thanks
-
<!-- Do Not Remove Powered By Ravan Scripts without permission . However, if you would like to use the script without the powered by links you may do so by purchasing a Copyright removal license for a very low fee. --> You know Ravan is an illegal copy of mccodes ?
-
Yes is better :) thanks
-
6 years later you gona have an answer lol Change this function gang_staff_wardeclare() { global $db,$ir,$c,$userid,$gangdata; if(isset($_POST['subm'])) { $_POST['gang'] = abs((int) $_POST['gang']); By this function gang_staff_wardeclare() { global $db,$ir,$c,$h,$userid,$gangdata; if(isset($_POST['subm'])) { $_POST['gang'] = abs((int) $_POST['gang']); $inwar=$db->query("SELECT * FROM gangwars where warDECLARER={$_POST['gang']} AND warDECLARED={$ir['gang']}"); if($db->num_rows($inwar) > 0){ echo"You are already in war with this gang"; $h->endpage(); exit; } $inwar=$db->query("SELECT * FROM gangwars where warDECLARER={$ir['gang']} AND warDECLARED={$_POST['gang']}"); if($db->num_rows($inwar) > 0){ echo"You are already in war with this gang"; $h->endpage(); exit; } Is for new people who don't find an answer why you can declare war on same gang multiple time
-
Ok just do it simple. I post for who have never find good anwser in post Replace $_POST['sur'] = abs((int) $_POST['sur']); $q=$db->query("SELECT surWAR FROM surrenders WHERE surID={$_POST['sur']}"); list($_POST['war']) = $db->fetch_row($q); $wq=$db->query("SELECT * FROM gangwars where warID={$_POST['war']}"); $r=$db->fetch_row($wq); if($gangdata['gangID'] == $r['warDECLARER']) { $w="You";$f="warDECLARED"; } else { $w="Them";$f="warDECLARER"; } $db->query("DELETE FROM surrenders WHERE surID={$_POST['sur']}"); $db->query("DELETE FROM gangwars WHERE warID={$_POST['war']}"); $ggq=$db->query("SELECT * FROM gangs WHERE gangID=".$r[$f]); $them=$db->fetch_row($ggq); $event=str_replace("'","''","<a href='gangs.php?action=view&ID={$ir['gang']}'>{$gangdata['gangNAME']}</a> have accepted the surrender from <a href='gangs.php?action=view&ID={$them['gangID']}'>{$them['gangNAME']}</a>, the war is over!"); $db->query("INSERT INTO gangevents VALUES('',{$ir['gang']},unix_timestamp(),'$event') , ('',".$r[$f].",unix_timestamp(),'$event')"); echo "You have accepted surrender, the war is over."; By this $_POST['sur'] = abs((int) $_POST['sur']); $q=$db->query("SELECT surWAR FROM surrenders WHERE surID={$_POST['sur']}"); $warfetch = $db->fetch_row($q); $wq=$db->query("SELECT * FROM gangwars where warID={$warfetch['surWAR']}"); $r=$db->fetch_row($wq); if($gangdata['gangID'] == $r['warDECLARER']) { $w="You";$f="warDECLARED"; } else { $w="Them";$f="warDECLARER"; } $db->query("DELETE FROM surrenders WHERE surID={$_POST['sur']}"); $db->query("DELETE FROM gangwars WHERE warID={$warfetch['surWAR']}"); $ggq=$db->query("SELECT * FROM gangs WHERE gangID=".$r[$f]); $them=$db->fetch_row($ggq); $event=str_replace("'","''","<a href='gangs.php?action=view&ID={$ir['gang']}'>{$gangdata['gangNAME']}</a> have accepted the surrender from <a href='gangs.php?action=view&ID={$them['gangID']}'>{$them['gangNAME']}</a>, the war is over!"); $db->query("INSERT INTO gangevents VALUES('',{$ir['gang']},unix_timestamp(),'$event') , ('',".$r[$f].",unix_timestamp(),'$event')"); echo "You have accepted surrender, the war is over."; Have good day now :)
-
I have change to https://manage.tektonic.net/?affid=10 4 month ago and i will recommand it is why im referer loll I have see this host on this forum They help all time with live chat alwais online night and day, server have good performance. Never ben shut down they have triple ram now is very nice and good price
-
I dont want fetch but count what rank my user are with 2 different condition. avg_rating and vote_count. So if a user have 9.1 / 10 and have 3 vote he must be upper then user who have 9.1 / 10 with 2 vote
-
im there now but i have an error // rating count // $total_ratingscnt = 0; $ratingcount = $osDB->getOne('SELECT count(id) as ratingcount FROM ! WHERE profileid = ? and rating > ?', array( USER_RATING_TABLE, $_SESSION['UserId'], '0' ) ); $item["ratingcount"] = $ratingcount; $total_ratingscnt += $ratingcount; // rating value // $rowrate = $osDB->getRow('SELECT count(rating) as tv , sum(rating) as sm FROM ! WHERE profileid = ? and rating > ? ', array( USER_RATING_TABLE, $_SESSION['UserId'], '0' ) ); $tv = $rowrate['tv']; $sm = $rowrate['sm']; unset($rowrate); if ( $tv == 0 ) { $ratingvalue = 0; } else { $tv = ($tv == 0) ? 1 : $tv; $ratingvalue = $sm / $tv; $ratingvalue = number_format($ratingvalue,2); } $item["ratingvalue"] = $ratingvalue; $rs=mysql_query("SELECT COUNT(*) AS vote_count, round(avg( rating ),1) AS avg_rating FROM flir_userrating WHERE avg_rating > $ratingvalue AND vote_count > $ratingcount") ; $rankall = mysql_num_rows($rs); Warning: mysql_num_rows() expects parameter 1 to be resource, boolean given in ... line 469 that line $rs=mysql_query("SELECT COUNT(*) AS vote_count, round(avg( rating ),1) AS avg_rating FROM flir_userrating WHERE avg_rating > $ratingvalue AND vote_count > $ratingcount") ; $rankall = mysql_num_rows($rs); IM LOST