<?php
/*
 ########################################################################
#                                                                        #
#           Version 4       /                        /   /               #
#          -----------__---/__---__------__----__---/---/-               #
#           | /| /  /___) /   ) (_ `   /   ) /___) /   /                 #
#          _|/_|/__(___ _(___/_(__)___/___/_(___ _/___/___               #
#                       Free Content / Management System                 #
#                                   /                                    #
#                                                                        #
#                                                                        #
#   Copyright 2005-2006 by webspell.org                                  #
#                                                                        #
#   visit webSPELL.org, webspell.info to get webSPELL for free           #
#   - Script runs under the GNU GENERAL PUBLIC LICENSE                   #
#   - It's NOT allowed to remove this copyright-tag                      #
#   -- http://www.fsf.org/licensing/licenses/gpl.html                    #
#                                                                        #
#   Code based on WebSPELL Clanpackage (Michael Gruber - webspell.at),   #
#   Far Development by Development Team - webspell.org                   #
#                                                                        #
#   visit webspell.org                                                   #
#                                                                        #
 ########################################################################
*/

include("_mysql.php");
include("_settings.php");
include("_functions.php");
?>
<html>
<head>
<title><? echo PAGETITLE; ?></title>
<style type="text/css">
<!--
body {
	font-family: Verdana, Arial, Helvetica, sans-serif;
	font-size: 12px;
	color: #000000;
}
table {
	font-family: Verdana, Arial, Helvetica, sans-serif;
	font-size: 12px;
	color: #000000;
}
-->
</style>
</head>

<body>
<?php
/*    $message = stripslashes($dr[message]);
    $message = strip_tags($message);
	$message = nl2br($message);
	$message = smileys($message);
	$message = replacement($message);*/
	
	
$topic = $_GET['topic'];
$thread = safe_query("SELECT * FROM ".PREFIX."forum_topics WHERE topicID='$topic' ");
$dt = mysql_fetch_array($thread);
	
$ergebnis = safe_query("SELECT * FROM ".PREFIX."forum_boards WHERE boardID='$dt[boardID]' ");
$db = mysql_fetch_array($ergebnis);
$boardname = $db[name];

echo'<table width="640" cellpadding="4" cellspacing="0" border="1" bordercolor="#CCCCCC">
	   <tr bgcolor="FFFFFF">
	     <td><b>'.$boardname.'</b> &#8226; <b>'.$dt[topic].'</b></td>
	   </tr>
	 </table><br>';

echo'<table width="640" cellpadding="4" cellspacing="0" border="1" bordercolor="#CCCCCC">';	 

$replys = safe_query("SELECT * FROM ".PREFIX."forum_posts WHERE topicID='$topic' ORDER BY date");
while($dr=mysql_fetch_array($replys)) {
    $date=date("d.m.Y", $dr[date]);
    $time=date("H:i", $dr[date]);

$message=cleartext($dr[message]);	$username=getnickname($dr[poster]);

	if(getsignatur($dr[poster])) $signatur='<br><br>'.getsignatur($dr[poster]);
	else $signatur='';
	$posts = getuserforumposts($dr[poster]);
	if(isforumadmin($dr[poster]) || ismoderator($dr[poster], $dt[boardID])) {
    	if(ismoderator($dr[poster], $dt[boardID])) {
	    	$usertype="Moderator";
			$rang='<img src="images/icons/ranks/moderator.gif">';
		}
		if(isforumadmin($dr[poster])) {
	    	$usertype="Administrator";
			$rang='<img src="images/icons/ranks/admin.gif">';
		}	
	}	
	else {
    	$ergebnis=safe_query("SELECT * FROM ".PREFIX."forum_ranks WHERE $posts > postmin AND $posts < postmax");
		$ds=mysql_fetch_array($ergebnis);
		$usertype=$ds[rank];
		$rang='<img src="images/icons/ranks/'.$ds[pic].'">';
	}
	
	echo'<tr bgcolor="FFFFFF">
			   <td valign="top"><i>'.$date.', '.$time.' </i> - <b>'.$username.'</b> <font size="1">- '.$usertype.' - '.$posts.' Posts</font><br><br>
			     '.$message.' <font size="1"><i>'.$signatur.'</i></span>
			   </td>
			 </tr>';
	}
	echo'</table><br><small><i>powered by webSPELL.org</i></small>';
?>
</body>
</html>

