PageRenderTime 45ms CodeModel.GetById 19ms RepoModel.GetById 0ms app.codeStats 0ms

/footer.php

https://bitbucket.org/gencer/fluxbb
PHP | 163 lines | 111 code | 34 blank | 18 comment | 49 complexity | 7afd4d7dd3a93fd9db81504b116f6345 MD5 | raw file
Possible License(s): GPL-2.0
  1. <?php
  2. /**
  3. * Copyright (C) 2008-2012 FluxBB
  4. * based on code by Rickard Andersson copyright (C) 2002-2008 PunBB
  5. * License: http://www.gnu.org/licenses/gpl.html GPL version 2 or higher
  6. */
  7. // Make sure no one attempts to run this script "directly"
  8. if (!defined('PUN'))
  9. exit;
  10. $tpl_temp = trim(ob_get_contents());
  11. $tpl_main = str_replace('<pun_main>', $tpl_temp, $tpl_main);
  12. ob_end_clean();
  13. // END SUBST - <pun_main>
  14. // START SUBST - <pun_footer>
  15. ob_start();
  16. ?>
  17. <div id="brdfooter" class="block">
  18. <h2><span><?php echo $lang_common['Board footer'] ?></span></h2>
  19. <div class="box">
  20. <?php
  21. if (isset($footer_style) && ($footer_style == 'viewforum' || $footer_style == 'viewtopic') && $is_admmod)
  22. {
  23. echo "\t\t".'<div id="modcontrols" class="inbox">'."\n";
  24. if ($footer_style == 'viewforum')
  25. {
  26. echo "\t\t\t".'<dl>'."\n";
  27. echo "\t\t\t\t".'<dt><strong>'.$lang_forum['Mod controls'].'</strong></dt>'."\n";
  28. 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";
  29. echo "\t\t\t".'</dl>'."\n";
  30. }
  31. else if ($footer_style == 'viewtopic')
  32. {
  33. echo "\t\t\t".'<dl>'."\n";
  34. echo "\t\t\t\t".'<dt><strong>'.$lang_topic['Mod controls'].'</strong></dt>'."\n";
  35. 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>'.($num_pages > 1 ? ' (<a href="moderate.php?fid='.$forum_id.'&amp;tid='.$id.'&amp;action=all">'.$lang_common['All'].'</a>)' : '').'</span></dd>'."\n";
  36. 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";
  37. if ($cur_topic['closed'] == '1')
  38. 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";
  39. else
  40. 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";
  41. if ($cur_topic['sticky'] == '1')
  42. 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";
  43. else
  44. 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";
  45. echo "\t\t\t".'</dl>'."\n";
  46. }
  47. echo "\t\t\t".'<div class="clearer"></div>'."\n\t\t".'</div>'."\n";
  48. }
  49. ?>
  50. <div id="brdfooternav" class="inbox">
  51. <?php
  52. echo "\t\t\t".'<div class="conl">'."\n";
  53. // Display the "Jump to" drop list
  54. if ($pun_config['o_quickjump'] == '1')
  55. {
  56. // Load cached quick jump
  57. if (file_exists(FORUM_CACHE_DIR.'cache_quickjump_'.$pun_user['g_id'].'.php'))
  58. include FORUM_CACHE_DIR.'cache_quickjump_'.$pun_user['g_id'].'.php';
  59. if (!defined('PUN_QJ_LOADED'))
  60. {
  61. if (!defined('FORUM_CACHE_FUNCTIONS_LOADED'))
  62. require PUN_ROOT.'include/cache.php';
  63. generate_quickjump_cache($pun_user['g_id']);
  64. require FORUM_CACHE_DIR.'cache_quickjump_'.$pun_user['g_id'].'.php';
  65. }
  66. }
  67. echo "\t\t\t".'</div>'."\n";
  68. ?>
  69. <div class="conr">
  70. <?php
  71. // If no footer style has been specified, we use the default (only copyright/debug info)
  72. $footer_style = isset($footer_style) ? $footer_style : NULL;
  73. if ($footer_style == 'index')
  74. {
  75. if ($pun_config['o_feed_type'] == '1')
  76. 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";
  77. else if ($pun_config['o_feed_type'] == '2')
  78. 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";
  79. }
  80. else if ($footer_style == 'viewforum')
  81. {
  82. if ($pun_config['o_feed_type'] == '1')
  83. 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";
  84. else if ($pun_config['o_feed_type'] == '2')
  85. 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";
  86. }
  87. else if ($footer_style == 'viewtopic')
  88. {
  89. if ($pun_config['o_feed_type'] == '1')
  90. 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";
  91. else if ($pun_config['o_feed_type'] == '2')
  92. 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";
  93. }
  94. ?>
  95. <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>
  96. </div>
  97. <div class="clearer"></div>
  98. </div>
  99. </div>
  100. </div>
  101. <?php
  102. // Display debug info (if enabled/defined)
  103. if (defined('PUN_DEBUG'))
  104. {
  105. echo '<p id="debugtime">[ ';
  106. // Calculate script generation time
  107. $time_diff = sprintf('%.3f', get_microtime() - $pun_start);
  108. echo sprintf($lang_common['Querytime'], $time_diff, $db->get_num_queries());
  109. if (function_exists('memory_get_usage'))
  110. {
  111. echo ' - '.sprintf($lang_common['Memory usage'], file_size(memory_get_usage()));
  112. if (function_exists('memory_get_peak_usage'))
  113. echo ' '.sprintf($lang_common['Peak usage'], file_size(memory_get_peak_usage()));
  114. }
  115. echo ' ]</p>'."\n";
  116. }
  117. // End the transaction
  118. $db->end_transaction();
  119. // Display executed queries (if enabled)
  120. if (defined('PUN_SHOW_QUERIES'))
  121. display_saved_queries();
  122. $tpl_temp = trim(ob_get_contents());
  123. $tpl_main = str_replace('<pun_footer>', $tpl_temp, $tpl_main);
  124. ob_end_clean();
  125. // END SUBST - <pun_footer>
  126. // Close the db connection (and free up any result data)
  127. $db->close();
  128. // Spit out the page
  129. exit($tpl_main);