Jump to content
MakeWebGames

I need database for shout out


thebobby

Recommended Posts

<?php

<div class="usercmtpart">

<div>usercomment_left.jpg</div>

<div class="usercmt_txtpart">

<center> <font size="2"> Shout Box </font> </center>

</div>

<div>usercomment_right.jpg</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) ? " [delete.png]" : "";

$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>cmtbox_btm.jpg</div>

</div>

 

';

}

 

 

function smilie($string)

{

global $dir;

$smilie = array(":o)" => 'clown.gif',

":s" => 'confused.gif',

"8)" => 'cool.gif',

":gun:" => 'gun.gif',

"0:)" => 'halo.gif',

":)" => 'happy.gif',

":=)" => 'drawdrop.png',

"$-)" => 'moneyEyes.gif',

":$:" => 'moneyBag.gif',

":(" => 'sad.gif',

":shh" => 'shh.gif',

":o" => 'suprised.gif',

":p" => 'tongue.gif',

"xD" => 'xD.png'

);

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);

}

?>

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...