Jump to content
MakeWebGames

Danny696

Members
  • Posts

    2,632
  • Joined

  • Last visited

  • Days Won

    5

Everything posted by Danny696

  1. Danny696

    PHP Help

    Tell us what you know first
  2. i think you mean something like this: $query = sprintf("SELECT * FROM users WHERE userid=%u", $userid); $db->query($query);
  3. Try that. $hosp = $db->query("SELECT u.*, g.* FROM users u LEFT JOIN gangs g ON u.gang=g.gangID WHERE u.hospital >= 1 ORDER BY u.hospital DESC"); while($t = $db->fetch_row($hosp)) { echo'<tr>'; echo sprintf("<td><a href='viewuser.php?u=%u'>%s [img=%s]</a></td>" $t['userid'], $t['username'], $t['display_pic']); echo sprintf("<td>%u</td>", number_format($t['level'])); echo sprintf("<td>%u minutes</td>", number_format($t['hospital'])); echo sprintf("<td>%s</td>", $t['hospreason']); echo'</tr>'; } echo'</table>'; } $h->endpage(); ?>
  4. just a quick thingy, you can use $db->event_add, this will also insert the event into a non-existant table called event_log. so you can check the non-existant event logs X(
  5. Danny696

    PHP Mod advice

    I leant by, looking at code, trying to make simple codes, then asking people why they wouldnt work, any critisism, like n00b, i would just ignore. best thing to do is try and make codes that do different things.
  6. $randcrys = rand(1,3); //make sure its not 0 ;) $addcrys = sprintf("UPDATE `users` SET `crystals`=`crystals`+%u WHERE `userid`=%u", abs((@intval) $randcrys), $userid); $db->query($addcrys); event_add($userid, 'While playing '.$set['game_name'].', you found '.number_format($randcrys).', consider it a gift for playing.'); Would work.
  7. Why do you want their whole inv on their viewuser, i think its silly, but thats just me
  8. Im not selling mine anymore tho, the admins wont del it.
  9. do you mean 1) $db->query("some query"); event_add("blahh"); 2) $db->query("event_add('blahh')); ???
  10. Two things, $IP = ($_SERVER['HTTP_X_FORWARDED_FOR']) ? $_SERVER['HTTP_X_FORWARDED_FOR'] : $_SERVER['REMOTE_ADDR']; Is insecure. and whats differnt?
  11. Pm me the code, ill do what i can
  12. Change the forien chars from the name. Its un-professnal
  13. Thanks Zero.
  14. There coder will be checking through it. Well, thats what they said.
  15. if($ir['race'] != $r['item_race'] || $ir['race'] != $r['item_race2'] || $ir['race'] != $r['item_race3'])   Try that, have you set what $r is?
  16. It was a good idea, thanks for the positive feedback, Hope it sells ;).
  17. This mod was suggested by, FrankWiccan. Its a mod, where you do work hourly. Each time you finish it, you gain stats and money, this come with a staff file, so you can build, edit and delete them at your hearts content. It also come with a DHTML toolkit, which was from an open-source site. So when your mouse goes over a sertan part, a box comes up and says what is needed. This would also be a good little thing to have around your site. This runs on crons, you need one new table in the db, 2 new rows in the users table. And two new files, work.php and staff_work.php. If you do not want the DHTML, pm me and i wont add it, or if you want the CSS(for the dhtml box,) in a new file, pm me, the same with the javascript for it. The mod is $10, if you want to buy it, PM me Thanks Danny696 Screenies: Work.php: This is the Default for work.php when the user isn't doing a job This is when the user has started a job and has the right stats This is when the user has started a job with the wrong stats This is the Default for work.php when the user is doing a job This is the vent you get after the job has finished Staff: Adding a new job Selecting a job to edit Editing a job Selecting a job to delete When added,edited or deleted, it just says a small message saying its been made,edited or deleted.
  18. Not to give you away, but arnt you using dreamweaver?
  19. This is a nice little Add-on, was it coded in c or c++? Well done. that will help alot of people out.
  20. Check the code and see if its giving away exp
  21. Why give no crime exp?? whats the harm in that? not like they can lvl off it
  22. Okiee, thanks will do.
  23. It doesnt include the domain.
  24. You could also use a function, then its eiser than typing it all out. heres one i made before (blue peter FTW!!) function fedjail($id,$days,$reason) { global $ir,$db; $reason=$db->escape($reason): $db->query("UPDATE users SET fedjail=$days WHERE userid=$id"); $db->query("INSERT INTO fedjail VALUES('', $id, $days, {$ir['userid']}, '{$reason}')"); return 1; } in use: fedjail($userid,365,'Attempted SQL injection'); Thats one that i made. Only for v2 tho.
×
×
  • Create New...