<?php 
if (!isset($_SESSION))
{
	session_start();
}
require_once ('header.php');
if ($aangemeld == "ja")
{
	action("bekijkt de oude topics");
?>
<link rel="stylesheet" href="style/forum.css" type="text/css" media="all"> 
<style type="text/css">
.titlemedium
{
	background-image: url(img/forum/tile_sub.gif) 
}
.maintitle
{ 
	background-image: url(img/forum/tile_back.gif) 
}
</style> 
<br />
<table width="525" border="0" cellspacing="0" cellpadding="0" align="center" class='forum'>
<tr>
<td colspan="3">
<table border="0" cellspacing="0" cellpadding="0" width="100%">
<tr>
<td width="77"><img src="img/forum/topleft.gif" alt="" /></td>
<td width="100%"  background="img/forum/topbg.gif"><center><b>Oude topics</b></center></td>
<td width="503" align="right"><img src="img/forum/topright.gif" alt="" /></td>
</tr>
</table>
</td></tr>
<tr>
<td width="10" valign="top" background="img/forum/leftbg.gif"><img src="img/forum/leftbg.gif" alt="" /></td>
<td align="left" valign="top" bgcolor="#c5bdbb" width="100%">
<table cellpadding="0" cellspacing="0" border="0" width="100%" bgcolor="#c5bdbb" align="center">
<tr>
<td class="post1">
<table border="0" cellspacing="0" cellpadding="0" width="100%">
<tr>
<td width="100%" background="img/forum/logobg.gif"><div align="center" class="copyright">
</div></td>
</tr>
</table>
<table border="0" cellspacing="0" cellpadding="0" width="100%">
<tr>
<td width="29"><img src="img/forum/membarleft.gif" width="29" height="38" alt="" /></td>
<td width="100%" background="img/forum/membarbg.gif"><table width='100%' cellpadding='0' cellspacing='0' border='0' align='center'>
<tr>
<td align='left' valign='middle' style='padding: 0px 0px 4px 0px;'>Deze topics kunnen niet meer gewijzigd worden</td>
<td align='right' valign='middle'></td></tr></table></td>
<td width="21" align="right"><img src="img/forum/membarright.gif" width="21" height="38" alt="" /></td>
</tr>
</table>
<div align="right"><br></div>
<div class="tableborder" style="display:show" id="fo_130">
	<table cellspacing="0" cellpadding="2" width="100%">
        <tr> 
          <th align="center" width="2%" nowrap="nowrap" class='titlemedium'><img src="img/forum/spacer.gif" alt="" width="26" height="1" /></th>
          <th align="left" width="43%" nowrap="nowrap" class='titlemedium'>Naam</th>
          <th align="center" width="15%" nowrap="nowrap" class='titlemedium'>Reacties</th>
          <th align="center" width="20%" nowrap="nowrap" class='titlemedium'>Aanmaakdatum</th>
          <th align="left" width="20%" nowrap="nowrap" class='titlemedium'>Laatst actief</th>
        </tr>
<?php
	$res = mysql_query("SELECT id, titel, datum, actief, rechten FROM topics WHERE geblokt = 'old' ORDER BY id DESC");
	if (mysql_num_rows($res) >= 1)
	{
		while ($row = mysql_fetch_array($res))
		{
			$jouwrechten = $member_status;
			$topicrechten = $row['rechten'];
			if ($topicrechten == "all")
			{
				$toon = "ja";
				$topicsoort = "gwn";
			}
			else
			{
				$topicsoort = "special";
				if (($jouwrechten == "manager") or ($jouwrechten == "staff"))
				{
					$toon = "ja";
				}
				else
				{
					$toon = "nee";
				}
			}
			if ($toon == "ja")
			{
				$msg = mysql_num_rows(mysql_query("SELECT tid FROM replys WHERE tid = '" . $row['id'] . "'")); 
    			$row['datum'] = substr($row['datum'], 0, 10);
    			echo '<td align="center"><img src="img/bluelock.gif" border="0"></td>';
	    		echo "<td><a href=\"replys.php?id=" . $row['id'] . "\">";
    			if ($topicsoort=="special")
		    	{
			    	echo "<font color='green'>";
		    	}
    			echo $row['titel'];
    			if ($topicsoort=="special")
		    	{
			    	echo "</font>";
		    	}
		    	echo "</a></td><td align='center'> (" . $msg . ")</td><td align='center'>".$row['datum']."</td><td nowrap='nowrap'><i>".$row['actief']."</i></td></tr>"; 
			}
		}
		echo "\n";
	} 
	else
	{
		echo "Er zijn nog geen topics in het archief.";
	}
?>
</table></div>
<table border="0" cellspacing="0" cellpadding="0" width="100%" bgcolor="#e0d6d6">
<tr>
<td width="22"><img src="img/forum/catleft.gif" width="22" height="24" alt="" /></td>
<td width="100%" background="img/forum/catbg.gif"></td>
<td width="22" align="right"><img src="img/forum/catright.gif" width="22" height="24" alt="" /></td>
</tr>
</table>
</td></tr>
</table></td>
<td width="9" background="img/forum/rightbg.gif"><img src="img/forum/rightbg.gif" alt="" /></td>
</tr>
<tr>
<td valign="middle" align="right" width="100%" colspan="3">
<table cellpadding="0" border="0" cellspacing="0" width="100%">
<tr>
<td width="12"><img src="img/forum/botleft.gif" width="12" height="14" alt="" /></td>
<td width="100%" background="img/forum/botbg.gif"></td>
<td width="10"><img src="img/forum/botright.gif" width="10" height="14" alt="" /></td>
</tr>
</table>
<table cellpadding="0" border="0" cellspacing="0" width="100%">
<tr>
<td width="46"><img src="img/forum/bottomleft.gif" alt="" /></td>
<td width="100%" background="img/forum/bottombg.gif"></td>
<td width="46"><map name="topmap" id="topmap"><area shape="rect" coords="21,13,40,26" alt="Top" href="javascript:scroll(0,0);" /></map>
<img src="img/forum/bottomright.gif" width="46" height="29" alt="" border="0" usemap="#topmap" /></td>
</tr>
</table>
</td></tr>
</table>
<?php
}
else
{
	echo "<h1>Oude topics</h1>";
	echo "Oeps! Hiervoor moet je aangemeld zijn!";
}
require_once ('footer.php');
?>