<?php
include("connecting.php");
include("login_cookies.php");
?>
<table cellpadding="2" cellspacing="0" class="blackborder" style="width:480px;">
<?php
$chatten = mysql_query("SELECT * FROM `pytox_chat` WHERE `show` LIKE '1' ORDER BY `id` DESC");

while($chat = mysql_fetch_array($chatten)) {
if ($u == 0) {
$u = 1;
$style = "background-color:#EEE;";
} else if ($u == 1) {
$u = 0;
$style = "";
} else {
$u = 1;
$style = "background-color:#EEE;";
}
?>
 <tr>
  <td style="border-bottom : 1px dashed #000;<?=$style?>width:480px;">
<?php
$userid = mysql_query("SELECT * FROM `pytox_community` WHERE `bruger` LIKE '{$chat[user]}' LIMIT 1");

while ($id = mysql_fetch_array($userid)) {
?>
<a href="?site=Com.user&amp;userid=<?=$id[id];?>"><strong><?php print $chat[user];?></strong></a> - <i><?php print $chat[time];?></i>
<br />
<?php
//
//
//
$chatpr[message] = str_replace(":S", "<img src=\"../gfx/smileys/S.GIF\" alt=\"S\" />", $chat[message]);
$chatpr[message] = str_replace(":D", "<img src=\"../gfx/smileys/D.gif\" alt=\"D\" />", $chatpr[message]);
$chatpr[message] = str_replace(":(", "<img src=\"../gfx/smileys/(.gif\" alt=\"(\" />", $chatpr[message]);
$chatpr[message] = str_replace(":)", "<img src=\"../gfx/smileys/).gif\" alt=\")\" />", $chatpr[message]);
$chatpr[message] = str_replace(":'(", "<img src=\"../gfx/smileys/'(.gif\" alt=\"'(\" />", $chatpr[message]);
$chatpr[message] = str_replace(":P", "<img src=\"../gfx/smileys/P.GIF\" alt=\"P\" />", $chatpr[message]);

$chatpr[message] = str_replace(":s", "<img src=\"../gfx/smileys/S.GIF\" alt=\"S\" />", $chatpr[message]);
$chatpr[message] = str_replace(":d", "<img src=\"../gfx/smileys/D.gif\" alt=\"D\" />", $chatpr[message]);
$chatpr[message] = str_replace(":(", "<img src=\"../gfx/smileys/(.gif\" alt=\"(\" />", $chatpr[message]);
$chatpr[message] = str_replace(":)", "<img src=\"../gfx/smileys/).gif\" alt=\")\" />", $chatpr[message]);
$chatpr[message] = str_replace(":'(", "<img src=\"../gfx/smileys/'(.gif\" alt=\"'(\" />", $chatpr[message]);
$chatpr[message] = str_replace(":p", "<img src=\"../gfx/smileys/P.GIF\" alt=\"P\" />", $chatpr[message]);
//
//
//
?>
<?php print $chatpr[message];?>
<?php
}
?>
  </td>
 </tr>
<?php
}
?>
</table>