Jump to content
MakeWebGames

Djkanna

Members
  • Posts

    3,138
  • Joined

  • Last visited

  • Days Won

    36

Everything posted by Djkanna

  1. This is a nice idea, I'd use something along these lines though, function findUser($user) { global $db; if( !filter_var($user, FILTER_VALIDATE_INT) ) return false; else $user = abs(filter_var($user, FILTER_SANITIZE_NUMBER_INT)); $users = $db->query('SELECT `username`, `user_level` FROM `users` WHERE (`userid` = '.$user.')'); if( $db->num_rows( $users ) > 0 ) { $colours = array ( 0 => '#999', 1 => '#C3C3C3', 2 => '#FFF', 3 => '#444' ); $u = $db->fetch_row( $users ); $resultString = '[url="viewuser.php?u='.$user.'"]<span style="colour: '.$colours[$u['user_level']].';">'.$u['username'].'</span>[/url]';// Change as required return $resultString; } else { return false; } } findUser($ir['userid']); *Forgive any error, half asleep but you get the idea. You could also add Gang Tag support within it too :/ Anyway nice one Illusions.
  2. LOL, you tell 'em Illusions.
  3. Just don't use abs(@intval()) period... Also no need for the in_array() function on the switch cases as if it's not an available case it will go straight to the default.
  4. Not only that but things like notepad no matter how you style it in notepad it becomes squished on MWG and anywhere else you may post it
  5. http://www.pastebin.com Code pasting and generally text pasting online service. You may want to move from Notepad (I think that's what you're coding in now) and go to something more advance like notepad++
  6. <?php include "globals.php"; print "<h3>Donator Day Market</h3>"; $_GET['ID']=abs(@intval($_GET['ID'])); $price = 2000;//change 2000 to the price you want DDays to sell / buy for switch($_GET['action']) { case "buy":ddays_buy();break; case "remove":ddays_remove();break; case "add":ddays_add();break; default:ddays_index();break; } function ddays_index() { global $ir,$c,$userid,$h; $price = 2000; //change 2000 to the price you want DDays to sell / buy forprint "[Add A Listing]"; $q=mysql_query("SELECT dd.*, u.* FROM ddaysmarket dd LEFT JOIN users u ON u.userid=dd.ddADDER ORDER BY ddQTY ASC",$c); while($r=mysql_fetch_array($q)) { if($r['ddADDER'] == $userid) { $link = "Remove"; } else { $link = "Buy"; } $each= (int) $r['ddPRICE'] / $r['ddQTY']; echo ""; } echo "AdderQtyPrice eachPrice totalLinks {$r['username']} [{$r['userid']}] {$r['ddQTY']} \$" . number_format($each)." \$".number_format($r['ddPRICE'])." [$link]"; } function ddays_remove(){ global $ir,$c,$userid,$h; $q=mysql_query("SELECT * FROM ddaysmarket WHERE ddID={$_GET['ID']} AND ddADDER=$userid",$c); if(!mysql_num_rows($q)) { echo "Error, either these Donator Days do not exist, or you are not the owner.> Back"; $h->endpage(); exit; } $r=mysql_fetch_array($q); mysql_query("UPDATE users SET donatordays=donatordays+{$r['ddQTY']} where userid=$userid",$c) or die(mysql_error()); mysql_query("DELETE FROM ddaysmarket WHERE ddID={$_GET['ID']}",$c); echo "Donator Days removed from market!> Back"; } function ddays_buy() { global $ir,$c,$userid,$h; $price = 2000; $q=mysql_query("SELECT * FROM ddaysmarket dd WHERE ddID={$_GET['ID']}",$c); if(!mysql_num_rows($q)) { echo "Error, either these Donator Days do not exist, or they have already been bought.> Back"; $h->endpage(); exit; } $r=mysql_fetch_array($q); if($r['ddPRICE'] > $ir['money']) { echo "Error, you do not have the funds to buy these Donator Days.> Back"; $h->endpage(); exit; } mysql_query("UPDATE users SET donatordays=donatordays+{$r['ddQTY']} where userid=$userid",$c) or die(mysql_error()); mysql_query("DELETE FROM ddaysmarket WHERE ddID={$_GET['ID']}",$c); mysql_query("UPDATE users SET money=money-{$r['ddPRICE']} where userid=$userid",$c); mysql_query("UPDATE users SET money=money+{$r['ddPRICE']} where userid={$r['ddADDER']}",$c); event_add($r['ddADDER'],"{$ir['username']} bought your {$r['ddQTY']} Donator Days from the market for \$".number_format($r['ddPRICE']).".",$c); print "You bought the {$r['ddQTY']} Donator Days from the market for \$".number_format($r['ddPRICE']).".Back"; } function ddays_add() { global $ir,$c,$userid,$h; $price = 2000; //change 2000 to the price you want DDays to sell / buy for $_POST['amnt'] = abs((int) $_POST['amnt']); if($_POST['amnt']) { if($_POST['amnt'] > $ir['donatordays']) { die ("You are trying to add more Donator Days to the market than you have."); } $tp=$_POST['amnt']*$price; mysql_query("INSERT INTO ddaysmarket VALUES('',{$_POST['amnt']},$userid,$tp)", $c); mysql_query("UPDATE users SET donatordays=donatordays-{$_POST['amnt']} WHERE userid=$userid", $c); echo "Donator Days added to market! > Back"; } else { echo "Adding a listing...You have {$ir['donatordays']} Donator Days that you can add to the market.Donator Days: $ ".number_format($price)." per each donator day"; } } $h->endpage(); ?> I think everything is still in there, I may have got confused half way through. Lilith, for your first modification, this is good well done.
  7. WooP, but we'd find this useful because? There's already to many **** sites out there as it is.
  8. Illusions for best idea, (lots) Floydian for best developed (Gang mod)
  9. Djkanna

    Website!

    You stated twisted had posted in the wrong section, Nothing useful to the subject - I deleted his reply so thought might as well do urs too Oh lol I forgot I posted that XD
  10. Best as in well developed or best as in the best ideas?
  11. I'll take one (with Toffee please) :)
  12. Djkanna

    Website!

    -.- Deleted my post why?
  13. Love it.
  14. Djkanna

    Website!

    Link To Image
  15. You won't get this for free nowadays, however finding a free template then using it for a game isn't hard so maybe you could do it that way?
  16. I'd suggest keeping it friendly (it's heading the way to unfriendlyness(not a word I know spell checker)). It's a good idea, though the concept lacks. I like the idea of rewarding active members but giving them all a single crystal each day isn't the right way to go about it.
  17. Oh no 'Big Brother' is sending out Trojans, this means everyone is infected after all most do use Google. Let me guess, the programme that detected this virus was Avast?
  18. This usually means your query that your passing through has failed.
  19. Nice layout, takes a little time to load upon first load but it's nice. Good work, Dave & George.
  20. Djkanna

    Website!

    Images have failed.
  21. Well I'm glad he's trying to make up for it, but I'm also glad the point has been made that people with think about it before working with him. Best of luck.
  22. I read it as he plays around with creating forums.
  23. Fair enough, but I do know a handful of people what would love to jump on that offer and use that phrase against me (people no likey me :( ) XD Yeah, I'll stop too (I think)
  24. Okay that kinda makes me think he's a f00 or he knew that was your friend and was just trying to rub it in who knows. Anyway lets let the community judge :D
  25. It's fishy yes, your also right at being concerned but still, wait see how it all pans out. If he happens to screw someone over after this, you are more than welcome to use the phrase "I told you so".
×
×
  • Create New...