Jump to content
MakeWebGames

Daron

Members
  • Posts

    151
  • Joined

  • Last visited

Everything posted by Daron

  1. oh yea, very true, thnx once again good sirs lol. i'll go do that now *runs off happily*
  2. Hey just curious is there an mod around that has locations inside locations? like for example lets say i had 3 locations in my db, California, Los Angeles, and New York. In order to travel to L.A you would have to travel to california first. Any mod out like that or similar to that?
  3. ohhh ^_^ thanx Seker! it worked!!!!!! Thanx a lot
  4. Hey i have something im trying work out, i have a tier of ranks, and each rank is earned by being online(well thats what i want) the way i was trying go about it is on my hourly cron have it set so those online go up a rank and those offline go down a rank, BUT i dont know how to properly run that query. i tried this $db->query("UPDATE users SET rank=rank+1 WHERE laston >= time()-15*60");   i think its because this "time()" but im not really sure how to pull this off ????:confused:
  5. ohhhh that makes sooooooo much sense thanx everyone! dont know what i would do without this forum ^_^
  6. Hey i have something on my game when players can make like biography/journal/diary whatever u wanna call it, and they can use bbcode, and i know most people just dont allow images but come on what player dont like to share images xDD BUT i dont want anyone to post any humongous image and mess things up, so is it a way to put a limit on the dimmensions of images posted using bbcode?
  7. =O those links were very enlightening and scary xD, crazy how he ran a script through a image 0.0 thank you for showing me that. So the 2nd link seemed to be most useful and based of what i seen i think what i was suppose to do is add a .htaccess file to the folder with the uploaded avys and add this code right? ForceType application/octet-stream <FilesMatch "(?i)\.gif$"> ForceType image/gif </FilesMatch> <FilesMatch "(?i)\.png$"> ForceType image/png </FilesMatch>
  8. oooh nice, so after reading that i got it so they can overwrite, now u think ya can help me out with figuring how to change the name of the uploads? i thought of an plan to set each persons uploaded avy to be named after them so that way when they upload another it would be assigned same name and just overwrite. EDIT: Nevermind i got it working! It now names the avy after the user here is the code i came up with   function do_pic_change() { global $ir,$c,$userid,$h; $allowedExts = array("gif", "png"); $extension = end(explode(".", $_FILES["file"]["name"])); if ((($_FILES["file"]["type"] == "image/gif") || ($_FILES["file"]["type"] == "image/pjpeg")) && ($_FILES["file"]["size"] < 30000) && in_array($extension, $allowedExts)) { if ($_FILES["file"]["error"] > 0) { echo "Return Code: " . $_FILES["file"]["error"] . "<br />"; } else { $filename = basename($_FILES['file']['name']); $extension = pathinfo($filename, PATHINFO_EXTENSION); $new = $ir['username'].'.'.$extension; move_uploaded_file($_FILES["file"]["tmp_name"], "avys/{$new}"); mysql_query("UPDATE users SET display_pic='avys/{$new}' WHERE userid=$userid",$c); echo "Avy Changed!"; } } else { echo "Invalid file"; } }
  9. ah makes sense, but hmm i might be better off going back to the URLs tho, would save me from having to manually delete who knows how many avys. wish it was a way to overwrite uploaded avys
  10. ight i know this is going be a stupid crazy question and im sure the answer is no, but is it anyway to run a query that deletes from the server o.o not the database. Basically what happened is i created a avy uploading thingy so no more giving url of your avy u have to upload it, and how it works is it uploads the avy to a folder and a query runs to set that newly uploaded avy as your avy. 2 big problems tho, one if an image with the same name exist in the folder it wont allow the pic to be uploaded, and 2 which is the biggest problem, is that if a user uploads another pic then the previous pic is still stored in the folder 0.0 that could be a lot of unnecessary storage taken up, plus users wouldnt be able to use that pic again since a pic of same name cant be uploaded twice. Here is the code:   function do_pic_change() { global $ir,$c,$userid,$h; $allowedExts = array("gif", "png"); $extension = end(explode(".", $_FILES["file"]["name"])); if ((($_FILES["file"]["type"] == "image/gif") || ($_FILES["file"]["type"] == "image/pjpeg")) && ($_FILES["file"]["size"] < 30000) && in_array($extension, $allowedExts)) { if ($_FILES["file"]["error"] > 0) { echo "Return Code: " . $_FILES["file"]["error"] . "<br />"; } else { if (file_exists("avys/" . $_FILES["file"]["name"])) { echo "That avy is already uploaded! "; } else { move_uploaded_file($_FILES["file"]["tmp_name"], "avys/" . $_FILES["file"]["name"]); mysql_query("UPDATE users SET display_pic='avys/{$_FILES['file']['name']}' WHERE userid=$userid",$c); mysql_query("UPDATE users SET display_pic='avys/{$_FILES['file']['name']}' WHERE userid=$userid",$c); echo "Avy Changed!"; } } } else { echo "Invalid file"; } }
  11. xDD oops i didnt even see that thread thanx! I undertstand what yall were saying
  12. Hey how around many queries should be going on, on my site? I have a line of code in to show how many queries are on the page and im using that to monitor the amount of queries i run, whats a good number?
  13. Thnx guys, the array thing worked out for me
  14. Hey i started working on a game from scratch and not using an engine anymore, and im working on my registration page and for my game i have 12 races and its 6 stats and a location that different for each race. So the way i planned to do it was like for example: if ($_POST['race']='Human'') { $location=1; $stat1=15; $stat2=20; } if ($_POST['race']='Dog'') { $location=2; $stat1=30; $stat2=25; }   So it would be 12 different IF statements declaring 7 variables each o.o is there a more efficient and clean way of doing this?
  15. dmca received - unlicensed mccodes install, do not unsuspend [purchasing software not an option as this is a verified dmca]. damn somebody got me suspended =( cruel world not that serious imo, but i guess the things people will do for money...
  16. yea Zu just informed me i didnt know at first, i assume this thread will be locked or deleted soon i guess, i was just trying help people out while raising money for a good server in the process xD didnt know mccodes was that strict.
  17. why is that needed to be ask? i most of the codes i got from the mccodes website i dont even use because i didnt like them, most of my scripts i compiled by reading threads on here and making my own version based off what i see. But my license was a one of the free mccodes licenses
  18. i have 3 different files that allow players to train but here is the most commonly used one <?php $macropage="train.php"; include "globals.php"; if($ir['hospital']) { die("This page cannot be accessed while in hospital."); } $statnames=array( 'Strength' => 'strength', 'Speed' => 'speed', 'Defense' => 'defense', 'Accuracy' => 'accuracy', 'Health' => 'maxhp', 'Spirit' => 'maxspirit', 'Intelligence' => 'IQ', 'Regeneration' => 'regen'); $_POST['amnt']=abs((int) $_POST['amnt']); if(!$ir['jail']) { print "<h3>Training Session</h3><hr />"; } else { print "<h3>Training Session</h3><hr />"; } if($_POST['stat'] && $_POST['amnt']) { $stat=$statnames[$_POST['stat']]; if(!$stat) { die("This stat cannot be trained."); } if($_POST['amnt'] > $ir['stamina']) { print("You do not have enough stamina to train that much.<hr />"); $gain=0; for($i=0; $i<$_POST['amnt']; $i++) { if($ir['spirit'] < 0) { $ir['spirit']=0; } } } else { $db->query("UPDATE `users` SET stamina = stamina - {$_POST['amnt']} WHERE `userid` = $userid"); $inc=$ir[$stat]+$gain; $inc2=$ir['stamina']-$_POST['amnt']; if($stat=="strength") { $gain=$_POST['amnt']; $db->query("UPDATE `users` SET exp = exp + $gain WHERE `userid` = $userid"); $db->query("UPDATE `userstats` SET `{$stat}` = `{$stat}` + $gain WHERE `userid` = $userid"); print " You have gained {$gain} strength."; } elseif($stat=="speed") { $gain=$_POST['amnt']; $db->query("UPDATE `users` SET exp = exp + $gain WHERE `userid` = $userid"); $db->query("UPDATE `userstats` SET `{$stat}` = `{$stat}` + $gain WHERE `userid` = $userid"); print " You have gained {$gain} speed."; } elseif($stat=="defense") { $gain=$_POST['amnt']; $db->query("UPDATE `users` SET exp = exp + $gain WHERE `userid` = $userid"); $db->query("UPDATE `userstats` SET `{$stat}` = `{$stat}` + $gain WHERE `userid` = $userid"); print " You have gained {$gain} defense."; } elseif($stat=="accuracy") { $gain=$_POST['amnt']; $db->query("UPDATE `users` SET exp = exp + $gain WHERE `userid` = $userid"); $db->query("UPDATE `userstats` SET `{$stat}` = `{$stat}` + $gain WHERE `userid` = $userid"); print " You have gained {$gain} accuracy."; } if($stat=="maxhp") { $gain=$_POST['amnt']*2; $bonus=$_POST['amnt']; $db->query("UPDATE `users` SET exp = exp + $bonus WHERE `userid` = $userid"); $db->query("UPDATE `users` SET `{$stat}` = `{$stat}` + $gain WHERE `userid` = $userid"); print " You have gained {$gain} health."; } elseif($stat=="maxspirit") { $gain=$_POST['amnt']*4; $bonus=$_POST['amnt']; $db->query("UPDATE `users` SET exp = exp + $bonus WHERE `userid` = $userid"); $db->query("UPDATE `users` SET `{$stat}` = `{$stat}` + $gain WHERE `userid` = $userid"); print " You have gained {$gain} spirit."; } elseif($stat=="IQ") { $gain=$_POST['amnt']*.50; $bonus=$_POST['amnt']; $db->query("UPDATE `users` SET exp = exp + $bonus WHERE `userid` = $userid"); $db->query("UPDATE `userstats` SET `{$stat}` = `{$stat}` + $gain WHERE `userid` = $userid"); print " You have gained {$gain} intelligence."; } elseif($stat=="regen") { $gain=$_POST['amnt']*.10; $bonus=$_POST['amnt']; $db->query("UPDATE `users` SET exp = exp + $bonus WHERE `userid` = $userid"); $db->query("UPDATE `users` SET `{$stat}` = `{$stat}` + $gain WHERE `userid` = $userid"); print " You have gained {$gain} regeneration."; } print "<hr />"; $ir['stamina']-=$_POST['amnt']; $ir[$stat]=$gain; } } print "Choose the stat you want to train and how long you want to train it.<br /> You can train up to {$ir['stamina']} minutes.<hr /> <form action='train.php' method='post'> Stats: <select type='dropdown' name='stat'> <option style='color:red;' value='Strength'>Strength (Have {$ir['strength']}) <option style='color:yellow;' value='Speed'>Speed (Have {$ir['speed']}) <option style='color:blue;' value='Defense'>Defense (Have {$ir['defense']}) <option style='color:green;' value='Accuracy'>Accuracy (Have {$ir['accuracy']}) <option style='color:white;' value='Intelligence'>Intelligence (Have {$ir['IQ']}) <option style='color:red;' value='Health'>Health (Have {$ir['maxhp']}) <option style='color:blue;' value='Spirit'>Spirit (Have {$ir['maxspirit']}) <option style='color:purple;' value='Regeneration'>Regeneration (Have {$ir['regen']}) </select><br /> Time to train: <input type='text' name='amnt' value='{$ir['stamina']}' /><br /> <input type='submit' value='Train' /></form>"; $h->endpage(); ?>
  19. Here some of my scripts just so u can get a feel for what i have here is travel.php <?php include "globals.php"; if($ir['jail']>0 || $ir['hospital']>0) die("<center>You can not move around right now."); if($ir['hp']<=1 || $ir['spirit']<=0) die("<center>You are to exhausted to travel."); if($ir['location_x'] < 0 || $ir['location_x'] > 29 || $ir['location_y'] < 0 || $ir['location_y'] > 18) echo("<center>Please try stay within boundaries!"); if($end['attacking'] > 0) { echo("You are currently in a battle, you cannot travel."); } else { $user_num = $ir['level']; if($user_num > '5') { $user_num = '15'; } $ai_level = rand(1,$user_num); $ai = mysql_query("SELECT * FROM `ai` WHERE `level` >= '".$ai_level."' LIMIT 1") or die(mysql_error()); $ai = mysql_fetch_array($ai); $db->query("UPDATE users SET attacking={$ir['attacking']} WHERE userid=$userid"); if(rand(1,10)==7) { echo("<font color='darkred'><cneter>You been attacked!</center></font><Br /><center><a href='engaged.php?ID={$ai['ai_ID']}'>Continue</a></center>"); } $direction = mysql_real_escape_string($_POST['direction']); $direction = strip_tags($direction); switch($direction) { case "north": mysql_query("UPDATE `users` SET `location_y` = `location_y` - 1 WHERE `userid` = '$userid'") or die(mysql_error()); break; case "south": mysql_query("UPDATE `users` SET `location_y` = `location_y` + 1 WHERE `userid` = '$userid'") or die(mysql_error()); break; case "east": mysql_query("UPDATE `users` SET `location_x` = `location_x` + 1 WHERE `userid` = '$userid'") or die(mysql_error()); break; case "west": mysql_query("UPDATE `users` SET `location_x` = `location_x` - 1 WHERE `userid` = '$userid'") or die(mysql_error()); break; } echo(" <table width='100%'> <tr><td> <table width='100%' align='left'> <tr class='th'><td align='center'>Travel Map</td></tr><tr><td> <center><img src='./images/map.gif' alt='maptwo' width='100%'/></center> </td></tr>"); $u_end = mysql_query("SELECT * FROM `users` WHERE `userid` = '$userid'") or die(mysql_error()); $updated_end = mysql_fetch_array($u_end); $pull_l = mysql_query("SELECT * FROM `locations` WHERE `l_x` = '".$updated_end['location_x']."' AND `l_y` = '".$updated_end['location_y']."' LIMIT 1") or die(mysql_error()); if(mysql_num_rows($pull_l) > 0) { $pulled_l = mysql_fetch_array($pull_l); $t_location = ' '. $pulled_l['l_name']; } else { $t_location = 'Desert Land'; } if($ir['location_x'] == 10 && $ir['location_y'] == 2) { mysql_query("UPDATE `users` SET `spirit` = `spirit` - 5 WHERE `userid` = '$userid'") or die(mysql_error()); } if($ir['location_x'] == 10 && $ir['location_y'] == 4) { mysql_query("UPDATE `users` SET `spirit` = `spirit` - 5 WHERE `userid` = '$userid'") or die(mysql_error()); } if($ir['location_x'] == 10 && $ir['location_y'] == 5) { mysql_query("UPDATE `users` SET `spirit` = `spirit` - 5 WHERE `userid` = '$userid'") or die(mysql_error()); } if($ir['location_x'] == 10 && $ir['location_y'] == 6) { mysql_query("UPDATE `users` SET `spirit` = `spirit` - 5 WHERE `userid` = '$userid'") or die(mysql_error()); } if($ir['location_x'] == 10 && $ir['location_y'] == 7) { mysql_query("UPDATE `users` SET `spirit` = `spirit` - 5 WHERE `userid` = '$userid'") or die(mysql_error()); } if($ir['location_x'] == 10 && $ir['location_y'] == 3) { mysql_query("UPDATE `users` SET `spirit` = `spirit` - 5 WHERE `userid` = '$userid'") or die(mysql_error()); } if($ir['location_x'] == 10 && $ir['location_y'] == 8) { mysql_query("UPDATE `users` SET `spirit` = `spirit` - 5 WHERE `userid` = '$userid'") or die(mysql_error()); } if($ir['location_x'] == 10 && $ir['location_y'] == 10) { mysql_query("UPDATE `users` SET `spirit` = `spirit` - 5 WHERE `userid` = '$userid'") or die(mysql_error()); } if($ir['location_x'] == 10 && $ir['location_y'] == 11) { mysql_query("UPDATE `users` SET `spirit` = `spirit` - 5 WHERE `userid` = '$userid'") or die(mysql_error()); } if($ir['location_x'] == 10 && $ir['location_y'] == 12) { mysql_query("UPDATE `users` SET `spirit` = `spirit` - 5 WHERE `userid` = '$userid'") or die(mysql_error()); } if($ir['location_x'] == 10 && $ir['location_y'] == 14) { mysql_query("UPDATE `users` SET `spirit` = `spirit` - 5 WHERE `userid` = '$userid'") or die(mysql_error()); } if($ir['location_x'] == 10 && $ir['location_y'] == 15) { mysql_query("UPDATE `users` SET `spirit` = `spirit` - 5 WHERE `userid` = '$userid'") or die(mysql_error()); } if($ir['location_x'] == 10 && $ir['location_y'] == 13) { mysql_query("UPDATE `users` SET `spirit` = `spirit` - 5 WHERE `userid` = '$userid'") or die(mysql_error()); } if($ir['location_x'] == 10 && $ir['location_y'] == 16) { mysql_query("UPDATE `users` SET `spirit` = `spirit` - 5 WHERE `userid` = '$userid'") or die(mysql_error()); } if($ir['location_x'] == 10 && $ir['location_y'] == 17) { mysql_query("UPDATE `users` SET `spirit` = `spirit` - 5 WHERE `userid` = '$userid'") or die(mysql_error()); } if($ir['location_x'] == 10 && $ir['location_y'] == 18) { mysql_query("UPDATE `users` SET `spirit` = `spirit` - 5 WHERE `userid` = '$userid'") or die(mysql_error()); } if($ir['location_x'] == 12 && $ir['location_y'] == 18) { mysql_query("UPDATE `users` SET `hp` = `hp` - 5 WHERE `userid` = '$userid'") or die(mysql_error()); } if($ir['location_x'] == 12 && $ir['location_y'] == 17) { mysql_query("UPDATE `users` SET `hp` = `hp` - 5 WHERE `userid` = '$userid'") or die(mysql_error()); } if($ir['location_x'] == 12 && $ir['location_y'] == 16) { mysql_query("UPDATE `users` SET `hp` = `hp` - 5 WHERE `userid` = '$userid'") or die(mysql_error()); } if($ir['location_x'] == 12 && $ir['location_y'] == 15) { mysql_query("UPDATE `users` SET `hp` = `hp` - 5 WHERE `userid` = '$userid'") or die(mysql_error()); } if($ir['location_x'] == 13 && $ir['location_y'] == 15) { mysql_query("UPDATE `users` SET `hp` = `hp` - 5 WHERE `userid` = '$userid'") or die(mysql_error()); } if($ir['location_x'] == 14 && $ir['location_y'] == 15) { mysql_query("UPDATE `users` SET `hp` = `hp` - 5 WHERE `userid` = '$userid'") or die(mysql_error()); } if($ir['location_x'] == 18 && $ir['location_y'] == 15) { mysql_query("UPDATE `users` SET `hp` = `hp` - 5 WHERE `userid` = '$userid'") or die(mysql_error()); } if($ir['location_x'] == 19 && $ir['location_y'] == 15) { mysql_query("UPDATE `users` SET `hp` = `hp` - 5 WHERE `userid` = '$userid'") or die(mysql_error()); } if($ir['location_x'] == 20 && $ir['location_y'] == 15) { mysql_query("UPDATE `users` SET `hp` = `hp` - 5 WHERE `userid` = '$userid'") or die(mysql_error()); } if($ir['location_x'] == 20 && $ir['location_y'] == 16) { mysql_query("UPDATE `users` SET `hp` = `hp` - 5 WHERE `userid` = '$userid'") or die(mysql_error()); } if($ir['location_x'] == 20 && $ir['location_y'] == 17) { mysql_query("UPDATE `users` SET `hp` = `hp` - 5 WHERE `userid` = '$userid'") or die(mysql_error()); } if($ir['location_x'] == 20 && $ir['location_y'] == 18) { mysql_query("UPDATE `users` SET `hp` = `hp` - 5 WHERE `userid` = '$userid'") or die(mysql_error()); } if($ir['location_x'] == 11 && $ir['location_y'] == 9) { mysql_query("UPDATE `users` SET `stamina` = 0 WHERE `userid` = '$userid'") or die(mysql_error()); } echo(" <tr width='100%' class='th'><td align='center'>Your Current location is: ".$updated_end['location_x'].".".$updated_end['location_y']." - <b>$t_location</b></td></tr> </table>"); echo(" <form action='' method='post'> <table style='width: 429px; height: 30px;' align='left'> <tbody> <tr class='td'> <td align='center'>Select Direction<br> <table style='width: 419px; height: 35px;' align='left'> <tbody> <tr class='th'> <td>North <input name='direction' value='north' type='radio'> East<input name='direction' value='east' type='radio'> West<input name='direction' value='west' type='radio'> South<input name='direction' value='south' type='radio'> <br> <center><input name='t_submit' value='Travel' type='submit'></center> </form> </td> </tr> </tbody> </table> <table width='100%' align='left'> <tr class='td'><td align='center'>Locations:</td></tr> <tr><td> <table width='100%'> <tr class='th'><td width='50%'>Kagamino City: 7.2</td><td width='50%'>Karakura Town: 4.2</td></tr> <tr class='th'><td width='50%'>Urahara Shop: 2.18</td><td width='50%'>Karakura High School: 6.5</td></tr> <tr class='th'><td width='50%'>Karakura Hospital: 3.4</td><td width='50%'>Dangai World: 11.9</td></tr> <tr class='th'><td width='50%'>Rukongai: 13.7</td><td width='50%'>Academy: 21.7 </td></tr> <tr class='th'><td width='50%'>Seireitei: 21.9</td><td width='50%'>Central 46: 26.9</td></tr> <tr class='th'><td width='50%'>Sokyoku Hill: 29.2</td><td width='50%'>Nest of Maggots: 27.13</td></tr> <tr class='th'><td width='50%'>Las Noches: 16.18</td><td width='50%'>Hell: 29.18</td></tr> </table> </td></tr> </table> </td></tr> </table> "); } ?>   as u can see, there is originality in a lot of the scripts ^^
  20. its based off mccodes but it has alot more to it so like i said its wayyy more than mccodes but only a fraction of the price.
  21. mccodes v2 is $100, what i have is wayyyyyy better than mccodes v2 and im asking for half the price. $5 is wayyy to cheap for what i have. Lowest i would probably go is like $20. because im not a money hungry person, im just trying raise money to upgrade my server.
  22. im a negotiable person and always open to negotiations but i was looking to sell them for $50.
  23. ight i put some of them on a free server here is the link http://www.kaname.elementfx.com/index.php its not ALL of the codes im willing to sell but its alot of them on that site, i also have some useful things to newbies coded in such as how when u reach certain locations on the travel page different sub menus appear and when u leave that location those menus disappear. Its quite a few neat things i have, like i said im no Sniko or Ruler of Zu xD but i do try my best i think i have some useful scripts. EDIT: as usual u can sign in with demo as both username and password
  24. Hey if there are any newbies here new to making text based games if you are looking for some good codes to get you started i decided i will sell my codes to my little site i have running, now im no pro coder but i have some nice scripts and compiled a decent site, its a diamond in the rough, and my scripts are defiantly wayyyy better and would benefit you more than getting mccodes lite. If your interested in buying them PM me on here and we can work a deal out. The purpose of it is for people new to making text based games to get a better start at making text based games. I have a very decent amount of scripts, i will also include the sql for the database. ;)
  25. Sorry to keep bothering you guys :( but anybody know how i can add a way for curse words to be replaced or blocked by my shoutbox.php ? dont know if it will help but here is the code to my shoutbox   <?php session_start(); include "globals.php"; ?> <style> body { background-color: black; scrollbar-base-color: white scrollbar-arrow-color: #000000; scrollbar-DarkShadow-Color: #000000; bgbackground: black; bgcolor: black; } a:visited,a:active,a:hover,a:link { color:white;text-decoration: none; } table,tr,td { font-size: 11.1; } img { border:none; } .button { font-family:helvetica, arial, geneva, sans-serif; font-size:12; color:#000000; background-color: white; } input,textarea,dropdown{ font-family:helvetica, arial, geneva, sans-serif; font-size:12; color:#000000; background-color: white; border: 1px solid; } textarea,.submit input{ font-family:helvetica, arial, geneva, sans-serif;font-size:12;color:#000000; } textarea { font-family:helvetica, arial, geneva, sans-serif;font-size:11;color: #000000; } a:hover { color: blue;text-decoration: blink; text-decoration: underline; background: none; } </style> <center> <a href="<?php echo $_SERVER['PHP_SELF']; ?>">-> <b>Refresh Shout Box</b> <-</a> <?php if($ir['user_level']>1) { echo"<br><a href='?action=banlist'>-> <b>Ban List</b> <-</a>"; } ?> <br><a href='?action=shoutbox'></a> </center> <?php if($ir['banshout']==1) { echo"You cannot access the shout box while being banned."; exit; } if($_GET['action']==del) { if($ir['user_level']>1) { $id=$_GET['id']; $db->query("DELETE FROM shoutbox WHERE id='{$id}'") or die(mysql_error()); echo""; } else { echo""; } } if($_GET['action']==shoutbox) { global $ir,$c,$userid,$h; echo "Your Shoutbox is now "; if($ir['shoutbox']==1) { echo "hidden"; $db->query("UPDATE users SET shoutbox=0 WHERE userid=$userid",$c); } exit; } if($_GET['action']==ban) { if($ir['user_level']>1) { $id=$_GET['id']; $db->query("UPDATE users SET banshout=1 WHERE userid='{$id}'") or die(mysql_error()); echo""; } else { echo""; } } if($_GET['action']==banlist) { echo"<table border=1 width=50%><th>User</th><th>Actions</th><tr>"; $d=$db->query("SELECT * FROM users WHERE banshout=1") or die(mysql_error()); while($t=$db->fetch_row($d)) { echo"<td>{$t['username']}</td><td><a href='?action=unban&id={$t['userid']}'>Unban</td><tr>"; } echo"</table>"; exit; } if($_GET['action']==unban) { if($ir['user_level']>1) { $id=$_GET['id']; $db->query("UPDATE users SET banshout=0 WHERE userid='{$id}'") or die(mysql_error()); echo""; } else { echo""; } } if ($_GET['action']=='1') { $newmsg = strip_tags($_POST['msg'],""); $string = "$newmsg"; $new_string = str_replace($replace, $search, $string); $new_string = str_replace($search, $replace, $string); print "</form>"; if ($_POST['msg']) { $starter = "<font color=white>{$ir['username']}</font>"; if ($ir['userid']==1) { $starter = "<font color=red>{$ir['username']}</font>"; } if ($ir['title']=='Captain') { $starter = "<font color=blue>{$ir['username']}</font>"; } if ($ir['title']=='Lieutenant') { $starter = "<font color=orange>{$ir['username']}</font>"; } if ($ir['race']=='Hollow') { $starter = "<font color=black>{$ir['username']}</font>"; } if ($ir['race']=='Visored') { $starter = "<font color=teal>{$ir['username']}</font>"; } if ($ir['race']=='Arrancar') { $starter = "<font color=purple>{$ir['username']}</font>"; } $id=$ir['userid']; $db->query("INSERT INTO shoutbox VALUES ('', unix_timestamp(),'<a href=user.php?ID=$id target=_blank>$starter</a>','$userid', '$new_string')"); } } $bk = $db->query("select * from shoutbox order by id desc limit 15"); while ($chat = $db->fetch_row($bk)) { $time=date('g:i a',$chat['time']); print "</center>"; if($ir['user_level']>1){echo"<a href='?action=del&id={$chat['id']}'><font color=red>[D]</font></a><a href='?action=ban&id={$chat[userid]}'><font color=lime>[b]</font></a>";}echo"<font color=990099>[$time]</font></b><b>$chat[user]</b></font></font></font></font></a></a></a></a></a><font color=red>:</font> <font color=white>$chat[chat]</font><br>"; } ?> <center> <form method=post action=shoutbox.php?action=1> <font color=white>Enter Message:</font> <input type=text name=msg size=20><br /> </form> </center> </body>
×
×
  • Create New...