Index: branches/rsr.v5.1.dev/web/punbb/footer.php
===================================================================
--- branches/rsr.v5.1.dev/web/punbb/footer.php	(revision 1)
+++ branches/rsr.v5.1.dev/web/punbb/footer.php	(revision 3)
@@ -1,38 +1,9 @@
 <?php
-/***********************************************************************
 
-  Copyright (C) 2002-2005  Rickard Andersson (rickard@punbb.org)
-
-  This file is part of PunBB.
-
-  PunBB 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.
-
-  PunBB is distributed in the hope that it will be useful, but
-  WITHOUT ANY WARRANTY; without even the implied warranty of
-  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-  GNU General Public License for more details.
-
-  You should have received a copy of the GNU General Public License
-  along with this program; if not, write to the Free Software
-  Foundation, Inc., 59 Temple Place, Suite 330, Boston,
-  MA  02111-1307  USA
-
-************************************************************************/
-
-/* dÃ©commenter pour activer les stats phpmyvisites */
-
-// include ("../phpmv2.php");
-
-
-
-
-/* dÃ©commenter pour activer les stats google analytics */
-
-// include ("../google_analytics.php");
-
-
+/**
+ * Copyright (C) 2008-2011 FluxBB
+ * based on code by Rickard Andersson copyright (C) 2002-2008 PunBB
+ * License: http://www.gnu.org/licenses/gpl.html GPL version 2 or higher
+ */
 
 // Make sure no one attempts to run this script "directly"
@@ -53,5 +24,67 @@
 	<h2><span><?php echo $lang_common['Board footer'] ?></span></h2>
 	<div class="box">
-		<div class="inbox">
+<?php
+
+if (isset($footer_style) && ($footer_style == 'viewforum' || $footer_style == 'viewtopic') && $is_admmod)
+{
+	echo "\t\t".'<div id="modcontrols" class="inbox">'."\n";
+
+	if ($footer_style == 'viewforum')
+	{
+		echo "\t\t\t".'<dl>'."\n";
+		echo "\t\t\t\t".'<dt><strong>'.$lang_forum['Mod controls'].'</strong></dt>'."\n";
+		echo "\t\t\t\t".'<dd><span><a href="moderate.php?fid='.$forum_id.'&amp;p='.$p.'">'.$lang_common['Moderate forum'].'</a></span></dd>'."\n";
+		echo "\t\t\t".'</dl>'."\n";
+	}
+	else if ($footer_style == 'viewtopic')
+	{
+		echo "\t\t\t".'<dl>'."\n";
+		echo "\t\t\t\t".'<dt><strong>'.$lang_topic['Mod controls'].'</strong></dt>'."\n";
+		echo "\t\t\t\t".'<dd><span><a href="moderate.php?fid='.$forum_id.'&amp;tid='.$id.'&amp;p='.$p.'">'.$lang_common['Moderate topic'].'</a></span></dd>'."\n";
+		echo "\t\t\t\t".'<dd><span><a href="moderate.php?fid='.$forum_id.'&amp;move_topics='.$id.'">'.$lang_common['Move topic'].'</a></span></dd>'."\n";
+
+		if ($cur_topic['closed'] == '1')
+			echo "\t\t\t\t".'<dd><span><a href="moderate.php?fid='.$forum_id.'&amp;open='.$id.'">'.$lang_common['Open topic'].'</a></span></dd>'."\n";
+		else
+			echo "\t\t\t\t".'<dd><span><a href="moderate.php?fid='.$forum_id.'&amp;close='.$id.'">'.$lang_common['Close topic'].'</a></span></dd>'."\n";
+
+		if ($cur_topic['sticky'] == '1')
+			echo "\t\t\t\t".'<dd><span><a href="moderate.php?fid='.$forum_id.'&amp;unstick='.$id.'">'.$lang_common['Unstick topic'].'</a></span></dd>'."\n";
+		else
+			echo "\t\t\t\t".'<dd><span><a href="moderate.php?fid='.$forum_id.'&amp;stick='.$id.'">'.$lang_common['Stick topic'].'</a></span></dd>'."\n";
+
+		echo "\t\t\t".'</dl>'."\n";
+	}
+
+	echo "\t\t\t".'<div class="clearer"></div>'."\n\t\t".'</div>'."\n";
+}
+
+?>
+		<div id="brdfooternav" class="inbox">
+<?php
+
+echo "\t\t\t".'<div class="conl">'."\n";
+
+// Display the "Jump to" drop list
+if ($pun_config['o_quickjump'] == '1')
+{
+	// Load cached quick jump
+	if (file_exists(FORUM_CACHE_DIR.'cache_quickjump_'.$pun_user['g_id'].'.php'))
+		include FORUM_CACHE_DIR.'cache_quickjump_'.$pun_user['g_id'].'.php';
+
+	if (!defined('PUN_QJ_LOADED'))
+	{
+		if (!defined('FORUM_CACHE_FUNCTIONS_LOADED'))
+			require PUN_ROOT.'include/cache.php';
+
+		generate_quickjump_cache($pun_user['g_id']);
+		require FORUM_CACHE_DIR.'cache_quickjump_'.$pun_user['g_id'].'.php';
+	}
+}
+
+echo "\t\t\t".'</div>'."\n";
+
+?>
+			<div class="conr">
 <?php
 
@@ -59,65 +92,33 @@
 $footer_style = isset($footer_style) ? $footer_style : NULL;
 
-if ($footer_style == 'index' || $footer_style == 'search')
+if ($footer_style == 'index')
 {
-	if (!$pun_user['is_guest'])
-	{
-		echo "\n\t\t\t".'<dl id="searchlinks" class="conl">'."\n\t\t\t\t".'<dt><strong>'.$lang_common['Search links'].'</strong></dt>'."\n\t\t\t\t".'<dd><a href="search.php?action=show_24h">'.$lang_common['Show recent posts'].'</a></dd>'."\n";
-		echo "\t\t\t\t".'<dd><a href="search.php?action=show_unanswered">'.$lang_common['Show unanswered posts'].'</a></dd>'."\n";
-
-		if ($pun_config['o_subscriptions'] == '1')
-			echo "\t\t\t\t".'<dd><a href="search.php?action=show_subscriptions">'.$lang_common['Show subscriptions'].'</a></dd>'."\n";
-
-		echo "\t\t\t\t".'<dd><a href="search.php?action=show_user&amp;user_id='.$pun_user['id'].'">'.$lang_common['Show your posts'].'</a></dd>'."\n\t\t\t".'</dl>'."\n";
-	}
-	else
-	{
-		if ($pun_user['g_search'] == '1')
-		{
-			echo "\n\t\t\t".'<dl id="searchlinks" class="conl">'."\n\t\t\t\t".'<dt><strong>'.$lang_common['Search links'].'</strong></dt><dd><a href="search.php?action=show_24h">'.$lang_common['Show recent posts'].'</a></dd>'."\n";
-			echo "\t\t\t\t".'<dd><a href="search.php?action=show_unanswered">'.$lang_common['Show unanswered posts'].'</a></dd>'."\n\t\t\t".'</dl>'."\n";
-		}
-	}
+	if ($pun_config['o_feed_type'] == '1')
+		echo "\t\t\t\t".'<p id="feedlinks"><span class="rss"><a href="extern.php?action=feed&amp;type=rss">'.$lang_common['RSS active topics feed'].'</a></span></p>'."\n";
+	else if ($pun_config['o_feed_type'] == '2')
+		echo "\t\t\t\t".'<p id="feedlinks"><span class="atom"><a href="extern.php?action=feed&amp;type=atom">'.$lang_common['Atom active topics feed'].'</a></span></p>'."\n";
 }
-else if ($footer_style == 'viewforum' || $footer_style == 'viewtopic')
+else if ($footer_style == 'viewforum')
 {
-	echo "\n\t\t\t".'<div class="conl">'."\n";
-
-	// Display the "Jump to" drop list
-	if ($pun_config['o_quickjump'] == '1')
-	{
-		// Load cached quickjump
-		@include PUN_ROOT.'cache/cache_quickjump_'.$pun_user['g_id'].'.php';
-		if (!defined('PUN_QJ_LOADED'))
-		{
-			require_once PUN_ROOT.'include/cache.php';
-			generate_quickjump_cache($pun_user['g_id']);
-			require PUN_ROOT.'cache/cache_quickjump_'.$pun_user['g_id'].'.php';
-		}
-	}
-
-	if ($footer_style == 'viewforum' && $is_admmod)
-		echo "\t\t\t".'<p id="modcontrols"><a href="moderate.php?fid='.$forum_id.'&amp;p='.$p.'">'.$lang_common['Moderate forum'].'</a></p>'."\n";
-	else if ($footer_style == 'viewtopic' && $is_admmod)
-	{
-		echo "\t\t\t".'<dl id="modcontrols"><dt><strong>'.$lang_topic['Mod controls'].'</strong></dt><dd><a href="moderate.php?fid='.$forum_id.'&amp;tid='.$id.'&amp;p='.$p.'">'.$lang_common['Delete posts'].'</a></dd>'."\n";
-		echo "\t\t\t".'<dd><a href="moderate.php?fid='.$forum_id.'&amp;move_topics='.$id.'">'.$lang_common['Move topic'].'</a></dd>'."\n";
-
-		if ($cur_topic['closed'] == '1')
-			echo "\t\t\t".'<dd><a href="moderate.php?fid='.$forum_id.'&amp;open='.$id.'">'.$lang_common['Open topic'].'</a></dd>'."\n";
-		else
-			echo "\t\t\t".'<dd><a href="moderate.php?fid='.$forum_id.'&amp;close='.$id.'">'.$lang_common['Close topic'].'</a></dd>'."\n";
-
-		if ($cur_topic['sticky'] == '1')
-			echo "\t\t\t".'<dd><a href="moderate.php?fid='.$forum_id.'&amp;unstick='.$id.'">'.$lang_common['Unstick topic'].'</a></dd></dl>'."\n";
-		else
-			echo "\t\t\t".'<dd><a href="moderate.php?fid='.$forum_id.'&amp;stick='.$id.'">'.$lang_common['Stick topic'].'</a></dd></dl>'."\n";
-	}
-
-	echo "\t\t\t".'</div>'."\n";
+	if ($pun_config['o_feed_type'] == '1')
+		echo "\t\t\t\t".'<p id="feedlinks"><span class="rss"><a href="extern.php?action=feed&amp;fid='.$forum_id.'&amp;type=rss">'.$lang_common['RSS forum feed'].'</a></span></p>'."\n";
+	else if ($pun_config['o_feed_type'] == '2')
+		echo "\t\t\t\t".'<p id="feedlinks"><span class="atom"><a href="extern.php?action=feed&amp;fid='.$forum_id.'&amp;type=atom">'.$lang_common['Atom forum feed'].'</a></span></p>'."\n";
+}
+else if ($footer_style == 'viewtopic')
+{
+	if ($pun_config['o_feed_type'] == '1')
+		echo "\t\t\t\t".'<p id="feedlinks"><span class="rss"><a href="extern.php?action=feed&amp;tid='.$id.'&amp;type=rss">'.$lang_common['RSS topic feed'].'</a></span></p>'."\n";
+	else if ($pun_config['o_feed_type'] == '2')
+		echo "\t\t\t\t".'<p id="feedlinks"><span class="atom"><a href="extern.php?action=feed&amp;tid='.$id.'&amp;type=atom">'.$lang_common['Atom topic feed'].'</a></span></p>'."\n";
 }
 
 ?>
-		  <p class="conr">PropulsÃ© par <a href="http://www.punbb.org/">PunBB</a><?php if ($pun_config['o_show_version'] == '1') echo ' '.$pun_config['o_cur_version']; ?><br />&copy; Copyright 2002&#8211;2005 Rickard Andersson<br /> Traduction par <a href="http://www.punbb.fr/">punbb.fr</a></p>
+				<p id="poweredby"><?php printf($lang_common['Powered by'], '<a href="http://fluxbb.org/">FluxBB</a>'.(($pun_config['o_show_version'] == '1') ? ' '.$pun_config['o_cur_version'] : '')) ?></p>
+			</div>
+			<div class="clearer"></div>
+		</div>
+	</div>
+</div>
 <?php
 
@@ -125,16 +126,20 @@
 if (defined('PUN_DEBUG'))
 {
+	echo '<p id="debugtime">[ ';
+
 	// Calculate script generation time
-	list($usec, $sec) = explode(' ', microtime());
-	$time_diff = sprintf('%.3f', ((float)$usec + (float)$sec) - $pun_start);
-	echo "\t\t\t".'<p class="conr">[ GÃ©nÃ©rÃ©e en '.$time_diff.' sec., '.$db->get_num_queries().' requÃªtes exÃ©cutÃ©es ]</p>'."\n";
+	$time_diff = sprintf('%.3f', get_microtime() - $pun_start);
+	echo sprintf($lang_common['Querytime'], $time_diff, $db->get_num_queries());
+
+	if (function_exists('memory_get_usage'))
+	{
+		echo ' - '.sprintf($lang_common['Memory usage'], file_size(memory_get_usage()));
+
+		if (function_exists('memory_get_peak_usage'))
+			echo ' '.sprintf($lang_common['Peak usage'], file_size(memory_get_peak_usage()));
+	}
+
+	echo ' ]</p>'."\n";
 }
-
-?>
-			<div class="clearer"></div>
-		</div>
-	</div>
-</div>
-<?php
 
 
@@ -152,21 +157,6 @@
 
 
-// START SUBST - <pun_include "*">
-while (preg_match('#<pun_include "([^/\\\\]*?)">#', $tpl_main, $cur_include))
-{
-	if (!file_exists(PUN_ROOT.'include/user/'.$cur_include[1]))
-	    error('Impossible de procÃ©der Ã  l\'inclusion utilisateur &lt;pun_include "'.htmlspecialchars($cur_include[1]).'"&gt; depuis le template main.tpl. Il n\'y a pas de fichier dans le rÃ©pertoire /include/user/');
-	
-	ob_start();
-	include PUN_ROOT.'include/user/'.$cur_include[1];
-	$tpl_temp = ob_get_contents();
-	$tpl_main = str_replace($cur_include[0], $tpl_temp, $tpl_main);
-    ob_end_clean();
-}
-// END SUBST - <pun_include "*">
-
-
 // Close the db connection (and free up any result data)
-// $db->close();
+//$db->close();
 
 // Spit out the page
