PageRenderTime 40ms CodeModel.GetById 14ms RepoModel.GetById 0ms app.codeStats 0ms

/help.php

https://bitbucket.org/gencer/punbb
PHP | 218 lines | 109 code | 15 blank | 94 comment | 7 complexity | 651d00c0b44db80baadc9f0480149119 MD5 | raw file
Possible License(s): GPL-2.0
  1. <?php
  2. /**
  3. * Help page.
  4. *
  5. * Provides examples of how to use various features of the forum (ie: BBCode, smilies).
  6. *
  7. * @copyright (C) 2008-2012 PunBB, partially based on code (C) 2008-2009 FluxBB.org
  8. * @license http://www.gnu.org/licenses/gpl.html GPL version 2 or higher
  9. * @package PunBB
  10. */
  11. if (!defined('FORUM_ROOT'))
  12. define('FORUM_ROOT', './');
  13. require FORUM_ROOT.'include/common.php';
  14. ($hook = get_hook('he_start')) ? eval($hook) : null;
  15. if ($forum_user['g_read_board'] == '0')
  16. message($lang_common['No view']);
  17. // Load the help.php language file
  18. require FORUM_ROOT.'lang/'.$forum_user['language'].'/help.php';
  19. $section = isset($_GET['section']) ? $_GET['section'] : null;
  20. if (!$section)
  21. message($lang_common['Bad request']);
  22. $forum_page['crumbs'] = array(
  23. array($forum_config['o_board_title'], forum_link($forum_url['help'])),
  24. $lang_help['Help']
  25. );
  26. define('FORUM_PAGE', 'help');
  27. require FORUM_ROOT.'header.php';
  28. // START SUBST - <!-- forum_main -->
  29. ob_start();
  30. ($hook = get_hook('he_main_output_start')) ? eval($hook) : null;
  31. ?>
  32. <div id="brd-main" class="main">
  33. <div class="main-head">
  34. <h1 class="hn"><span><?php echo $lang_help['Help'] ?></span></h1>
  35. </div>
  36. <?php
  37. if (!$section || $section == 'bbcode')
  38. {
  39. ?>
  40. <div class="main-subhead">
  41. <h2 class="hn"><span><?php printf($lang_help['Help with'], $lang_common['BBCode']) ?></span></h2>
  42. </div>
  43. <div class="main-content main-frm">
  44. <div class="ct-box info-box">
  45. <p><?php echo $lang_help['BBCode info'] ?></p>
  46. </div>
  47. <div class="ct-box help-box">
  48. <h3 class="hn"><span><?php echo $lang_help['Text style'] ?></span></h3>
  49. <div class="entry-content">
  50. <code>[b]<?php echo $lang_help['Bold text'] ?>[/b]</code> <span><?php echo $lang_help['produces'] ?></span>
  51. <samp><strong><?php echo $lang_help['Bold text'] ?></strong></samp>
  52. </div>
  53. <div class="entry-content">
  54. <code>[u]<?php echo $lang_help['Underlined text'] ?>[/u]</code> <span><?php echo $lang_help['produces'] ?></span>
  55. <samp><span class="bbu"><?php echo $lang_help['Underlined text'] ?></span></samp>
  56. </div>
  57. <div class="entry-content">
  58. <code>[i]<?php echo $lang_help['Italic text'] ?>[/i]</code> <span><?php echo $lang_help['produces'] ?></span>
  59. <samp><i><?php echo $lang_help['Italic text'] ?></i></samp>
  60. </div>
  61. <div class="entry-content">
  62. <code>[color=#FF0000]<?php echo $lang_help['Red text'] ?>[/color]</code> <span><?php echo $lang_help['produces'] ?></span>
  63. <samp><span style="color: #ff0000"><?php echo $lang_help['Red text'] ?></span></samp>
  64. </div>
  65. <div class="entry-content">
  66. <code>[color=blue]<?php echo $lang_help['Blue text'] ?>[/color]</code> <span><?php echo $lang_help['produces'] ?></span>
  67. <samp><span style="color: blue"><?php echo $lang_help['Blue text'] ?></span></samp>
  68. </div>
  69. <div class="entry-content">
  70. <code>[b][u]<?php echo $lang_help['Bold, underlined text'] ?>[/u][/b]</code> <span><?php echo $lang_help['produces'] ?></span>
  71. <samp><span class="bbu"><strong><?php echo $lang_help['Bold, underlined text'] ?></strong></span></samp>
  72. </div>
  73. <div class="entry-content">
  74. <code>[h]<?php echo $lang_help['Heading text'] ?>[/h]</code> <span><?php echo $lang_help['produces'] ?></span>
  75. <div class="entry-content"><h5><samp><?php echo $lang_help['Heading text'] ?></samp></h5></div>
  76. </div>
  77. <?php ($hook = get_hook('he_new_bbcode_text_style')) ? eval($hook) : null; ?>
  78. </div>
  79. <div class="ct-box help-box">
  80. <h3 class="hn"><span><?php echo $lang_help['Links info'] ?></span></h3>
  81. <div class="entry-content">
  82. <code>[url=<?php echo $base_url.'/' ?>]<?php echo forum_htmlencode($forum_config['o_board_title']) ?>[/url]</code> <span><?php echo $lang_help['produces'] ?></span>
  83. <samp><a href="<?php echo $base_url.'/' ?>"><?php echo forum_htmlencode($forum_config['o_board_title']) ?></a></samp>
  84. </div>
  85. <div class="entry-content">
  86. <code>[url]<?php echo $base_url.'/' ?>[/url]</code> <span><?php echo $lang_help['produces'] ?></span>
  87. <samp><a href="<?php echo $base_url ?>"><?php echo $base_url.'/' ?></a></samp>
  88. </div>
  89. <div class="entry-content">
  90. <code>[email]name@example.com[/email]</code> <span><?php echo $lang_help['produces'] ?></span>
  91. <samp><a href="mailto:name@example.com">name@example.com</a></samp>
  92. </div>
  93. <div class="entry-content">
  94. <code>[email=name@example.com]<?php echo $lang_help['My e-mail address'] ?>[/email]</code> <span><?php echo $lang_help['produces'] ?></span>
  95. <samp><a href="mailto:name@example.com"><?php echo $lang_help['My e-mail address'] ?></a></samp>
  96. </div>
  97. <?php ($hook = get_hook('he_new_bbcode_link')) ? eval($hook) : null; ?>
  98. </div>
  99. <div class="ct-box help-box">
  100. <h3 class="hn"><span><?php echo $lang_help['Quotes info'] ?></span></h3>
  101. <div class="entry-content">
  102. <code>[quote=James]<?php echo $lang_help['Quote text'] ?>[/quote]</code> <span><?php echo $lang_help['produces named'] ?></span>
  103. <div class="quotebox"><cite>James <?php echo $lang_common['wrote'] ?>:</cite><blockquote><p><?php echo $lang_help['Quote text'] ?></p></blockquote></div>
  104. <code>[quote]<?php echo $lang_help['Quote text'] ?>[/quote]</code> <span><?php echo $lang_help['produces unnamed'] ?></span>
  105. <div class="quotebox"><blockquote><p><?php echo $lang_help['Quote text'] ?></p></blockquote></div>
  106. </div>
  107. </div>
  108. <div class="ct-box help-box">
  109. <h3 class="hn"><span><?php echo $lang_help['Code info'] ?></span></h3>
  110. <div class="entry-content">
  111. <code>[code]<?php echo $lang_help['Code text'] ?>[/code]</code> <span><?php echo $lang_help['produces code box'] ?></span>
  112. <div class="codebox"><pre><code><?php echo $lang_help['Code text'] ?></code></pre></div>
  113. <code>[code]<?php echo $lang_help['Code text long'] ?>[/code]</code> <span><?php echo $lang_help['produces scroll box'] ?></span>
  114. <div class="codebox"><pre><code><?php echo $lang_help['Code text long'] ?></code></pre></div>
  115. </div>
  116. </div>
  117. <div class="ct-box help-box">
  118. <h3 class="hn"><span><?php echo $lang_help['List info'] ?></span></h3>
  119. <div class="entry-content">
  120. <code>[list][*]<?php echo $lang_help['List text 1'] ?>[/*][*]<?php echo $lang_help['List text 2'] ?>[/*][*]<?php echo $lang_help['List text 3'] ?>[/*][/list]</code> <span><?php echo $lang_help['produces list'] ?></span>
  121. <ul><li><?php echo $lang_help['List text 1'] ?></li><li><?php echo $lang_help['List text 2'] ?></li><li><?php echo $lang_help['List text 3'] ?></li></ul>
  122. <code>[list=1][*]<?php echo $lang_help['List text 1'] ?>[/*][*]<?php echo $lang_help['List text 2'] ?>[/*][*]<?php echo $lang_help['List text 3'] ?>[/*][/list]</code> <span><?php echo $lang_help['produces decimal list'] ?></span>
  123. <ol class="decimal"><li><?php echo $lang_help['List text 1'] ?></li><li><?php echo $lang_help['List text 2'] ?></li><li><?php echo $lang_help['List text 3'] ?></li></ol>
  124. <code>[list=a][*]<?php echo $lang_help['List text 1'] ?>[/*][*]<?php echo $lang_help['List text 2'] ?>[/*][*]<?php echo $lang_help['List text 3'] ?>[/*][/list]</code> <span><?php echo $lang_help['produces alpha list'] ?></span>
  125. <ol class="alpha"><li><?php echo $lang_help['List text 1'] ?></li><li><?php echo $lang_help['List text 2'] ?></li><li><?php echo $lang_help['List text 3'] ?></li></ol>
  126. </div>
  127. </div>
  128. <?php ($hook = get_hook('he_new_bbcode_section')) ? eval($hook) : null; ?>
  129. </div>
  130. <?php
  131. }
  132. else if ($section == 'img')
  133. {
  134. ?>
  135. <div class="main-subhead">
  136. <h2 class="hn"><span><?php printf($lang_help['Help with'], $lang_common['Images']) ?></span></h2>
  137. </div>
  138. <div class="main-content main-frm">
  139. <div class="ct-box help-box">
  140. <p class="hn"><?php echo $lang_help['Image info'] ?></p>
  141. <div class="entry-content">
  142. <code>[img=PunBB bbcode test]<?php echo $base_url ?>/img/test.png[/img]</code>
  143. <samp><img src="<?php echo $base_url ?>/img/test.png" alt="PunBB bbcode test" /></samp>
  144. </div>
  145. </div>
  146. <?php ($hook = get_hook('he_new_img_section')) ? eval($hook) : null; ?>
  147. </div>
  148. <?php
  149. }
  150. else if ($section == 'smilies')
  151. {
  152. ?>
  153. <div id="smilies" class="main-subhead">
  154. <h2 class="hn"><span><?php printf($lang_help['Help with'], $lang_common['Smilies']) ?></span></h2>
  155. </div>
  156. <div class="main-content main-frm">
  157. <div class="ct-box help-box">
  158. <p class="hn"><?php echo $lang_help['Smilies info'] ?></p>
  159. <div class="entry-content">
  160. <?php
  161. // Display the smiley set
  162. if (!defined('FORUM_PARSER_LOADED'))
  163. require FORUM_ROOT.'include/parser.php';
  164. $smiley_groups = array();
  165. ($hook = get_hook('he_pre_smile_display')) ? eval($hook) : null;
  166. foreach ($smilies as $smiley_text => $smiley_img)
  167. $smiley_groups[$smiley_img][] = $smiley_text;
  168. foreach ($smiley_groups as $smiley_img => $smiley_texts)
  169. echo "\t\t\t\t".'<p>'.implode(' '.$lang_common['and'].' ', $smiley_texts).' <span>'.$lang_help['produces'].'</span> <img src="'.$base_url.'/img/smilies/'.$smiley_img.'" width="15" height="15" alt="'.$smiley_texts[0].'" /></p>'."\n";
  170. ?>
  171. </div>
  172. </div>
  173. </div>
  174. <?php
  175. }
  176. ($hook = get_hook('he_new_section')) ? eval($hook) : null;
  177. ?>
  178. </div>
  179. <?php
  180. ($hook = get_hook('he_end')) ? eval($hook) : null;
  181. $tpl_temp = forum_trim(ob_get_contents());
  182. $tpl_main = str_replace('<!-- forum_main -->', $tpl_temp, $tpl_main);
  183. ob_end_clean();
  184. // END SUBST - <!-- forum_main -->
  185. require FORUM_ROOT.'footer.php';