3XTR3M3 Posted September 15, 2007 Share Posted September 15, 2007 I Converted from ddays do here it is do the sql You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. Then make smarket.php add this You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. any problems contact me Quote Link to comment Share on other sites More sharing options...
3XTR3M3 Posted September 15, 2007 Author Share Posted September 15, 2007 Re: Supporter Days{v1} easy done working on my game so should work on yours feel free give me +1 Quote Link to comment Share on other sites More sharing options...
3XTR3M3 Posted September 16, 2007 Author Share Posted September 16, 2007 Re: Supporter Days{v1} come on tell me about it Quote Link to comment Share on other sites More sharing options...
UCC Posted September 17, 2007 Share Posted September 17, 2007 Re: Supporter Days{v1} If you insist. I think it is stupid. You have donator days, that's all you need. Supporter days are quite pointless Quote Link to comment Share on other sites More sharing options...
Isomerizer Posted September 17, 2007 Share Posted September 17, 2007 Re: Supporter Days{v1} If you insist. I think it is stupid. You have donator days, that's all you need. Supporter days are quite pointless Agreed. Quote Link to comment Share on other sites More sharing options...
Savager Posted September 21, 2007 Share Posted September 21, 2007 Re: Supporter Days{v1} If you insist. I think it is stupid. You have donator days, that's all you need. Supporter days are quite pointless Agreed. Agreed. LMAO :mrgreen: Quote Link to comment Share on other sites More sharing options...
g-unit Posted October 11, 2007 Share Posted October 11, 2007 Re: Supporter Days{v1} i just converted it v2 smarket.php <?php // Supporter Days Market // Originally DDay Market // Editted and released by Liam include "globals.php"; switch($_GET['action']) { case "buy": sdays_buy(); break; case "remove": sdays_remove(); break; case "add": sdays_add(); break; default: sdays_index(); break; } function sdays_index() { global $ir,$c,$userid,$h; print "[Add A Listing] <table width=100%> <tr> <th>Adder</th> <th>Qty</th> <th>Price each</th> <th>Price total</th> <th>Links</th> </tr>"; $q=mysql_query("SELECT sd.*, u.* FROM sdaysmarket sd LEFT JOIN users u ON u.userid=sd.sdADDER ORDER BY sdPRICE/sdQTY ASC",$c); while($r=mysql_fetch_array($q)) { if($r['sdADDER'] == $userid) { $link = "Remove"; } else { $link = "Buy"; } $each= (int) $r['sdPRICE'] / $r['sdQTY']; echo "<tr> <td>{$r['username']} [{$r['userid']}]</td> <td>{$r['sdQTY']}</td> <td> \$" . number_format($each)."</td> <td>\$".number_format($r['sdPRICE'])."</td> <td>[$link]</td> </tr>"; } echo "</table>"; } function sdays_remove() { global $ir,$c,$userid,$h; $q=mysql_query("SELECT * FROM sdaysmarket WHERE sdID={$_GET['ID']} AND sdADDER=$userid",$c); if(!mysql_num_rows($q)) { echo "Error, either these Supporter Market Days do not exist, or you are not the owner. > Back"; $h->endpage(); exit; } $r=mysql_fetch_array($q); mysql_query("UPDATE users SET supporterdays=supporterdays+{$r['ddQTY']} where userid=$userid",$c) or die(mysql_error()); _query("DELETE FROM sdaysmarket WHERE sdID={$_GET['ID']}",$c); echo "Supporter Days removed from market! mysql > Back"; } function sdays_buy() { global $ir,$c,$userid,$h; $q=mysql_query("SELECT * FROM sdaysmarket sd WHERE sdID={$_GET['ID']}",$c); if(!mysql_num_rows($q)) { echo "Error, either these Supporter Days do not exist, or they have already been bought. > Back"; $h->endpage(); exit; } $r=mysql_fetch_array($q); if($r['sdPRICE'] > $ir['money']) { echo "Error, you do not have the funds to buy these Supporter Days. > Back"; $h->endpage(); exit; } mysql_query("UPDATE users SET supporterdays=supporterdays+{$r['sdQTY']} where userid=$userid",$c) or die(mysql_error()); mysql_query("DELETE FROM sdaysmarket WHERE sdID={$_GET['ID']}",$c); mysql_query("UPDATE users SET money=money-{$r['sdPRICE']} where userid=$userid",$c); mysql_query("UPDATE users SET money=money+{$r['sdPRICE']} where userid={$r['sdADDER']}",$c); event_add($r['sdADDER'],"{$ir['username']} bought your {$r['sdQTY']} Supporter Days from the market for \$".number_format($r['sdPRICE']).".",$c); print "You bought the {$r['sdQTY']} Supporter Days from the market for \$".number_format($r['sdPRICE']).". Back"; } function sdays_add() { global $ir,$c,$userid,$h; $_POST['amnt'] = abs((int) $_POST['amnt']); $_POST['price'] = abs((int) $_POST['price']); if($_POST['amnt']) { if($_POST['amnt'] > $ir['supporterdays']) { die ("You are trying to add more Supporter Days to the market than you have."); } $tp=$_POST['amnt']*$_POST['price']; mysql_query("INSERT INTO sdaysmarket VALUES('',{$_POST['amnt']},$userid,$tp)", $c); mysql_query("UPDATE users SET supporterdays=supporterdays-{$_POST['amnt']} WHERE userid=$userid", $c); echo "supporter days added to market! > Back"; } else { echo "Adding a listing... You have {$ir['supporterdays']} Suporter Days that you can add to the market. <form action='smarket.php?action=add' method='post'> <table width=50% border=2> <tr> <td>Supporter Days:</td> <td><input type='text' name='amnt' value='{$ir['supporterdays']}' /></td> </tr> <tr> <td>Price Each:</td> <td><input type='text' name='price' value='2000' /></td> </tr> <tr> <td colspan=2 align=center> <input type='submit' value='Add To Market' /> </tr> </table> </form>"; } } $h->endpage(); ?> Quote Link to comment Share on other sites More sharing options...
iseeyou94056 Posted October 18, 2007 Share Posted October 18, 2007 Re: Supporter Days{v1} thanks Quote Link to comment Share on other sites More sharing options...
H4L101 Posted June 11, 2008 Share Posted June 11, 2008 Re: Supporter Days{v1} Working V2 Converted You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.