<?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                                                   #
#                                                                        #
 ########################################################################
*/

$ergebnis=safe_query("SELECT * FROM ".PREFIX."forum_topics WHERE intern<='".isinternboarduser($userID)."' ORDER BY lastdate DESC LIMIT 0,$maxlatesttopics");
$anz=mysql_num_rows($ergebnis);
if($anz) {
    eval ("\$latesttopics_head = \"".gettemplate("latesttopics_head")."\";");
    echo $latesttopics_head;
	$n=1;
	while($ds=mysql_fetch_array($ergebnis)) {
	    if($n%2) {
			$bg1=BG_1;
			$bg2=BG_2;
		}
		else {
			$bg1=BG_3;
			$bg2=BG_4;
		}
		$latesticon='<img src="images/icons/'.$ds[icon].'" width="15" height="15">';
		$boardlink='&#8226; <a href="index.php?site=forum&board='.$ds[boardID].'"><b>'.getboardname($ds[boardID]).'</b></a>';
		$topiclink='&nbsp;&nbsp;&nbsp;<a href="index.php?site=forum_topic&topic='.$ds[topicID].'&type=ASC&page='.ceil(($ds['replys']+1)/$maxposts).'">'.clearfromtags($ds[topic]).'</a>';
		$replys=$ds[replys];
		
		eval ("\$latesttopics_content = \"".gettemplate("latesttopics_content")."\";");
        echo $latesttopics_content;
		$n++;
	}
	eval ("\$latesttopics_foot = \"".gettemplate("latesttopics_foot")."\";");
    echo $latesttopics_foot;
}
?>
