<?php
/***************************************************************************
                          page_header.php  -  description
                             -------------------
    begin                : Sat June 17 2000
    copyright            : (C) 2001 The phpBB Group
    email                : support@phpbb.com
 
    $Id: page_header.php,v 1.74 2001/06/27 19:09:13 bartvb Exp $ 

 ***************************************************************************/

/***************************************************************************
 *
 *   This program is free software; you can redistribute it and/or modify
 *   it under the terms of the GNU General Public License as published by
 *   the Free Software Foundation; either version 2 of the License, or
 *   (at your option) any later version.
 *
 ***************************************************************************/

$separator = "<img src='".$bbImage['folder']."' alt='/' />&nbsp;&nbsp;";

// cell one and three in the first TD with rowspan (logo)

echo "<table border='0' width='$bbWidth' cellpadding='5' align='center'>";

//Third row with cell five and six (misc. information)
if ( isset($pagetype) ) {
	switch ( $pagetype ) {
		case 'search':
			echo "<tr><td colspan='2' align='left'>$separator<a href='".$bbUrl['root']."index.php'>";
		    	echo printf(_MD_FORUMINDEX,$xoopsConfig['sitename']);
			echo "</a><br />&nbsp;&nbsp;&nbsp;";
			echo $separator;
			echo _MD_SEARCH;
			echo "</td></tr>";
			break;
		case 'searchresults':
			echo "<tr><td colspan='2' align='left'>$separator<a href='".$bbUrl['root']."index.php'>";
			echo printf(_MD_FORUMINDEX,$xoopsConfig['sitename']);
			echo "</a><br />&nbsp;&nbsp;&nbsp;".$separator."<a href='search.php'>". _MD_SEARCH ."</a><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp";
			echo $separator;
			echo _MD_SEARCHRESULTS;
			echo "</td></tr>";
			break;
		case 'newforum':
			// No third row
			break;
		case 'viewforum':
			echo "<tr><td align='left'>$separator<a href='".$bbUrl['root']."index.php'>";
		    echo printf(_MD_FORUMINDEX,$xoopsConfig['sitename']);
			echo "</a><br />&nbsp;&nbsp;&nbsp;".$separator."<b>".$myts->makeTboxData4Show($forumdata['forum_name'])."</b><br />(". _MD_MODERATEDBY .":";
			
			$count = 0;
			$forum_moderators = get_moderators($forum);
			while ( list($null, $mods) = each($forum_moderators) ) {
				while ( list($mod_id, $mod_name) = each($mods) ) {
					if ( $count > 0 ) {
						echo ", ";
					}
					echo "<a href='".XOOPS_URL."/userinfo.php?uid=".trim($mod_id)."'>".trim($mod_name)."</a>";
					$count++;
				}
			}
			echo ")</td><td align='right'>";
			if ( $can_post ) {
				echo "<input type='button' value='"._MD_POSTNEW."' onclick='location.href=\"newtopic.php?forum=".$forum."\"' />";
			} else {
				echo "<a href='".XOOPS_URL."/register.php'>"._MD_REGTOPOST."</a>";
			}
			echo "&nbsp;&nbsp;</td></tr>";
			break;
		case 'viewtopic':
			$total_forum = get_total_posts($forum, 'forum');
		        echo "<tr><td align='left'>$separator<a href='".$bbUrl['root']."index.php'>";
			echo printf(_MD_FORUMINDEX,$xoopsConfig['sitename']);
			echo "</a><br />&nbsp;&nbsp;&nbsp;".$separator."<a href='". $bbUrl['root']."viewforum.php?forum=$forum&amp;$total_forum'>".$myts->makeTboxData4Show($forumdata['forum_name'])."</a>";
			echo "<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;".$separator."<b>";
			echo $forumdata['topic_title'];
			echo "</b></td><td align='right'>";
			if ( $can_post ) {
				echo "<input type='button' value='"._MD_POSTNEW."' onclick='location.href=\"newtopic.php?forum=".$forum."\"' />";
			} else {
				echo "<a href='".XOOPS_URL."/register.php'>"._MD_REGTOPOST."</a>";
			}
			echo "</td></tr>";
			break;
	}
}

echo "</table>";

?>