Jump to content
MakeWebGames

Recommended Posts

Posted

Hey everyone i have an shoutbox that works cool BUT it looks extremely ugly like when you post the text just there, out in the open like its no table or lines or nothing to make it look better. So i know this may sound noobish but would someone feel like but would someone feel like editing the code to make it look better? It works fine like everything is cool how i want it, i just dont like the way it looks. Here is the code and screen shot.

Screen Shot: Screen Shot

<?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);
}
if($ir['shoutbox']==0)
{
echo "showing";
$db->query("UPDATE users SET shoutbox=1 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=purple>{$ir['username']}</font>";
              }
                if ($ir['title']=='Captain') {
		$starter = "<font color=blue>{$ir['username']}</font>";
              }
                if ($ir['title']=='Lieutenant') {
		$starter = "<font color=red>{$ir['username']}</font>";
              }
                 if ($ir['race']=='Hollow') {
		$starter = "<font color=black>{$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>
Posted

There's a decent shoutbox in the Way of The Mafia script which uses AJAX so need to ask the user to refresh the page and you could probably edit it to fit the engine you're using. However, I'm not sure what you require from your shoutbox.

Posted

alright i'll look into finding that script & umm raven i think u misunderstood me, i know how to change the colors using hex colors, i wanted to make it look better like have the text appear in a nice table

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...