Chris@76
|
1 <?php
|
Chris@76
|
2 // Version: 1.1; index
|
Chris@76
|
3
|
Chris@76
|
4 /* This template is, perhaps, the most important template in the theme. It
|
Chris@76
|
5 contains the main template layer that displays the header and footer of
|
Chris@76
|
6 the forum, namely with main_above and main_below. It also contains the
|
Chris@76
|
7 menu sub template, which appropriately displays the menu; the init sub
|
Chris@76
|
8 template, which is there to set the theme up; (init can be missing.) and
|
Chris@76
|
9 the linktree sub template, which sorts out the link tree.
|
Chris@76
|
10
|
Chris@76
|
11 The init sub template should load any data and set any hardcoded options.
|
Chris@76
|
12
|
Chris@76
|
13 The main_above sub template is what is shown above the main content, and
|
Chris@76
|
14 should contain anything that should be shown up there.
|
Chris@76
|
15
|
Chris@76
|
16 The main_below sub template, conversely, is shown after the main content.
|
Chris@76
|
17 It should probably contain the copyright statement and some other things.
|
Chris@76
|
18
|
Chris@76
|
19 The linktree sub template should display the link tree, using the data
|
Chris@76
|
20 in the $context['linktree'] variable.
|
Chris@76
|
21
|
Chris@76
|
22 The menu sub template should display all the relevant buttons the user
|
Chris@76
|
23 wants and or needs.
|
Chris@76
|
24
|
Chris@76
|
25 For more information on the templating system, please see the site at:
|
Chris@76
|
26 http://www.simplemachines.org/
|
Chris@76
|
27 */
|
Chris@76
|
28
|
Chris@76
|
29 // Initialize the template... mainly little settings.
|
Chris@76
|
30 function template_init()
|
Chris@76
|
31 {
|
Chris@76
|
32 global $context, $settings, $options, $txt;
|
Chris@76
|
33
|
Chris@76
|
34 /* Use images from default theme when using templates from the default theme?
|
Chris@76
|
35 if this is 'always', images from the default theme will be used.
|
Chris@76
|
36 if this is 'defaults', images from the default theme will only be used with default templates.
|
Chris@76
|
37 if this is 'never' or isn't set at all, images from the default theme will not be used. */
|
Chris@76
|
38 $settings['use_default_images'] = 'never';
|
Chris@76
|
39
|
Chris@76
|
40 /* What document type definition is being used? (for font size and other issues.)
|
Chris@76
|
41 'xhtml' for an XHTML 1.0 document type definition.
|
Chris@76
|
42 'html' for an HTML 4.01 document type definition. */
|
Chris@76
|
43 $settings['doctype'] = 'xhtml';
|
Chris@76
|
44
|
Chris@76
|
45 /* The version this template/theme is for.
|
Chris@76
|
46 This should probably be the version of SMF it was created for. */
|
Chris@76
|
47 $settings['theme_version'] = '1.1';
|
Chris@76
|
48
|
Chris@76
|
49 /* Set a setting that tells the theme that it can render the tabs. */
|
Chris@76
|
50 $settings['use_tabs'] = false;
|
Chris@76
|
51
|
Chris@76
|
52 /* Use plain buttons - as oppossed to text buttons? */
|
Chris@76
|
53 $settings['use_buttons'] = false;
|
Chris@76
|
54
|
Chris@76
|
55 /* Show sticky and lock status seperate from topic icons? */
|
Chris@76
|
56 $settings['seperate_sticky_lock'] = false;
|
Chris@76
|
57 }
|
Chris@76
|
58
|
Chris@76
|
59 // The main sub template above the content.
|
Chris@76
|
60 function template_main_above()
|
Chris@76
|
61 {
|
Chris@76
|
62 global $context, $settings, $options, $scripturl, $txt, $modSettings;
|
Chris@76
|
63
|
Chris@76
|
64 // Show right to left and the character set for ease of translating.
|
Chris@76
|
65 echo '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
Chris@76
|
66 <html xmlns="http://www.w3.org/1999/xhtml"', $context['right_to_left'] ? ' dir="rtl"' : '', '><head>
|
Chris@76
|
67 <meta http-equiv="Content-Type" content="text/html; charset=', $context['character_set'], '" />
|
Chris@76
|
68 <meta name="description" content="', $context['page_title'], '" />', empty($context['robot_no_index']) ? '' : '
|
Chris@76
|
69 <meta name="robots" content="noindex" />', '
|
Chris@76
|
70 <meta name="keywords" content="PHP, MySQL, bulletin, board, free, open, source, smf, simple, machines, forum" />
|
Chris@76
|
71 <script language="JavaScript" type="text/javascript" src="', $settings['default_theme_url'], '/script.js?fin11"></script>
|
Chris@76
|
72 <script language="JavaScript" type="text/javascript"><!-- // --><![CDATA[
|
Chris@76
|
73 var smf_theme_url = "', $settings['theme_url'], '";
|
Chris@76
|
74 var smf_images_url = "', $settings['images_url'], '";
|
Chris@76
|
75 var smf_scripturl = "', $scripturl, '";
|
Chris@76
|
76 var smf_iso_case_folding = ', $context['server']['iso_case_folding'] ? 'true' : 'false', ';
|
Chris@76
|
77 var smf_charset = "', $context['character_set'], '";
|
Chris@76
|
78 // ]]></script>
|
Chris@76
|
79 <title>', $context['page_title'], '</title>
|
Chris@76
|
80 <link rel="stylesheet" type="text/css" href="', $settings['theme_url'], '/style.css?fin11" />
|
Chris@76
|
81 <link rel="stylesheet" type="text/css" href="', $settings['default_theme_url'], '/print.css?fin11" media="print" />';
|
Chris@76
|
82
|
Chris@76
|
83 /* Internet Explorer 4/5 and Opera 6 just don't do font sizes properly. (they are big...)
|
Chris@76
|
84 Thus, in Internet Explorer 4, 5, and Opera 6 this will show fonts one size smaller than usual.
|
Chris@76
|
85 Note that this is affected by whether IE 6 is in standards compliance mode.. if not, it will also be big.
|
Chris@76
|
86 Standards compliance mode happens when you use xhtml... */
|
Chris@76
|
87 if ($context['browser']['needs_size_fix'])
|
Chris@76
|
88 echo '
|
Chris@76
|
89 <link rel="stylesheet" type="text/css" href="', $settings['default_theme_url'], '/fonts-compat.css" />';
|
Chris@76
|
90
|
Chris@76
|
91 // Show all the relative links, such as help, search, contents, and the like.
|
Chris@76
|
92 echo '
|
Chris@76
|
93 <link rel="help" href="', $scripturl, '?action=help" target="_blank" />
|
Chris@76
|
94 <link rel="search" href="' . $scripturl . '?action=search" />
|
Chris@76
|
95 <link rel="contents" href="', $scripturl, '" />';
|
Chris@76
|
96
|
Chris@76
|
97 // If RSS feeds are enabled, advertise the presence of one.
|
Chris@76
|
98 if (!empty($modSettings['xmlnews_enable']))
|
Chris@76
|
99 echo '
|
Chris@76
|
100 <link rel="alternate" type="application/rss+xml" title="', $context['forum_name'], ' - RSS" href="', $scripturl, '?type=rss;action=.xml" />';
|
Chris@76
|
101
|
Chris@76
|
102 // If we're viewing a topic, these should be the previous and next topics, respectively.
|
Chris@76
|
103 if (!empty($context['current_topic']))
|
Chris@76
|
104 echo '
|
Chris@76
|
105 <link rel="prev" href="', $scripturl, '?topic=', $context['current_topic'], '.0;prev_next=prev" />
|
Chris@76
|
106 <link rel="next" href="', $scripturl, '?topic=', $context['current_topic'], '.0;prev_next=next" />';
|
Chris@76
|
107
|
Chris@76
|
108 // If we're in a board, or a topic for that matter, the index will be the board's index.
|
Chris@76
|
109 if (!empty($context['current_board']))
|
Chris@76
|
110 echo '
|
Chris@76
|
111 <link rel="index" href="' . $scripturl . '?board=' . $context['current_board'] . '.0" />';
|
Chris@76
|
112
|
Chris@76
|
113 // Output any remaining HTML headers. (from mods, maybe?)
|
Chris@76
|
114 echo $context['html_headers'], '
|
Chris@76
|
115 </head>
|
Chris@76
|
116 <body>';
|
Chris@76
|
117
|
Chris@76
|
118 // The logo, user information, news, and menu.
|
Chris@76
|
119 echo '
|
Chris@76
|
120 <table cellspacing="0" cellpadding="0" border="0" align="center" width="95%" class="tborder">
|
Chris@76
|
121 <tr style="background-color: #ffffff;">
|
Chris@76
|
122 <td valign="middle" align="left"><img src="', !empty($settings['header_logo_url']) ? $settings['header_logo_url'] : $settings['images_url'] . '/smflogo.gif', '" alt="" /></td>
|
Chris@76
|
123 <td valign="middle">';
|
Chris@76
|
124
|
Chris@76
|
125 // If the user is logged in, display stuff like their name, new messages, etc.
|
Chris@76
|
126 if ($context['user']['is_logged'])
|
Chris@76
|
127 {
|
Chris@76
|
128 echo '
|
Chris@76
|
129 ', $txt['hello_member'], ' <b>', $context['user']['name'], '</b>', $context['allow_pm'] ? ', ' . $txt[152] . ' <a href="' . $scripturl . '?action=pm">' . $context['user']['messages'] . ' ' . ($context['user']['messages'] != 1 ? $txt[153] : $txt[471]) . '</a>' . $txt['newmessages4'] . ' ' . $context['user']['unread_messages'] . ' ' . ($context['user']['unread_messages'] == 1 ? $txt['newmessages0'] : $txt['newmessages1']) : '', '.';
|
Chris@76
|
130
|
Chris@76
|
131 // Are there any members waiting for approval?
|
Chris@76
|
132 if (!empty($context['unapproved_members']))
|
Chris@76
|
133 echo '<br />
|
Chris@76
|
134 ', $context['unapproved_members'] == 1 ? $txt['approve_thereis'] : $txt['approve_thereare'], ' <a href="', $scripturl, '?action=viewmembers;sa=browse;type=approve">', $context['unapproved_members'] == 1 ? $txt['approve_member'] : $context['unapproved_members'] . ' ' . $txt['approve_members'], '</a> ', $txt['approve_members_waiting'];
|
Chris@76
|
135
|
Chris@76
|
136 // Is the forum in maintenance mode?
|
Chris@76
|
137 if ($context['in_maintenance'] && $context['user']['is_admin'])
|
Chris@76
|
138 echo '<br />
|
Chris@76
|
139 <b>', $txt[616], '</b>';
|
Chris@76
|
140 }
|
Chris@76
|
141 // Otherwise they're a guest - so politely ask them to register or login.
|
Chris@76
|
142 else
|
Chris@76
|
143 echo '
|
Chris@76
|
144 ', $txt['welcome_guest'];
|
Chris@76
|
145
|
Chris@76
|
146 echo '
|
Chris@76
|
147 <br />', $context['current_time'], '
|
Chris@76
|
148 </td>
|
Chris@76
|
149 </tr>
|
Chris@76
|
150 <tr class="windowbg2">
|
Chris@76
|
151 <td colspan="2" valign="middle" align="center" class="tborder" style="border-width: 1px 0 0 0; font-size: smaller;">';
|
Chris@76
|
152
|
Chris@76
|
153 // Show the menu here, according to the menu sub template.
|
Chris@76
|
154 template_menu();
|
Chris@76
|
155
|
Chris@76
|
156 echo '
|
Chris@76
|
157 </td>
|
Chris@76
|
158 </tr>';
|
Chris@76
|
159
|
Chris@76
|
160 // Show a random news item? (or you could pick one from news_lines...)
|
Chris@76
|
161 if (!empty($settings['enable_news']))
|
Chris@76
|
162 echo '
|
Chris@76
|
163 <tr class="windowbg2">
|
Chris@76
|
164 <td colspan="2" height="24" class="tborder" style="border-width: 1px 0 0 0; padding-left: 1ex;">
|
Chris@76
|
165 <b>', $txt[102], ':</b> ', $context['random_news_line'], '
|
Chris@76
|
166 </td>
|
Chris@76
|
167 </tr>';
|
Chris@76
|
168
|
Chris@76
|
169 echo '
|
Chris@76
|
170 </table>
|
Chris@76
|
171
|
Chris@76
|
172 <br />
|
Chris@76
|
173 <table cellspacing="0" cellpadding="10" border="0" align="center" width="95%" class="tborder">
|
Chris@76
|
174 <tr><td valign="top" style="background-color: #ffffff;">';
|
Chris@76
|
175 }
|
Chris@76
|
176
|
Chris@76
|
177 function template_main_below()
|
Chris@76
|
178 {
|
Chris@76
|
179 global $context, $settings, $options, $scripturl, $txt;
|
Chris@76
|
180
|
Chris@76
|
181 echo '
|
Chris@76
|
182 </td></tr>
|
Chris@76
|
183 </table>';
|
Chris@76
|
184
|
Chris@76
|
185 // Show a vB style login for quick login?
|
Chris@76
|
186 if ($context['show_quick_login'])
|
Chris@76
|
187 {
|
Chris@76
|
188 echo '
|
Chris@76
|
189 <table cellspacing="0" cellpadding="0" border="0" align="center" width="95%">
|
Chris@76
|
190 <tr><td nowrap="nowrap" align="right">
|
Chris@76
|
191 <script language="JavaScript" type="text/javascript" src="', $settings['default_theme_url'], '/sha1.js"></script>
|
Chris@76
|
192
|
Chris@76
|
193 <form action="', $scripturl, '?action=login2" method="post" accept-charset="', $context['character_set'], '"', empty($context['disable_login_hashing']) ? ' onsubmit="hashLoginPassword(this, \'' . $context['session_id'] . '\');"' : '', '><br />
|
Chris@76
|
194 <input type="text" name="user" size="7" />
|
Chris@76
|
195 <input type="password" name="passwrd" size="7" />
|
Chris@76
|
196 <select name="cookielength">
|
Chris@76
|
197 <option value="60">', $txt['smf53'], '</option>
|
Chris@76
|
198 <option value="1440">', $txt['smf47'], '</option>
|
Chris@76
|
199 <option value="10080">', $txt['smf48'], '</option>
|
Chris@76
|
200 <option value="43200">', $txt['smf49'], '</option>
|
Chris@76
|
201 <option value="-1" selected="selected">', $txt['smf50'], '</option>
|
Chris@76
|
202 </select>
|
Chris@76
|
203 <input type="submit" value="', $txt[34], '" /><br />
|
Chris@76
|
204 ', $txt['smf52'], '
|
Chris@76
|
205 <input type="hidden" name="hash_passwrd" value="" />
|
Chris@76
|
206 </form>
|
Chris@76
|
207 </td></tr>
|
Chris@76
|
208 </table>';
|
Chris@76
|
209 }
|
Chris@76
|
210
|
Chris@76
|
211 // Don't show a login box, just a break.
|
Chris@76
|
212 else
|
Chris@76
|
213 echo '
|
Chris@76
|
214 <br />';
|
Chris@76
|
215
|
Chris@76
|
216 // Show the "Powered by" and "Valid" logos, as well as the copyright. Remember, the copyright must be somewhere!
|
Chris@76
|
217 echo '
|
Chris@76
|
218 <br />
|
Chris@76
|
219
|
Chris@76
|
220 <table cellspacing="0" cellpadding="3" border="0" align="center" width="95%" class="tborder">
|
Chris@76
|
221 <tr style="background-color: #ffffff;">
|
Chris@76
|
222 <td width="28%" valign="middle" align="right">
|
Chris@76
|
223 <a href="http://www.mysql.com/" target="_blank"><img src="', $settings['images_url'], '/mysql.gif" alt="', $txt['powered_by_mysql'], '" width="88" height="31" border="0" /></a>
|
Chris@76
|
224 <a href="http://www.php.net/" target="_blank"><img src="', $settings['images_url'], '/php.gif" alt="', $txt['powered_by_php'], '" width="88" height="31" border="0" /></a>
|
Chris@76
|
225 </td>
|
Chris@76
|
226 <td width="44%" valign="middle" align="center">
|
Chris@76
|
227 ', theme_copyright(), '
|
Chris@76
|
228 </td>
|
Chris@76
|
229 <td width="28%" valign="middle" align="left">
|
Chris@76
|
230 <a href="http://validator.w3.org/check/referer" target="_blank"><img src="', $settings['images_url'], '/valid-xhtml10.gif" alt="', $txt['valid_xhtml'], '" width="88" height="31" border="0" /></a>
|
Chris@76
|
231 <a href="http://jigsaw.w3.org/css-validator/check/referer" target="_blank"><img src="', $settings['images_url'], '/valid-css.gif" alt="', $txt['valid_css'], '" width="88" height="31" border="0" /></a>
|
Chris@76
|
232 </td>
|
Chris@76
|
233 </tr>
|
Chris@76
|
234 </table>';
|
Chris@76
|
235
|
Chris@76
|
236 // Show the load time?
|
Chris@76
|
237 if ($context['show_load_time'])
|
Chris@76
|
238 echo '
|
Chris@76
|
239 <div align="center" class="smalltext">
|
Chris@76
|
240 ', $txt['smf301'], $context['load_time'], $txt['smf302'], $context['load_queries'], $txt['smf302b'], '
|
Chris@76
|
241 </div>';
|
Chris@76
|
242
|
Chris@76
|
243 // The following will be used to let the user know that some AJAX process is running
|
Chris@76
|
244 echo '
|
Chris@76
|
245 <div id="ajax_in_progress" style="display: none;', $context['browser']['is_ie'] && !$context['browser']['is_ie7'] ? 'position: absolute;' : '', '">', $txt['ajax_in_progress'], '</div>';
|
Chris@76
|
246
|
Chris@76
|
247 // And then we're done!
|
Chris@76
|
248 echo '
|
Chris@76
|
249 </body>
|
Chris@76
|
250 </html>';
|
Chris@76
|
251 }
|
Chris@76
|
252
|
Chris@76
|
253 // Show a linktree. This is that thing that shows "My Community | General Category | General Discussion"..
|
Chris@76
|
254 function theme_linktree()
|
Chris@76
|
255 {
|
Chris@76
|
256 global $context, $settings, $options;
|
Chris@76
|
257
|
Chris@76
|
258 // Folder style or inline? Inline has a smaller font.
|
Chris@76
|
259 echo '<span class="nav"', $settings['linktree_inline'] ? ' style="font-size: smaller;"' : '', '>';
|
Chris@76
|
260
|
Chris@76
|
261 // Each tree item has a URL and name. Some may have extra_before and extra_after.
|
Chris@76
|
262 foreach ($context['linktree'] as $link_num => $tree)
|
Chris@76
|
263 {
|
Chris@76
|
264 // Show the | | |-[] Folders.
|
Chris@76
|
265 if (!$settings['linktree_inline'])
|
Chris@76
|
266 {
|
Chris@76
|
267 if ($link_num > 0)
|
Chris@76
|
268 echo str_repeat('<img src="' . $settings['images_url'] . '/icons/linktree_main.gif" alt="| " border="0" />', $link_num - 1), '<img src="' . $settings['images_url'] . '/icons/linktree_side.gif" alt="|-" border="0" />';
|
Chris@76
|
269 echo '<img src="' . $settings['images_url'] . '/icons/folder_open.gif" alt="+" border="0" /> ';
|
Chris@76
|
270 }
|
Chris@76
|
271
|
Chris@76
|
272 // Show something before the link?
|
Chris@76
|
273 if (isset($tree['extra_before']))
|
Chris@76
|
274 echo $tree['extra_before'];
|
Chris@76
|
275
|
Chris@76
|
276 // Show the link, including a URL if it should have one.
|
Chris@76
|
277 echo '<b>', $settings['linktree_link'] && isset($tree['url']) ? '<a href="' . $tree['url'] . '" class="nav">' . $tree['name'] . '</a>' : $tree['name'], '</b>';
|
Chris@76
|
278
|
Chris@76
|
279 // Show something after the link...?
|
Chris@76
|
280 if (isset($tree['extra_after']))
|
Chris@76
|
281 echo $tree['extra_after'];
|
Chris@76
|
282
|
Chris@76
|
283 // Don't show a separator for the last one.
|
Chris@76
|
284 if ($link_num != count($context['linktree']) - 1)
|
Chris@76
|
285 echo $settings['linktree_inline'] ? ' | ' : '<br />';
|
Chris@76
|
286 }
|
Chris@76
|
287
|
Chris@76
|
288 echo '</span>';
|
Chris@76
|
289 }
|
Chris@76
|
290
|
Chris@76
|
291 // Show the menu up top. Something like [home] [help] [profile] [logout]...
|
Chris@76
|
292 function template_menu()
|
Chris@76
|
293 {
|
Chris@76
|
294 global $context, $settings, $options, $scripturl, $txt;
|
Chris@76
|
295
|
Chris@76
|
296 // Show the [home] and [help] buttons.
|
Chris@76
|
297 echo '
|
Chris@76
|
298 <a href="', $scripturl, '">', ($settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/' . $context['user']['language'] . '/home.gif" alt="' . $txt[103] . '" border="0" />' : $txt[103]), '</a>', $context['menu_separator'], '
|
Chris@76
|
299 <a href="', $scripturl, '?action=help">', ($settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/' . $context['user']['language'] . '/help.gif" alt="' . $txt[119] . '" border="0" />' : $txt[119]), '</a>', $context['menu_separator'];
|
Chris@76
|
300
|
Chris@76
|
301 // How about the [search] button?
|
Chris@76
|
302 if ($context['allow_search'])
|
Chris@76
|
303 echo '
|
Chris@76
|
304 <a href="', $scripturl, '?action=search">', ($settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/' . $context['user']['language'] . '/search.gif" alt="' . $txt[182] . '" border="0" />' : $txt[182]), '</a>', $context['menu_separator'];
|
Chris@76
|
305
|
Chris@76
|
306 // Is the user allowed to administrate at all? ([admin])
|
Chris@76
|
307 if ($context['allow_admin'])
|
Chris@76
|
308 echo '
|
Chris@76
|
309 <a href="', $scripturl, '?action=admin">', ($settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/' . $context['user']['language'] . '/admin.gif" alt="' . $txt[2] . '" border="0" />' : $txt[2]), '</a>', $context['menu_separator'];
|
Chris@76
|
310
|
Chris@76
|
311 // Edit Profile... [profile]
|
Chris@76
|
312 if ($context['allow_edit_profile'])
|
Chris@76
|
313 echo '
|
Chris@76
|
314 <a href="', $scripturl, '?action=profile">', ($settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/' . $context['user']['language'] . '/profile.gif" alt="' . $txt[79] . '" border="0" />' : $txt[467]), '</a>', $context['menu_separator'];
|
Chris@76
|
315
|
Chris@76
|
316 // The [calendar]!
|
Chris@76
|
317 if ($context['allow_calendar'])
|
Chris@76
|
318 echo '
|
Chris@76
|
319 <a href="', $scripturl, '?action=calendar">', ($settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/' . $context['user']['language'] . '/calendar.gif" alt="' . $txt['calendar24'] . '" border="0" />' : $txt['calendar24']), '</a>', $context['menu_separator'];
|
Chris@76
|
320
|
Chris@76
|
321 // If the user is a guest, show [login] and [register] buttons.
|
Chris@76
|
322 if ($context['user']['is_guest'])
|
Chris@76
|
323 {
|
Chris@76
|
324 echo '
|
Chris@76
|
325 <a href="', $scripturl, '?action=login">', ($settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/' . $context['user']['language'] . '/login.gif" alt="' . $txt[34] . '" border="0" />' : $txt[34]), '</a>', $context['menu_separator'], '
|
Chris@76
|
326 <a href="', $scripturl, '?action=register">', ($settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/' . $context['user']['language'] . '/register.gif" alt="' . $txt[97] . '" border="0" />' : $txt[97]), '</a>';
|
Chris@76
|
327 }
|
Chris@76
|
328 // Otherwise, they might want to [logout]...
|
Chris@76
|
329 else
|
Chris@76
|
330 echo '
|
Chris@76
|
331 <a href="', $scripturl, '?action=logout;sesc=', $context['session_id'], '">', ($settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/' . $context['user']['language'] . '/logout.gif" alt="' . $txt[108] . '" border="0" />' : $txt[108]), '</a>';
|
Chris@76
|
332 }
|
Chris@76
|
333
|
Chris@76
|
334 // Generate a strip of buttons, out of buttons.
|
Chris@76
|
335 function template_button_strip($button_strip, $direction = 'top', $force_reset = false, $custom_td = '')
|
Chris@76
|
336 {
|
Chris@76
|
337 global $settings, $buttons, $context, $txt, $scripturl;
|
Chris@76
|
338
|
Chris@76
|
339 if (empty($button_strip))
|
Chris@76
|
340 return '';
|
Chris@76
|
341
|
Chris@76
|
342 // Create the buttons...
|
Chris@76
|
343 foreach ($button_strip as $key => $value)
|
Chris@76
|
344 {
|
Chris@76
|
345 if (isset($value['test']) && empty($context[$value['test']]))
|
Chris@76
|
346 {
|
Chris@76
|
347 unset($button_strip[$key]);
|
Chris@76
|
348 continue;
|
Chris@76
|
349 }
|
Chris@76
|
350 elseif (!isset($buttons[$key]) || $force_reset)
|
Chris@76
|
351 $buttons[$key] = '<a href="' . $value['url'] . '" ' .( isset($value['custom']) ? $value['custom'] : '') . '>' . ($settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/' . ($value['lang'] ? $context['user']['language'] . '/' : '') . $value['image'] . '" alt="' . $txt[$value['text']] . '" border="0" />' : $txt[$value['text']]) . '</a>';
|
Chris@76
|
352
|
Chris@76
|
353 $button_strip[$key] = $buttons[$key];
|
Chris@76
|
354 }
|
Chris@76
|
355
|
Chris@76
|
356 echo '
|
Chris@76
|
357 <td ', $custom_td, '>', implode($context['menu_separator'], $button_strip) , '</td>';
|
Chris@76
|
358 }
|
Chris@76
|
359
|
Chris@76
|
360 ?> |