Mercurial > hg > vamp-website
comparison forum/Themes/classic/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="40"> | |
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="0" cellspacing="0" border="0" class="bordercolor"> | |
91 <tr><td> | |
92 <div style="padding: 1px;" class="bordercolor"> | |
93 <table width="100%" cellpadding="4" cellspacing="0" border="0" class="catbg"> | |
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['no_board_limits']) ? 'all' : 'board' . $context['querystring_board_limits']) . ';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 </div> | |
100 | |
101 <table border="0" width="100%" cellspacing="1" cellpadding="4" class="bordercolor"> | |
102 <tr class="titlebg">'; | |
103 if (!empty($context['topics'])) | |
104 echo ' | |
105 <td width="10%" colspan="2"> </td> | |
106 <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> | |
107 <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> | |
108 <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> | |
109 <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> | |
110 <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>'; | |
111 else | |
112 echo ' | |
113 <td width="100%" colspan="7">', $context['showing_all_topics'] ? $txt[151] : $txt['unread_topics_visit_none'], '</td>'; | |
114 echo ' | |
115 </tr>'; | |
116 | |
117 foreach ($context['topics'] as $topic) | |
118 { | |
119 echo ' | |
120 <tr> | |
121 <td class="windowbg2" valign="middle" align="center" width="6%"> | |
122 <img src="', $settings['images_url'], '/topic/', $topic['class'], '.gif" alt="" /></td> | |
123 <td class="windowbg2" valign="middle" align="center" width="4%"> | |
124 <img src="', $settings[$context['icon_sources'][$topic['first_post']['icon']]], '/post/', $topic['first_post']['icon'], '.gif" alt="" border="0" align="middle" /></td> | |
125 <td class="windowbg" valign="middle" width="48%"> | |
126 ', $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> | |
127 <div class="smalltext"><i>', $txt['smf88'], ' ', $topic['board']['link'], '</i></div></td> | |
128 <td class="windowbg2" valign="middle" width="14%"> | |
129 ', $topic['first_post']['member']['link'], '</td> | |
130 <td class="windowbg" valign="middle" width="4%" align="center"> | |
131 ', $topic['replies'], '</td> | |
132 <td class="windowbg" valign="middle" width="4%" align="center"> | |
133 ', $topic['views'] . '</td> | |
134 <td class="windowbg2" valign="middle" width="27%"> | |
135 <span class="smalltext"> | |
136 ', $topic['last_post']['time'], '<br /> | |
137 ', $txt[525], ' ', $topic['last_post']['member']['link'], ' | |
138 </span></td> | |
139 </tr>'; | |
140 } | |
141 | |
142 if (!empty($context['topics']) && !$context['showing_all_topics']) | |
143 echo ' | |
144 <tr class="titlebg"> | |
145 <td colspan="7" align="right"><a href="', $scripturl, '?action=unread;all', $context['querystring_board_limits'], '">', $txt['unread_topics_all'], '</a></td> | |
146 </tr>'; | |
147 | |
148 echo ' | |
149 </table> | |
150 | |
151 <div style="padding: 1px;" class="bordercolor"> | |
152 <table width="100%" cellpadding="4" cellspacing="0" border="0" class="catbg"> | |
153 <tr> | |
154 <td valign="middle"><b>', $txt[139], ':</b> ', $context['page_index'], '</td>', $settings['show_mark_read'] ? ' | |
155 <td align="right" nowrap="nowrap" style="font-size: smaller;"><a href="' . $scripturl . '?action=markasread;sa=' . (!empty($context['no_board_limits']) ? 'all' : 'board' . $context['querystring_board_limits']) . ';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>' : '', ' | |
156 </tr> | |
157 </table> | |
158 </div> | |
159 </td></tr> | |
160 </table> | |
161 <table cellpadding="0" cellspacing="0" width="55%"> | |
162 <tr> | |
163 <td class="smalltext" align="left" style="padding-top: 1ex;">', !empty($modSettings['enableParticipation']) ? ' | |
164 <img src="' . $settings['images_url'] . '/topic/my_normal_post.gif" alt="" align="middle" /> ' . $txt['participation_caption'] . '<br />' : '', ' | |
165 <img src="' . $settings['images_url'] . '/topic/normal_post.gif" alt="" align="middle" /> ' . $txt[457] . '<br /> | |
166 <img src="' . $settings['images_url'] . '/topic/hot_post.gif" alt="" align="middle" /> ' . $txt[454] . '<br /> | |
167 <img src="' . $settings['images_url'] . '/topic/veryhot_post.gif" alt="" align="middle" /> ' . $txt[455] . ' | |
168 </td> | |
169 <td class="smalltext" align="left" valign="top" style="padding-top: 1ex;"> | |
170 <img src="' . $settings['images_url'] . '/topic/normal_post_locked.gif" alt="" align="middle" /> ' . $txt[456] . '<br />' . ($modSettings['enableStickyTopics'] == '1' ? ' | |
171 <img src="' . $settings['images_url'] . '/topic/normal_post_sticky.gif" alt="" align="middle" /> ' . $txt['smf96'] . '<br />' : '') . ($modSettings['pollMode'] == '1' ? ' | |
172 <img src="' . $settings['images_url'] . '/topic/normal_poll.gif" alt="" align="middle" /> ' . $txt['smf43'] : '') . ' | |
173 </td> | |
174 </tr> | |
175 </table>'; | |
176 } | |
177 | |
178 function template_replies() | |
179 { | |
180 global $context, $settings, $options, $txt, $scripturl, $modSettings; | |
181 | |
182 echo ' | |
183 <table width="100%" border="0" cellspacing="0" cellpadding="3" align="center"> | |
184 <tr> | |
185 <td>', theme_linktree(), '</td> | |
186 </tr> | |
187 </table> | |
188 <table border="0" width="100%" cellspacing="0" cellpadding="0" class="bordercolor"> | |
189 <tr><td> | |
190 <div style="padding: 1px;" class="bordercolor"> | |
191 <table width="100%" cellpadding="4" cellspacing="0" border="0" class="catbg"> | |
192 <tr> | |
193 <td valign="middle"><b>' . $txt[139] . ':</b> ' . $context['page_index'] . '</td> | |
194 <td align="right" nowrap="nowrap" style="font-size: smaller;">'; | |
195 if (isset($context['topics_to_mark']) && !empty($settings['show_mark_read'])) | |
196 echo ' | |
197 <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>'; | |
198 echo ' | |
199 </td> | |
200 </tr> | |
201 </table> | |
202 </div> | |
203 | |
204 <table border="0" width="100%" cellspacing="1" cellpadding="4" class="bordercolor"> | |
205 <tr class="titlebg">'; | |
206 if (!empty($context['topics'])) | |
207 echo ' | |
208 <td width="10%" colspan="2"> </td> | |
209 <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> | |
210 <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> | |
211 <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> | |
212 <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> | |
213 <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>'; | |
214 else | |
215 echo ' | |
216 <td width="100%" colspan="7">' . $txt[151] . '</td>'; | |
217 echo ' | |
218 </tr>'; | |
219 | |
220 foreach ($context['topics'] as $topic) | |
221 { | |
222 echo ' | |
223 <tr> | |
224 <td class="windowbg2" valign="middle" align="center" width="6%"> | |
225 <img src="', $settings['images_url'], '/topic/', $topic['class'], '.gif" alt="" /></td> | |
226 <td class="windowbg2" valign="middle" align="center" width="4%"> | |
227 <img src="', $settings[$context['icon_sources'][$topic['first_post']['icon']]], '/post/', $topic['first_post']['icon'], '.gif" alt="" border="0" align="middle" /></td> | |
228 <td class="windowbg" valign="middle" width="48%"> | |
229 ', $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> | |
230 <div class="smalltext"><i>', $txt['smf88'], ' ', $topic['board']['link'], '</i></div></td> | |
231 <td class="windowbg2" valign="middle" width="14%"> | |
232 ', $topic['first_post']['member']['link'], '</td> | |
233 <td class="windowbg" valign="middle" width="4%" align="center"> | |
234 ', $topic['replies'], '</td> | |
235 <td class="windowbg" valign="middle" width="4%" align="center"> | |
236 ', $topic['views'], '</td> | |
237 <td class="windowbg2" valign="middle" width="27%"> | |
238 <span class="smalltext">', $topic['last_post']['time'], '<br />', $txt[525], ' ', $topic['last_post']['member']['link'], '</span></td> | |
239 </tr>'; | |
240 } | |
241 | |
242 echo ' | |
243 </table> | |
244 | |
245 <div style="padding: 1px;" class="bordercolor"> | |
246 <table width="100%" cellpadding="4" cellspacing="0" border="0" class="catbg"> | |
247 <tr> | |
248 <td valign="middle"><b>', $txt[139], ':</b> ', $context['page_index'], '</td> | |
249 <td align="right" nowrap="nowrap" style="font-size: smaller;">'; | |
250 | |
251 if (isset($context['topics_to_mark']) && !empty($settings['show_mark_read'])) | |
252 echo ' | |
253 <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>'; | |
254 | |
255 echo ' | |
256 </td> | |
257 </tr> | |
258 </table> | |
259 </div> | |
260 </td></tr> | |
261 </table> | |
262 | |
263 <table cellpadding="0" cellspacing="0" width="55%"> | |
264 <tr> | |
265 <td class="smalltext" align="left" style="padding-top: 1ex;"> | |
266 <img src="', $settings['images_url'], '/topic/my_normal_post.gif" alt="" align="middle" /> ', $txt[457], '<br /> | |
267 <img src="', $settings['images_url'], '/topic/my_hot_post.gif" alt="" align="middle" /> ', $txt[454], '<br /> | |
268 <img src="', $settings['images_url'], '/topic/my_veryhot_post.gif" alt="" align="middle" /> ', $txt[455], ' | |
269 </td> | |
270 <td class="smalltext" align="left" valign="top" style="padding-top: 1ex;"> | |
271 <img src="', $settings['images_url'], '/topic/my_normal_post_locked.gif" alt="" align="middle" /> ', $txt[456], '<br />', $modSettings['enableStickyTopics'] == '1' ? ' | |
272 <img src="' . $settings['images_url'] . '/topic/my_normal_post_sticky.gif" alt="" align="middle" /> ' . $txt['smf96'] . '<br />' : '', $modSettings['pollMode'] == '1' ? ' | |
273 <img src="' . $settings['images_url'] . '/topic/my_normal_poll.gif" alt="" align="middle" /> ' . $txt['smf43'] : '', ' | |
274 </td> | |
275 </tr> | |
276 </table>'; | |
277 } | |
278 | |
279 ?> |