thebobby Posted January 22, 2011 Posted January 22, 2011 <?php <div class="usercmtpart"> <div></div> <div class="usercmt_txtpart"> <center> <font size="2"> Shout Box </font> </center> </div> <div></div> </div> '; if($ir['user_level'] == 2) { echo " [Staff Area] "; } if(isset($_POST['shout'])) { if($ir['lastShout'] == date("i") && $ir['user_level'] < 2) { echo "<div style='background: #FF0000;' width='100%'>Unable to shout, try again in 1 minute</div> "; exit; } @$bannedDays = explode("|", $ir['sA_Ban']); if(@$bannedDays[1] > 0) { echo "<div style='background: #FF0000;' width='100%'>You've been banned from shouting (".number_format($bannedDays[1])." Day(s))</div> <h3>Reason: {$bannedDays[0]}</h3>"; exit; } echo "<div style='background: #6EFF70;' width='100%'>You've shouted</div> "; $_POST['shout'] = htmlspecialchars($db->escape($_POST['shout'])); $_POST['shout'] = smilie($_POST['shout']); $_POST['shout'] = bbCode($_POST['shout']); $db->query("UPDATE `users` SET `lastShout`=".date('i')." WHERE userid=$userid"); $db->query("INSERT INTO `shoutarea` VALUES ('NULL', $userid, '{$_POST['shout']}', ".date("d").")"); } echo " <form action='#' method='post'> <input type='text' name='shout' STYLE='color: black; background-color: white;' size='70' length='70' maxlength='80'> <input type='submit' STYLE='color: black; background-color: white;' value='Shout'> </form>"; $get = $db->query("SELECT * FROM `shoutarea` WHERE `Date`=".date("d")." ORDER BY `Key` DESC LIMIT 15"); while($r = $db->fetch_row($get)) { $delLink = ($ir['user_level'] >= 2) ? " []" : ""; $user = $db->fetch_row($db->query("SELECT `username` FROM `users` WHERE `userid`={$r['User']}")); $player = ($r['User'] == 0) ? "SYSTEM" : "{$user['username']}"; print " <div class='cmt_tittxt'> $player says :</div> <div class='cmtbox_part'> " ; if($ir['user_level'] >= 2) { print' <a href = "/shoutarea_staff.php?p=del&s='.$r['Key'].'"> Delete Shout </a> ' ; } print' <div class="cmtbox_top" style="text-indent:400px;"> </div> '; print ' <div class="cmtbox_md"> <div class="cmtcontent">'.stripslashes(htmlentities($r['Shout'], ENT_QUOTES)).' </div> </div> <div></div> </div> '; } function smilie($string) { global $dir; $smilie = array(":o)" => '', ":s" => '', "8)" => '', ":gun:" => '', "0:)" => '', ":)" => '', ":=)" => '', "$-)" => '', ":$:" => '', ":(" => '', ":shh" => '', ":o" => '', ":p" => '', "xD" => '' ); return strtr($string, $smilie); } function bbCode($string) { $bb = array("" => "", "" => "", "" => "<u>", "" => "</u>", "" => "<s>", "" => "<s>", "" => "<sup>", "" => "</sup>", "" => "<sub>", "" => "</sub>", "[time]" => date('G:i (A)') ); return strtr($string, $bb); } ?> Quote
Danny696 Posted January 22, 2011 Posted January 22, 2011 Just go through the code and see the tables names, work out weather it needs to be a string or not, then make the db table Quote
thebobby Posted January 22, 2011 Author Posted January 22, 2011 i am not sure how to tel and dont know how to do int(11) bigint things Quote
Danny696 Posted January 22, 2011 Posted January 22, 2011 Your not acutally making a table, your edited te users table i think Quote
Blade Maker Posted January 23, 2011 Posted January 23, 2011 Yeah I had him make the shoutarea table, and edit the users table. Its all good now. Quote
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.