punbb/footer.php
author Dan
Thu, 12 Jul 2007 01:04:01 -0400
changeset 2 a8a21e1c7afa
parent 0 f9ffdbd96607
child 4 eb9ed4c366d0
permissions -rw-r--r--
Let's just say that the API loads. While a decent part of PunBB works, we've still got a LONG way to go, mainly with form validation and security. At this point, Punano is NOT secure as far as privileges and user levels go.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
0
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
     1
<?php
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
     2
/***********************************************************************
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
     3
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
     4
  Copyright (C) 2002-2005  Rickard Andersson (rickard@punbb.org)
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
     5
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
     6
  This file is part of PunBB.
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
     7
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
     8
  PunBB is free software; you can redistribute it and/or modify it
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
     9
  under the terms of the GNU General Public License as published
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
    10
  by the Free Software Foundation; either version 2 of the License,
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
    11
  or (at your option) any later version.
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
    12
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
    13
  PunBB is distributed in the hope that it will be useful, but
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
    14
  WITHOUT ANY WARRANTY; without even the implied warranty of
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
    15
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
    16
  GNU General Public License for more details.
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
    17
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
    18
  You should have received a copy of the GNU General Public License
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
    19
  along with this program; if not, write to the Free Software
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
    20
  Foundation, Inc., 59 Temple Place, Suite 330, Boston,
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
    21
  MA  02111-1307  USA
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
    22
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
    23
************************************************************************/
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
    24
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
    25
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
    26
// Make sure no one attempts to run this script "directly"
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
    27
if (!defined('PUN'))
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
    28
	exit;
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
    29
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
    30
$tpl_temp = trim(ob_get_contents());
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
    31
$tpl_main = str_replace('<pun_main>', $tpl_temp, $tpl_main);
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
    32
ob_end_clean();
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
    33
// END SUBST - <pun_main>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
    34
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
    35
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
    36
// START SUBST - <pun_footer>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
    37
ob_start();
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
    38
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
    39
?>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
    40
<div id="brdfooter" class="block">
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
    41
	<h2><span><?php echo $lang_common['Board footer'] ?></span></h2>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
    42
	<div class="box">
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
    43
		<div class="inbox">
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
    44
<?php
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
    45
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
    46
// If no footer style has been specified, we use the default (only copyright/debug info)
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
    47
$footer_style = isset($footer_style) ? $footer_style : NULL;
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
    48
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
    49
if ($footer_style == 'index' || $footer_style == 'search')
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
    50
{
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
    51
	if (!$pun_user['is_guest'])
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
    52
	{
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
    53
		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";
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
    54
		echo "\t\t\t\t".'<dd><a href="search.php?action=show_unanswered">'.$lang_common['Show unanswered posts'].'</a></dd>'."\n";
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
    55
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
    56
		if ($pun_config['o_subscriptions'] == '1')
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
    57
			echo "\t\t\t\t".'<dd><a href="search.php?action=show_subscriptions">'.$lang_common['Show subscriptions'].'</a></dd>'."\n";
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
    58
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
    59
		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";
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
    60
	}
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
    61
	else
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
    62
	{
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
    63
		if ($pun_user['g_search'] == '1')
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
    64
		{
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
    65
			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";
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
    66
			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";
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
    67
		}
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
    68
	}
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
    69
}
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
    70
else if ($footer_style == 'viewforum' || $footer_style == 'viewtopic')
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
    71
{
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
    72
	echo "\n\t\t\t".'<div class="conl">'."\n";
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
    73
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
    74
	// Display the "Jump to" drop list
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
    75
	if ($pun_config['o_quickjump'] == '1')
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
    76
	{
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
    77
		// Load cached quickjump
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
    78
		@include PUN_ROOT.'cache/cache_quickjump_'.$pun_user['g_id'].'.php';
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
    79
		if (!defined('PUN_QJ_LOADED'))
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
    80
		{
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
    81
			require_once PUN_ROOT.'include/cache.php';
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
    82
			generate_quickjump_cache($pun_user['g_id']);
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
    83
			require PUN_ROOT.'cache/cache_quickjump_'.$pun_user['g_id'].'.php';
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
    84
		}
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
    85
	}
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
    86
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
    87
	if ($footer_style == 'viewforum' && $is_admmod)
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
    88
		echo "\t\t\t".'<p id="modcontrols"><a href="moderate.php?fid='.$forum_id.'&amp;p='.$p.'">'.$lang_common['Moderate forum'].'</a></p>'."\n";
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
    89
	else if ($footer_style == 'viewtopic' && $is_admmod)
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
    90
	{
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
    91
		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";
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
    92
		echo "\t\t\t".'<dd><a href="moderate.php?fid='.$forum_id.'&amp;move_topics='.$id.'">'.$lang_common['Move topic'].'</a></dd>'."\n";
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
    93
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
    94
		if ($cur_topic['closed'] == '1')
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
    95
			echo "\t\t\t".'<dd><a href="moderate.php?fid='.$forum_id.'&amp;open='.$id.'">'.$lang_common['Open topic'].'</a></dd>'."\n";
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
    96
		else
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
    97
			echo "\t\t\t".'<dd><a href="moderate.php?fid='.$forum_id.'&amp;close='.$id.'">'.$lang_common['Close topic'].'</a></dd>'."\n";
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
    98
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
    99
		if ($cur_topic['sticky'] == '1')
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   100
			echo "\t\t\t".'<dd><a href="moderate.php?fid='.$forum_id.'&amp;unstick='.$id.'">'.$lang_common['Unstick topic'].'</a></dd></dl>'."\n";
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   101
		else
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   102
			echo "\t\t\t".'<dd><a href="moderate.php?fid='.$forum_id.'&amp;stick='.$id.'">'.$lang_common['Stick topic'].'</a></dd></dl>'."\n";
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   103
	}
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   104
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   105
	echo "\t\t\t".'</div>'."\n";
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   106
}
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   107
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   108
?>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   109
			<p class="conr">Powered by <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</p>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   110
<?php
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   111
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   112
// Display debug info (if enabled/defined)
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   113
if (defined('PUN_DEBUG'))
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   114
{
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   115
	// Calculate script generation time
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   116
	list($usec, $sec) = explode(' ', microtime());
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   117
	$time_diff = sprintf('%.3f', ((float)$usec + (float)$sec) - $pun_start);
2
a8a21e1c7afa Let's just say that the API loads. While a decent part of PunBB works, we've still got a LONG way to go, mainly with form validation and security. At this point, Punano is NOT secure as far as privileges and user levels go.
Dan
parents: 0
diff changeset
   118
	echo "\t\t\t".'<p class="conr">[ Generated in '.$time_diff.' seconds, '.$pun_db->get_num_queries().' queries executed ]</p>'."\n";
0
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   119
}
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   120
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   121
?>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   122
			<div class="clearer"></div>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   123
		</div>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   124
	</div>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   125
</div>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   126
<?php
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   127
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   128
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   129
// End the transaction
2
a8a21e1c7afa Let's just say that the API loads. While a decent part of PunBB works, we've still got a LONG way to go, mainly with form validation and security. At this point, Punano is NOT secure as far as privileges and user levels go.
Dan
parents: 0
diff changeset
   130
$pun_db->end_transaction();
0
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   131
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   132
// Display executed queries (if enabled)
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   133
if (defined('PUN_SHOW_QUERIES'))
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   134
	display_saved_queries();
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   135
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   136
$tpl_temp = trim(ob_get_contents());
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   137
$tpl_main = str_replace('<pun_footer>', $tpl_temp, $tpl_main);
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   138
ob_end_clean();
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   139
// END SUBST - <pun_footer>
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   140
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   141
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   142
// Close the db connection (and free up any result data)
2
a8a21e1c7afa Let's just say that the API loads. While a decent part of PunBB works, we've still got a LONG way to go, mainly with form validation and security. At this point, Punano is NOT secure as far as privileges and user levels go.
Dan
parents: 0
diff changeset
   143
$pun_db->close();
0
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   144
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   145
// Spit out the page
f9ffdbd96607 Initial population
Dan
parents:
diff changeset
   146
exit($tpl_main);