|
1 <?php |
|
2 /*********************************************************************** |
|
3 |
|
4 Copyright (C) 2002-2008 PunBB.org |
|
5 |
|
6 This file is part of PunBB. |
|
7 |
|
8 PunBB is free software; you can redistribute it and/or modify it |
|
9 under the terms of the GNU General Public License as published |
|
10 by the Free Software Foundation; either version 2 of the License, |
|
11 or (at your option) any later version. |
|
12 |
|
13 PunBB is distributed in the hope that it will be useful, but |
|
14 WITHOUT ANY WARRANTY; without even the implied warranty of |
|
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
16 GNU General Public License for more details. |
|
17 |
|
18 You should have received a copy of the GNU General Public License |
|
19 along with this program; if not, write to the Free Software |
|
20 Foundation, Inc., 59 Temple Place, Suite 330, Boston, |
|
21 MA 02111-1307 USA |
|
22 |
|
23 ************************************************************************/ |
|
24 |
|
25 |
|
26 // if (!defined('PUN_ROOT')) |
|
27 // define('PUN_ROOT', './'); |
|
28 // require PUN_ROOT.'include/common.php'; |
|
29 |
|
30 // import globals (I really hope this isn't dangerous) |
|
31 foreach ( $GLOBALS as $key => $_ ) |
|
32 { |
|
33 $$key =& $GLOBALS[$key]; |
|
34 } |
|
35 |
|
36 ($hook = get_hook('he_start')) ? eval($hook) : null; |
|
37 |
|
38 $section = isset($_GET['section']) ? $_GET['section'] : null; |
|
39 |
|
40 if ($pun_user['g_read_board'] == '0') |
|
41 message($lang_common['No view']); |
|
42 |
|
43 // Load the help.php language file |
|
44 require PUN_ROOT.'lang/'.$pun_user['language'].'/help.php'; |
|
45 |
|
46 |
|
47 $page_title = htmlspecialchars($pun_config['o_board_title']).' - '.$lang_help['Help']; |
|
48 define('PUN_PAGE', 'help'); |
|
49 require PUN_ROOT.'header.php'; |
|
50 |
|
51 ?> |
|
52 <div id="pun-main" class="main"> |
|
53 |
|
54 <h1><span><?php echo $lang_help['Help'] ?></span></h1> |
|
55 |
|
56 <?php |
|
57 |
|
58 if (!$section || $section == 'bbcode') |
|
59 { |
|
60 |
|
61 ?> |
|
62 <div class="main-head"> |
|
63 <h2><span><?php printf($lang_help['Help with'], $lang_common['BBCode']) ?></span></h2> |
|
64 </div> |
|
65 <div class="main-content frm"> |
|
66 <div class="frm-info"> |
|
67 <p><?php echo $lang_help['BBCode info 1'] ?></p> |
|
68 <p><?php echo $lang_help['BBCode info 2'] ?></p> |
|
69 </div> |
|
70 <div class="frm-form"> |
|
71 <div class="frm-set set1"> |
|
72 <h3><?php echo $lang_help['Text style'] ?></h3> |
|
73 <ul class="example"> |
|
74 <li> |
|
75 <code>[b]<?php echo $lang_help['Bold text'] ?>[/b]</code> <span><?php echo $lang_help['produces'] ?></span> |
|
76 <samp><strong><?php echo $lang_help['Bold text'] ?></strong></samp> |
|
77 </li> |
|
78 <li> |
|
79 <code>[u]<?php echo $lang_help['Underlined text'] ?>[/u]</code> <span><?php echo $lang_help['produces'] ?></span> |
|
80 <samp><em class="bbuline"><?php echo $lang_help['Underlined text'] ?></em></samp> |
|
81 </li> |
|
82 <li> |
|
83 <code>[i]<?php echo $lang_help['Italic text'] ?>[/i]</code> <span><?php echo $lang_help['produces'] ?></span> |
|
84 <samp><i><?php echo $lang_help['Italic text'] ?></i></samp> |
|
85 </li> |
|
86 <li> |
|
87 <code>[color=#FF0000]<?php echo $lang_help['Red text'] ?>[/color]</code> <span><?php echo $lang_help['produces'] ?></span> |
|
88 <samp><span style="color: #ff0000"><?php echo $lang_help['Red text'] ?></span></samp> |
|
89 </li> |
|
90 <li> |
|
91 <code>[color=blue]<?php echo $lang_help['Blue text'] ?>[/color]</code> <span><?php echo $lang_help['produces'] ?></span> |
|
92 <samp><span style="color: blue"><?php echo $lang_help['Blue text'] ?></span></samp> |
|
93 </li> |
|
94 <li> |
|
95 <code>[b][u]<?php echo $lang_help['Bold, underlined text'] ?>[/u][/b]</code> <span><?php echo $lang_help['produces'] ?></span> |
|
96 <samp><em class="bbuline"><b><?php echo $lang_help['Bold, underlined text'] ?></b></em></samp> |
|
97 </li> |
|
98 </ul> |
|
99 </div> |
|
100 <div class="frm-set"> |
|
101 <h3><?php echo $lang_help['Links info'] ?></h3> |
|
102 <ul class="example"> |
|
103 <li> |
|
104 <code>[url=<?php echo $base_url.'/' ?>]<?php echo htmlspecialchars($pun_config['o_board_title']) ?>[/url]</code> <span><?php echo $lang_help['produces'] ?></span> |
|
105 <samp><a href="<?php echo $base_url.'/' ?>"><?php echo htmlspecialchars($pun_config['o_board_title']) ?></a></samp> |
|
106 </li> |
|
107 <li> |
|
108 <code>[url]<?php echo $base_url.'/' ?>[/url]</code> <span><?php echo $lang_help['produces'] ?></span> |
|
109 <samp><a href="<?php echo $base_url ?>"><?php echo $base_url.'/' ?></a></samp> |
|
110 </li> |
|
111 <li> |
|
112 <code>[email]myname@mydomain.com[/email]</code> <span><?php echo $lang_help['produces'] ?></span> |
|
113 <samp><a href="mailto:myname@mydomain.com">myname@mydomain.com</a></samp> |
|
114 </li> |
|
115 <li> |
|
116 <code>[email=myname@mydomain.com]<?php echo $lang_help['My e-mail address'] ?>[/email]</code><span><?php echo $lang_help['produces'] ?></span> |
|
117 <samp><a href="mailto:myname@mydomain.com"><?php echo $lang_help['My e-mail address'] ?></a></samp> |
|
118 </li> |
|
119 </ul> |
|
120 </div> |
|
121 <div class="frm-set"> |
|
122 <h3><span><?php echo $lang_help['Quotes info'] ?></span></h3> |
|
123 <ul class="example"> |
|
124 <li><code>[quote=James]<?php echo $lang_help['Quote text'] ?>[/quote]</code> <span><?php echo $lang_help['produces named'] ?></span> |
|
125 <div class="entry-content samp"> |
|
126 <div class="quotebox"><cite>James <?php echo $lang_common['wrote'] ?>:</cite><blockquote><p><?php echo $lang_help['Quote text'] ?></p></blockquote></div> |
|
127 </div> |
|
128 </li> |
|
129 <li><code>[quote]<?php echo $lang_help['Quote text'] ?>[/quote]</code> <span><?php echo $lang_help['produces unnamed'] ?></span> |
|
130 <div class="entry-content samp"> |
|
131 <div class="quotebox"><blockquote><p><?php echo $lang_help['Quote text'] ?></p></blockquote></div> |
|
132 </div> |
|
133 </li> |
|
134 </ul> |
|
135 </div> |
|
136 <div class="frm-set"> |
|
137 <h3><span><?php echo $lang_help['Code info'] ?></span></h3> |
|
138 <ul class="example"> |
|
139 <li><code>[code]<?php echo $lang_help['Code text'] ?>[/code]</code> <span><?php echo $lang_help['produces code box'] ?></span> |
|
140 <div class="entry-content samp"> |
|
141 <div class="codebox"><strong class="legend"><?php echo $lang_common['Code'] ?>:</strong><pre><code><?php echo $lang_help['Code text'] ?></code></pre></div> |
|
142 </div> |
|
143 </li> |
|
144 <li><code>[code]<?php echo $lang_help['Code text long'] ?>[/code]</code> <span><?php echo $lang_help['produces scroll box'] ?></span> |
|
145 <div class="entry-content samp"> |
|
146 <div class="codebox"><strong class="legend"><?php echo $lang_common['Code'] ?>:</strong><pre><code><?php echo $lang_help['Code text long'] ?></code></pre></div> |
|
147 </div> |
|
148 </li> |
|
149 </ul> |
|
150 </div> |
|
151 </div> |
|
152 </div> |
|
153 <?php |
|
154 |
|
155 } |
|
156 else if ($section == 'img') |
|
157 { |
|
158 |
|
159 ?> |
|
160 <div class="main-head"> |
|
161 <h2><span><?php printf($lang_help['Help with'], $lang_common['Images']) ?></span></h2> |
|
162 </div> |
|
163 <div class="main-content frm"> |
|
164 <div class="frm-info"> |
|
165 <p><?php echo $lang_help['Image info 1'] ?></p> |
|
166 <p><?php echo $lang_help['Image info 2'] ?></p> |
|
167 </div> |
|
168 <div class="frm-form"> |
|
169 <ul class="example"> |
|
170 <li> |
|
171 <code>[img=PunBB logo]<?php echo $base_url ?>/img/logo.png[/img]</code> |
|
172 <samp><img src="<?php echo $base_url ?>/img/logo.png" alt="PunBB logo" /></samp> |
|
173 </li> |
|
174 </ul> |
|
175 </div> |
|
176 </div> |
|
177 <?php |
|
178 |
|
179 } |
|
180 else if ($section == 'smilies') |
|
181 { |
|
182 |
|
183 ?> |
|
184 <div id="smilies" class="main-head"> |
|
185 <h2><span><?php printf($lang_help['Help with'], $lang_common['Smilies']) ?></span></h2> |
|
186 </div> |
|
187 |
|
188 <div class="main-content frm"> |
|
189 <div class="frm-info"> |
|
190 <p><?php echo $lang_help['Smilies info'] ?></p> |
|
191 </div> |
|
192 <div class="frm-form"> |
|
193 <ul class="example"> |
|
194 <?php |
|
195 |
|
196 // Display the smiley set |
|
197 require PUN_ROOT.'include/parser.php'; |
|
198 |
|
199 $num_smilies = count($smiley_text); |
|
200 for ($i = 0; $i < $num_smilies; ++$i) |
|
201 { |
|
202 // Is there a smiley at the current index? |
|
203 if (!isset($smiley_text[$i])) |
|
204 continue; |
|
205 |
|
206 echo "\t\t\t\t".'<li><code>'.$smiley_text[$i]; |
|
207 |
|
208 // Save the current text and image |
|
209 $cur_img = $smiley_img[$i]; |
|
210 $cur_text = $smiley_text[$i]; |
|
211 |
|
212 // Loop through the rest of the array and see if there are any duplicate images |
|
213 // (more than one text representation for one image) |
|
214 for ($next = $i + 1; $next < $num_smilies; ++$next) |
|
215 { |
|
216 // Did we find a dupe? |
|
217 if (isset($smiley_img[$next]) && $smiley_img[$i] == $smiley_img[$next]) |
|
218 { |
|
219 echo ' '.$lang_common['and'].' '.$smiley_text[$next]; |
|
220 |
|
221 // Remove the dupe so we won't display it twice |
|
222 unset($smiley_text[$next]); |
|
223 unset($smiley_img[$next]); |
|
224 } |
|
225 } |
|
226 |
|
227 echo ' <span>'.$lang_help['produces'].'</span> <img src="'.$base_url.'/img/smilies/'.$cur_img.'" width="15" height="15" alt="'.$cur_text.'" /></code></li>'."\n"; |
|
228 } |
|
229 |
|
230 ?> |
|
231 </ul> |
|
232 </div> |
|
233 </div> |
|
234 <?php |
|
235 |
|
236 } |
|
237 |
|
238 ($hook = get_hook('he_new_section')) ? eval($hook) : null; |
|
239 |
|
240 ?> |
|
241 |
|
242 </div> |
|
243 <?php |
|
244 |
|
245 ($hook = get_hook('he_end')) ? eval($hook) : null; |
|
246 |
|
247 require PUN_ROOT.'footer.php'; |