Mercurial > hg > vamp-website
comparison forum/Themes/babylon/Recent.template.php @ 76:e3e11437ecea website
Add forum code
author | Chris Cannam |
---|---|
date | Sun, 07 Jul 2013 11:25:48 +0200 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
75:72f59aa7e503 | 76:e3e11437ecea |
---|---|
1 <?php | |
2 // Version: 1.1.9; Recent | |
3 | |
4 function template_main() | |
5 { | |
6 global $context, $settings, $options, $txt, $scripturl; | |
7 | |
8 echo ' | |
9 <div style="padding: 3px;">', theme_linktree(), '</div> | |
10 <table width="100%" cellpadding="3" cellspacing="0" border="0" class="tborder"> | |
11 <tr> | |
12 <td align="left" class="catbg" width="100%" height="30"> | |
13 <b>', $txt[139], ':</b> ', $context['page_index'], ' | |
14 </td> | |
15 </tr> | |
16 </table> | |
17 <br />'; | |
18 | |
19 foreach ($context['posts'] as $post) | |
20 { | |
21 echo ' | |
22 <table width="100%" cellpadding="4" cellspacing="1" border="0" class="bordercolor"> | |
23 <tr class="titlebg"> | |
24 <td> | |
25 <div style="float: left; width: 3ex;"> ', $post['counter'], ' </div> | |
26 <div style="float: left;"> ', $post['category']['link'], ' / ', $post['board']['link'], ' / ', $post['link'], '</div> | |
27 <div align="right"> ', $txt[30], ': ', $post['time'], ' </div> | |
28 </td> | |
29 </tr> | |
30 <tr> | |
31 <td class="catbg" colspan="3"> | |
32 ', $txt[109], ' ' . $post['first_poster']['link'] . ' - ' . $txt[22] . ' ' . $txt[525] . ' ' . $post['poster']['link'] . ' | |
33 </td> | |
34 </tr> | |
35 <tr> | |
36 <td class="windowbg2" colspan="3" valign="top" height="80"> | |
37 <div class="post">' . $post['message'] . '</div> | |
38 </td> | |
39 </tr> | |
40 <tr> | |
41 <td class="catbg" colspan="3" align="right">'; | |
42 | |
43 if ($post['can_delete']) | |
44 echo ' | |
45 <a href="', $scripturl, '?action=deletemsg;msg=', $post['id'], ';topic=', $post['topic'], ';recent;sesc=', $context['session_id'], '" onclick="return confirm(\'', $txt[154], '?\');">', ($settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/' . $context['user']['language'] . '/delete.gif" alt="' . $txt[121] . '" border="0" />' : $txt[31]), '</a>'; | |
46 if ($post['can_delete'] && ($post['can_mark_notify'] || $post['can_reply'])) | |
47 echo ' | |
48 ', $context['menu_separator']; | |
49 if ($post['can_reply']) | |
50 echo ' | |
51 <a href="', $scripturl, '?action=post;topic=', $post['topic'], '.', $post['start'], '">', ($settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/' . $context['user']['language'] . '/reply_sm.gif" alt="' . $txt[146] . '" border="0" />' : $txt[146]), '</a>', $context['menu_separator'], ' | |
52 <a href="', $scripturl, '?action=post;topic=', $post['topic'], '.', $post['start'], ';quote=', $post['id'], ';sesc=', $context['session_id'], '">', ($settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/' . $context['user']['language'] . '/quote.gif" alt="' . $txt[145] . '" border="0" />' : $txt[145]), '</a>'; | |
53 if ($post['can_reply'] && $post['can_mark_notify']) | |
54 echo ' | |
55 ', $context['menu_separator']; | |
56 if ($post['can_mark_notify']) | |
57 echo ' | |
58 <a href="' . $scripturl . '?action=notify;topic=' . $post['topic'] . '.' . $post['start'] . '">' . ($settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/' . $context['user']['language'] . '/notify_sm.gif" alt="' . $txt[131] . '" border="0" />' : $txt[131]) . '</a>'; | |
59 | |
60 echo '</td> | |
61 </tr> | |
62 </table> | |
63 <br />'; | |
64 } | |
65 | |
66 echo ' | |
67 <table width="100%" cellpadding="3" cellspacing="0" border="0" class="tborder"> | |
68 <tr> | |
69 <td align="left" class="catbg" width="100%" height="30"> | |
70 <b>', $txt[139], ':</b> ', $context['page_index'], ' | |
71 </td> | |
72 </tr> | |
73 </table>'; | |
74 if ($settings['linktree_inline']) | |
75 echo ' | |
76 <div style="padding: 3px;">', theme_linktree(), '</div>'; | |
77 } | |
78 | |
79 function template_unread() | |
80 { | |
81 global $context, $settings, $options, $txt, $scripturl, $modSettings; | |
82 | |
83 echo ' | |
84 <table width="100%" border="0" cellspacing="0" cellpadding="3"> | |
85 <tr> | |
86 <td>', theme_linktree(), '</td> | |
87 </tr> | |
88 </table> | |
89 | |
90 <table width="100%" cellpadding="3" cellspacing="0" border="0" class="tborder" style="margin-bottom: 1ex;"> | |
91 <tr> | |
92 <td align="left" class="catbg" height="30"> | |
93 <table border="0" width="100%" cellpadding="0" cellspacing="0"> | |
94 <tr> | |
95 <td valign="middle"><b>' . $txt[139] . ':</b> ' . $context['page_index'] . '</td>', $settings['show_mark_read'] ? ' | |
96 <td align="right" nowrap="nowrap" style="font-size: smaller;"><a href="' . $scripturl . '?action=markasread;sa=' . (empty($context['current_board']) ? 'all' : 'board;board=' . $context['current_board'] . '.0') . ';sesc=' . $context['session_id'] . '">' . ($settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/' . $context['user']['language'] . '/markread.gif" alt="' . $txt[452] . '" border="0" />' : $txt[452]) . '</a></td>' : '', ' | |
97 </tr> | |
98 </table> | |
99 </td> | |
100 </tr> | |
101 </table> | |
102 | |
103 <table border="0" width="100%" cellspacing="0" cellpadding="0" class="bordercolor" style="margin-bottom: 1ex;"> | |
104 <tr><td> | |
105 <table border="0" width="100%" cellspacing="1" cellpadding="4" class="bordercolor"> | |
106 <tr class="titlebg">'; | |
107 if (!empty($context['topics'])) | |
108 echo ' | |
109 <td width="10%" colspan="2"> </td> | |
110 <td><a href="', $scripturl, '?action=unread', $context['showing_all_topics'] ? ';all' : '', $context['querystring_board_limits'], ';sort=subject', $context['sort_by'] == 'subject' && $context['sort_direction'] == 'up' ? ';desc' : '', '">', $txt[70], $context['sort_by'] == 'subject' ? ' <img src="' . $settings['images_url'] . '/sort_' . $context['sort_direction'] . '.gif" alt="" border="0" />' : '', '</a></td> | |
111 <td width="14%"><a href="', $scripturl, '?action=unread', $context['showing_all_topics'] ? ';all' : '', $context['querystring_board_limits'], ';sort=starter', $context['sort_by'] == 'starter' && $context['sort_direction'] == 'up' ? ';desc' : '', '">', $txt[109], $context['sort_by'] == 'starter' ? ' <img src="' . $settings['images_url'] . '/sort_' . $context['sort_direction'] . '.gif" alt="" border="0" />' : '', '</a></td> | |
112 <td width="4%" align="center"><a href="', $scripturl, '?action=unread', $context['showing_all_topics'] ? ';all' : '', $context['querystring_board_limits'], ';sort=replies', $context['sort_by'] == 'replies' && $context['sort_direction'] == 'up' ? ';desc' : '', '">', $txt[110], $context['sort_by'] == 'replies' ? ' <img src="' . $settings['images_url'] . '/sort_' . $context['sort_direction'] . '.gif" alt="" border="0" />' : '', '</a></td> | |
113 <td width="4%" align="center"><a href="', $scripturl, '?action=unread', $context['showing_all_topics'] ? ';all' : '', $context['querystring_board_limits'], ';sort=views', $context['sort_by'] == 'views' && $context['sort_direction'] == 'up' ? ';desc' : '', '">', $txt[301], $context['sort_by'] == 'views' ? ' <img src="' . $settings['images_url'] . '/sort_' . $context['sort_direction'] . '.gif" alt="" border="0" />' : '', '</a></td> | |
114 <td width="24%"><a href="', $scripturl, '?action=unread', $context['showing_all_topics'] ? ';all' : '', $context['querystring_board_limits'], ';sort=last_post', $context['sort_by'] == 'last_post' && $context['sort_direction'] == 'up' ? ';desc' : '', '">', $txt[111], $context['sort_by'] == 'last_post' ? ' <img src="' . $settings['images_url'] . '/sort_' . $context['sort_direction'] . '.gif" alt="" border="0" />' : '', '</a></td>'; | |
115 else | |
116 echo ' | |
117 <td width="100%" colspan="7">', $context['showing_all_topics'] ? $txt[151] : $txt['unread_topics_visit_none'], '</td>'; | |
118 echo ' | |
119 </tr>'; | |
120 | |
121 foreach ($context['topics'] as $topic) | |
122 { | |
123 echo ' | |
124 <tr> | |
125 <td class="windowbg2" valign="middle" align="center" width="6%"> | |
126 <img src="' . $settings['images_url'] . '/topic/' . $topic['class'] . '.gif" alt="" /></td> | |
127 <td class="windowbg2" valign="middle" align="center" width="4%"> | |
128 <img src="' . $topic['first_post']['icon_url'] . '" alt="" border="0" align="middle" /></td> | |
129 <td class="windowbg" valign="middle" width="48%"> | |
130 ' . $topic['first_post']['link'] . ' <a href="' . $topic['new_href'] . '"><img src="' . $settings['images_url'] . '/' . $context['user']['language'] . '/new.gif" alt="' . $txt[302] . '" border="0" /></a> <span class="smalltext">' . $topic['pages'] . '</span> | |
131 <div class="smalltext"><i>' . $txt['smf88'] . ' ' . $topic['board']['link'] . '</i></div></td> | |
132 <td class="windowbg2" valign="middle" width="14%"> | |
133 ' . $topic['first_post']['member']['link'] . '</td> | |
134 <td class="windowbg" valign="middle" width="4%" align="center"> | |
135 ' . $topic['replies'] . '</td> | |
136 <td class="windowbg" valign="middle" width="4%" align="center"> | |
137 ' . $topic['views'] . '</td> | |
138 <td class="windowbg2" valign="middle" width="22%"> | |
139 <a href="', $topic['last_post']['href'], '"><img src="', $settings['images_url'], '/icons/last_post.gif" alt="', $txt[111], '" title="', $txt[111], '" border="0" style="float: right;" /></a> | |
140 <span class="smalltext"> | |
141 ', $topic['last_post']['time'], '<br /> | |
142 ', $txt[525], ' ', $topic['last_post']['member']['link'], ' | |
143 </span></td> | |
144 </tr>'; | |
145 } | |
146 | |
147 if (!empty($context['topics']) && !$context['showing_all_topics']) | |
148 echo ' | |
149 <tr class="titlebg"> | |
150 <td colspan="7" align="right"><a href="', $scripturl, '?action=unread;all', $context['querystring_board_limits'], '">', $txt['unread_topics_all'], '</a></td> | |
151 </tr>'; | |
152 | |
153 echo ' | |
154 </table> | |
155 </td></tr> | |
156 </table> | |
157 | |
158 <table width="100%" cellpadding="3" cellspacing="0" border="0" class="tborder" style="margin-bottom: 1ex;"> | |
159 <tr> | |
160 <td align="left" class="catbg" height="30"> | |
161 <table border="0" width="100%" cellpadding="0" cellspacing="0"> | |
162 <tr> | |
163 <td valign="middle"><b>' . $txt[139] . ':</b> ' . $context['page_index'] . '</td>', $settings['show_mark_read'] ? ' | |
164 <td align="right" nowrap="nowrap" style="font-size: smaller;"><a href="' . $scripturl . '?action=markasread;sa=' . (empty($context['current_board']) ? 'all' : 'board;board=' . $context['current_board'] . '.0') . ';sesc=' . $context['session_id'] . '">' . ($settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/' . $context['user']['language'] . '/markread.gif" alt="' . $txt[452] . '" border="0" />' : $txt[452]) . '</a></td>' : '', ' | |
165 </tr> | |
166 </table> | |
167 </td> | |
168 </tr> | |
169 </table> | |
170 | |
171 <table cellpadding="0" cellspacing="0" width="55%"> | |
172 <tr> | |
173 <td class="smalltext" align="left" style="padding-top: 1ex;">', !empty($modSettings['enableParticipation']) ? ' | |
174 <img src="' . $settings['images_url'] . '/topic/my_normal_post.gif" alt="" align="middle" /> ' . $txt['participation_caption'] . '<br />' : '', ' | |
175 <img src="' . $settings['images_url'] . '/topic/normal_post.gif" alt="" align="middle" /> ' . $txt[457] . '<br /> | |
176 <img src="' . $settings['images_url'] . '/topic/hot_post.gif" alt="" align="middle" /> ' . $txt[454] . '<br /> | |
177 <img src="' . $settings['images_url'] . '/topic/veryhot_post.gif" alt="" align="middle" /> ' . $txt[455] . ' | |
178 </td> | |
179 <td class="smalltext" align="left" valign="top" style="padding-top: 1ex;"> | |
180 <img src="' . $settings['images_url'] . '/topic/normal_post_locked.gif" alt="" align="middle" /> ' . $txt[456] . '<br />' . ($modSettings['enableStickyTopics'] == '1' ? ' | |
181 <img src="' . $settings['images_url'] . '/topic/normal_post_sticky.gif" alt="" align="middle" /> ' . $txt['smf96'] . '<br />' : '') . ($modSettings['pollMode'] == '1' ? ' | |
182 <img src="' . $settings['images_url'] . '/topic/normal_poll.gif" alt="" align="middle" /> ' . $txt['smf43'] : '') . ' | |
183 </td> | |
184 </tr> | |
185 </table>'; | |
186 } | |
187 | |
188 function template_replies() | |
189 { | |
190 global $context, $settings, $options, $txt, $scripturl, $modSettings; | |
191 | |
192 echo ' | |
193 <table width="100%" border="0" cellspacing="0" cellpadding="3" align="center"> | |
194 <tr> | |
195 <td>', theme_linktree(), '</td> | |
196 </tr> | |
197 </table> | |
198 | |
199 <table width="100%" cellpadding="3" cellspacing="0" border="0" class="tborder" style="margin-bottom: 1ex;"> | |
200 <tr> | |
201 <td align="left" class="catbg" height="30"> | |
202 <table border="0" width="100%" cellpadding="0" cellspacing="0"> | |
203 <tr> | |
204 <td valign="middle"><b>' . $txt[139] . ':</b> ' . $context['page_index'] . '</td> | |
205 <td align="right" nowrap="nowrap" style="font-size: smaller;">'; | |
206 | |
207 if (isset($context['topics_to_mark']) && !empty($settings['show_mark_read'])) | |
208 echo ' | |
209 <a href="' . $scripturl . '?action=markasread;sa=unreadreplies;topics=' . $context['topics_to_mark'] . ';sesc=', $context['session_id'], '">' . ($settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/' . $context['user']['language'] . '/markread.gif" alt="' . $txt[452] . '" border="0" />' : $txt[452]) . '</a>'; | |
210 | |
211 echo '</td> | |
212 </tr> | |
213 </table> | |
214 </td> | |
215 </tr> | |
216 </table> | |
217 | |
218 <table border="0" width="100%" cellspacing="0" cellpadding="0" class="bordercolor" style="margin-bottom: 1ex;"> | |
219 <tr><td> | |
220 <table border="0" width="100%" cellspacing="1" cellpadding="4" class="bordercolor"> | |
221 <tr class="titlebg">'; | |
222 if (!empty($context['topics'])) | |
223 echo ' | |
224 <td width="10%" colspan="2"> </td> | |
225 <td><a href="', $scripturl, '?action=unreadreplies', $context['querystring_board_limits'], ';sort=subject', $context['sort_by'] == 'subject' && $context['sort_direction'] == 'up' ? ';desc' : '', '">', $txt[70], $context['sort_by'] == 'subject' ? ' <img src="' . $settings['images_url'] . '/sort_' . $context['sort_direction'] . '.gif" alt="" border="0" />' : '', '</a></td> | |
226 <td width="14%"><a href="', $scripturl, '?action=unreadreplies', $context['querystring_board_limits'], ';sort=starter', $context['sort_by'] == 'starter' && $context['sort_direction'] == 'up' ? ';desc' : '', '">', $txt[109], $context['sort_by'] == 'starter' ? ' <img src="' . $settings['images_url'] . '/sort_' . $context['sort_direction'] . '.gif" alt="" border="0" />' : '', '</a></td> | |
227 <td width="4%" align="center"><a href="', $scripturl, '?action=unreadreplies', $context['querystring_board_limits'], ';sort=replies', $context['sort_by'] == 'replies' && $context['sort_direction'] == 'up' ? ';desc' : '', '">', $txt[110], $context['sort_by'] == 'replies' ? ' <img src="' . $settings['images_url'] . '/sort_' . $context['sort_direction'] . '.gif" alt="" border="0" />' : '', '</a></td> | |
228 <td width="4%" align="center"><a href="', $scripturl, '?action=unreadreplies', $context['querystring_board_limits'], ';sort=views', $context['sort_by'] == 'views' && $context['sort_direction'] == 'up' ? ';desc' : '', '">', $txt[301], $context['sort_by'] == 'views' ? ' <img src="' . $settings['images_url'] . '/sort_' . $context['sort_direction'] . '.gif" alt="" border="0" />' : '', '</a></td> | |
229 <td width="24%"><a href="', $scripturl, '?action=unreadreplies', $context['querystring_board_limits'], ';sort=last_post', $context['sort_by'] == 'last_post' && $context['sort_direction'] == 'up' ? ';desc' : '', '">', $txt[111], $context['sort_by'] == 'last_post' ? ' <img src="' . $settings['images_url'] . '/sort_' . $context['sort_direction'] . '.gif" alt="" border="0" />' : '', '</a></td>'; | |
230 else | |
231 echo ' | |
232 <td width="100%" colspan="7">' . $txt[151] . '</td>'; | |
233 echo ' | |
234 </tr>'; | |
235 | |
236 foreach ($context['topics'] as $topic) | |
237 { | |
238 echo ' | |
239 <tr> | |
240 <td class="windowbg2" valign="middle" align="center" width="6%"> | |
241 <img src="' . $settings['images_url'] . '/topic/' . $topic['class'] . '.gif" alt="" /></td> | |
242 <td class="windowbg2" valign="middle" align="center" width="4%"> | |
243 <img src="' . $topic['first_post']['icon_url'] . '" alt="" border="0" align="middle" /></td> | |
244 <td class="windowbg" valign="middle" width="48%"> | |
245 ', $topic['first_post']['link'], ' <a href="', $topic['new_href'], '"><img src="', $settings['images_url'], '/', $context['user']['language'], '/new.gif" alt="', $txt[302], '" /></a> | |
246 <div class="smalltext">', $topic['pages'], ' <i>' . $txt['smf88'] . ' ' . $topic['board']['link'] . '</i></div></td> | |
247 <td class="windowbg2" valign="middle" width="14%"> | |
248 ' . $topic['first_post']['member']['link'] . '</td> | |
249 <td class="windowbg" valign="middle" width="4%" align="center"> | |
250 ' . $topic['replies'] . '</td> | |
251 <td class="windowbg" valign="middle" width="4%" align="center"> | |
252 ' . $topic['views'] . '</td> | |
253 <td class="windowbg2" valign="middle" width="22%"> | |
254 <a href="', $topic['last_post']['href'], '"><img src="', $settings['images_url'], '/icons/last_post.gif" alt="', $txt[111], '" title="', $txt[111], '" border="0" style="float: right;" /></a> | |
255 <span class="smalltext"> | |
256 ', $topic['last_post']['time'], '<br /> | |
257 ', $txt[525], ' ', $topic['last_post']['member']['link'], ' | |
258 </span></td> | |
259 </tr>'; | |
260 } | |
261 | |
262 echo ' | |
263 </table> | |
264 </td></tr> | |
265 </table> | |
266 | |
267 <table width="100%" cellpadding="3" cellspacing="0" border="0" class="tborder" style="margin-bottom: 1ex;"> | |
268 <tr> | |
269 <td align="left" class="catbg" height="30"> | |
270 <table border="0" width="100%" cellpadding="0" cellspacing="0"> | |
271 <tr> | |
272 <td valign="middle"><b>' . $txt[139] . ':</b> ' . $context['page_index'] . '</td> | |
273 <td align="right" nowrap="nowrap" style="font-size: smaller;">'; | |
274 | |
275 if (isset($context['topics_to_mark']) && !empty($settings['show_mark_read'])) | |
276 echo ' | |
277 <a href="' . $scripturl . '?action=markasread;sa=unreadreplies;topics=' . $context['topics_to_mark'] . ';sesc=', $context['session_id'], '">' . ($settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/' . $context['user']['language'] . '/markread.gif" alt="' . $txt[452] . '" border="0" />' : $txt[452]) . '</a>'; | |
278 | |
279 echo '</td> | |
280 </tr> | |
281 </table> | |
282 </td> | |
283 </tr> | |
284 </table> | |
285 | |
286 <table cellpadding="0" cellspacing="0" width="55%"> | |
287 <tr> | |
288 <td class="smalltext" align="left" style="padding-top: 1ex;"> | |
289 <img src="' . $settings['images_url'] . '/topic/my_normal_post.gif" alt="" align="middle" /> ' . $txt[457] . '<br /> | |
290 <img src="' . $settings['images_url'] . '/topic/my_hot_post.gif" alt="" align="middle" /> ' . $txt[454] . '<br /> | |
291 <img src="' . $settings['images_url'] . '/topic/my_veryhot_post.gif" alt="" align="middle" /> ' . $txt[455] . ' | |
292 </td> | |
293 <td class="smalltext" align="left" valign="top" style="padding-top: 1ex;"> | |
294 <img src="' . $settings['images_url'] . '/topic/my_normal_post_locked.gif" alt="" align="middle" /> ' . $txt[456] . '<br />' . ($modSettings['enableStickyTopics'] == '1' ? ' | |
295 <img src="' . $settings['images_url'] . '/topic/my_normal_post_sticky.gif" alt="" align="middle" /> ' . $txt['smf96'] . '<br />' : '') . ($modSettings['pollMode'] == '1' ? ' | |
296 <img src="' . $settings['images_url'] . '/topic/my_normal_poll.gif" alt="" align="middle" /> ' . $txt['smf43'] : '') . ' | |
297 </td> | |
298 </tr> | |
299 </table>'; | |
300 } | |
301 | |
302 ?> |