annotate 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
rev   line source
Chris@76 1 <?php
Chris@76 2 // Version: 1.1.9; Recent
Chris@76 3
Chris@76 4 function template_main()
Chris@76 5 {
Chris@76 6 global $context, $settings, $options, $txt, $scripturl;
Chris@76 7
Chris@76 8 echo '
Chris@76 9 <div style="padding: 3px;">', theme_linktree(), '</div>
Chris@76 10 <table width="100%" cellpadding="3" cellspacing="0" border="0" class="tborder">
Chris@76 11 <tr>
Chris@76 12 <td align="left" class="catbg" width="100%" height="30">
Chris@76 13 <b>', $txt[139], ':</b> ', $context['page_index'], '
Chris@76 14 </td>
Chris@76 15 </tr>
Chris@76 16 </table>
Chris@76 17 <br />';
Chris@76 18
Chris@76 19 foreach ($context['posts'] as $post)
Chris@76 20 {
Chris@76 21 echo '
Chris@76 22 <table width="100%" cellpadding="4" cellspacing="1" border="0" class="bordercolor">
Chris@76 23 <tr class="titlebg">
Chris@76 24 <td>
Chris@76 25 <div style="float: left; width: 3ex;">&nbsp;', $post['counter'], '&nbsp;</div>
Chris@76 26 <div style="float: left;">&nbsp;', $post['category']['link'], ' / ', $post['board']['link'], ' / ', $post['link'], '</div>
Chris@76 27 <div align="right">&nbsp;', $txt[30], ': ', $post['time'], '&nbsp;</div>
Chris@76 28 </td>
Chris@76 29 </tr>
Chris@76 30 <tr>
Chris@76 31 <td class="catbg" colspan="3">
Chris@76 32 ', $txt[109], ' ', $post['first_poster']['link'], ' - ', $txt[22], ' ', $txt[525], ' ', $post['poster']['link'], '
Chris@76 33 </td>
Chris@76 34 </tr>
Chris@76 35 <tr>
Chris@76 36 <td class="windowbg2" colspan="3" valign="top" height="40">
Chris@76 37 <div class="post">', $post['message'], '</div>
Chris@76 38 </td>
Chris@76 39 </tr>
Chris@76 40 <tr>
Chris@76 41 <td class="catbg" colspan="3" align="right">';
Chris@76 42
Chris@76 43 if ($post['can_delete'])
Chris@76 44 echo '
Chris@76 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>';
Chris@76 46 if ($post['can_delete'] && ($post['can_mark_notify'] || $post['can_reply']))
Chris@76 47 echo '
Chris@76 48 ', $context['menu_separator'];
Chris@76 49 if ($post['can_reply'])
Chris@76 50 echo '
Chris@76 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'], '
Chris@76 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>';
Chris@76 53 if ($post['can_reply'] && $post['can_mark_notify'])
Chris@76 54 echo '
Chris@76 55 ', $context['menu_separator'];
Chris@76 56 if ($post['can_mark_notify'])
Chris@76 57 echo '
Chris@76 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>';
Chris@76 59
Chris@76 60 echo '</td>
Chris@76 61 </tr>
Chris@76 62 </table>
Chris@76 63 <br />';
Chris@76 64 }
Chris@76 65
Chris@76 66 echo '
Chris@76 67 <table width="100%" cellpadding="3" cellspacing="0" border="0" class="tborder">
Chris@76 68 <tr>
Chris@76 69 <td align="left" class="catbg" width="100%" height="30">
Chris@76 70 <b>', $txt[139], ':</b> ', $context['page_index'], '
Chris@76 71 </td>
Chris@76 72 </tr>
Chris@76 73 </table>';
Chris@76 74 if ($settings['linktree_inline'])
Chris@76 75 echo '
Chris@76 76 <div style="padding: 3px;">', theme_linktree(), '</div>';
Chris@76 77 }
Chris@76 78
Chris@76 79 function template_unread()
Chris@76 80 {
Chris@76 81 global $context, $settings, $options, $txt, $scripturl, $modSettings;
Chris@76 82
Chris@76 83 echo '
Chris@76 84 <table width="100%" border="0" cellspacing="0" cellpadding="3">
Chris@76 85 <tr>
Chris@76 86 <td>', theme_linktree(), '</td>
Chris@76 87 </tr>
Chris@76 88 </table>
Chris@76 89
Chris@76 90 <table width="100%" cellpadding="0" cellspacing="0" border="0" class="bordercolor">
Chris@76 91 <tr><td>
Chris@76 92 <div style="padding: 1px;" class="bordercolor">
Chris@76 93 <table width="100%" cellpadding="4" cellspacing="0" border="0" class="catbg">
Chris@76 94 <tr>
Chris@76 95 <td valign="middle"><b>', $txt[139], ':</b> ', $context['page_index'], '</td>', $settings['show_mark_read'] ? '
Chris@76 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>' : '', '
Chris@76 97 </tr>
Chris@76 98 </table>
Chris@76 99 </div>
Chris@76 100
Chris@76 101 <table border="0" width="100%" cellspacing="1" cellpadding="4" class="bordercolor">
Chris@76 102 <tr class="titlebg">';
Chris@76 103 if (!empty($context['topics']))
Chris@76 104 echo '
Chris@76 105 <td width="10%" colspan="2">&nbsp;</td>
Chris@76 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>
Chris@76 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>
Chris@76 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>
Chris@76 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>
Chris@76 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>';
Chris@76 111 else
Chris@76 112 echo '
Chris@76 113 <td width="100%" colspan="7">', $context['showing_all_topics'] ? $txt[151] : $txt['unread_topics_visit_none'], '</td>';
Chris@76 114 echo '
Chris@76 115 </tr>';
Chris@76 116
Chris@76 117 foreach ($context['topics'] as $topic)
Chris@76 118 {
Chris@76 119 echo '
Chris@76 120 <tr>
Chris@76 121 <td class="windowbg2" valign="middle" align="center" width="6%">
Chris@76 122 <img src="', $settings['images_url'], '/topic/', $topic['class'], '.gif" alt="" /></td>
Chris@76 123 <td class="windowbg2" valign="middle" align="center" width="4%">
Chris@76 124 <img src="', $settings[$context['icon_sources'][$topic['first_post']['icon']]], '/post/', $topic['first_post']['icon'], '.gif" alt="" border="0" align="middle" /></td>
Chris@76 125 <td class="windowbg" valign="middle" width="48%">
Chris@76 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>
Chris@76 127 <div class="smalltext"><i>', $txt['smf88'], ' ', $topic['board']['link'], '</i></div></td>
Chris@76 128 <td class="windowbg2" valign="middle" width="14%">
Chris@76 129 ', $topic['first_post']['member']['link'], '</td>
Chris@76 130 <td class="windowbg" valign="middle" width="4%" align="center">
Chris@76 131 ', $topic['replies'], '</td>
Chris@76 132 <td class="windowbg" valign="middle" width="4%" align="center">
Chris@76 133 ', $topic['views'] . '</td>
Chris@76 134 <td class="windowbg2" valign="middle" width="27%">
Chris@76 135 <span class="smalltext">
Chris@76 136 ', $topic['last_post']['time'], '<br />
Chris@76 137 ', $txt[525], ' ', $topic['last_post']['member']['link'], '
Chris@76 138 </span></td>
Chris@76 139 </tr>';
Chris@76 140 }
Chris@76 141
Chris@76 142 if (!empty($context['topics']) && !$context['showing_all_topics'])
Chris@76 143 echo '
Chris@76 144 <tr class="titlebg">
Chris@76 145 <td colspan="7" align="right"><a href="', $scripturl, '?action=unread;all', $context['querystring_board_limits'], '">', $txt['unread_topics_all'], '</a></td>
Chris@76 146 </tr>';
Chris@76 147
Chris@76 148 echo '
Chris@76 149 </table>
Chris@76 150
Chris@76 151 <div style="padding: 1px;" class="bordercolor">
Chris@76 152 <table width="100%" cellpadding="4" cellspacing="0" border="0" class="catbg">
Chris@76 153 <tr>
Chris@76 154 <td valign="middle"><b>', $txt[139], ':</b> ', $context['page_index'], '</td>', $settings['show_mark_read'] ? '
Chris@76 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>' : '', '
Chris@76 156 </tr>
Chris@76 157 </table>
Chris@76 158 </div>
Chris@76 159 </td></tr>
Chris@76 160 </table>
Chris@76 161 <table cellpadding="0" cellspacing="0" width="55%">
Chris@76 162 <tr>
Chris@76 163 <td class="smalltext" align="left" style="padding-top: 1ex;">', !empty($modSettings['enableParticipation']) ? '
Chris@76 164 <img src="' . $settings['images_url'] . '/topic/my_normal_post.gif" alt="" align="middle" /> ' . $txt['participation_caption'] . '<br />' : '', '
Chris@76 165 <img src="' . $settings['images_url'] . '/topic/normal_post.gif" alt="" align="middle" /> ' . $txt[457] . '<br />
Chris@76 166 <img src="' . $settings['images_url'] . '/topic/hot_post.gif" alt="" align="middle" /> ' . $txt[454] . '<br />
Chris@76 167 <img src="' . $settings['images_url'] . '/topic/veryhot_post.gif" alt="" align="middle" /> ' . $txt[455] . '
Chris@76 168 </td>
Chris@76 169 <td class="smalltext" align="left" valign="top" style="padding-top: 1ex;">
Chris@76 170 <img src="' . $settings['images_url'] . '/topic/normal_post_locked.gif" alt="" align="middle" /> ' . $txt[456] . '<br />' . ($modSettings['enableStickyTopics'] == '1' ? '
Chris@76 171 <img src="' . $settings['images_url'] . '/topic/normal_post_sticky.gif" alt="" align="middle" /> ' . $txt['smf96'] . '<br />' : '') . ($modSettings['pollMode'] == '1' ? '
Chris@76 172 <img src="' . $settings['images_url'] . '/topic/normal_poll.gif" alt="" align="middle" /> ' . $txt['smf43'] : '') . '
Chris@76 173 </td>
Chris@76 174 </tr>
Chris@76 175 </table>';
Chris@76 176 }
Chris@76 177
Chris@76 178 function template_replies()
Chris@76 179 {
Chris@76 180 global $context, $settings, $options, $txt, $scripturl, $modSettings;
Chris@76 181
Chris@76 182 echo '
Chris@76 183 <table width="100%" border="0" cellspacing="0" cellpadding="3" align="center">
Chris@76 184 <tr>
Chris@76 185 <td>', theme_linktree(), '</td>
Chris@76 186 </tr>
Chris@76 187 </table>
Chris@76 188 <table border="0" width="100%" cellspacing="0" cellpadding="0" class="bordercolor">
Chris@76 189 <tr><td>
Chris@76 190 <div style="padding: 1px;" class="bordercolor">
Chris@76 191 <table width="100%" cellpadding="4" cellspacing="0" border="0" class="catbg">
Chris@76 192 <tr>
Chris@76 193 <td valign="middle"><b>' . $txt[139] . ':</b> ' . $context['page_index'] . '</td>
Chris@76 194 <td align="right" nowrap="nowrap" style="font-size: smaller;">';
Chris@76 195 if (isset($context['topics_to_mark']) && !empty($settings['show_mark_read']))
Chris@76 196 echo '
Chris@76 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>';
Chris@76 198 echo '
Chris@76 199 </td>
Chris@76 200 </tr>
Chris@76 201 </table>
Chris@76 202 </div>
Chris@76 203
Chris@76 204 <table border="0" width="100%" cellspacing="1" cellpadding="4" class="bordercolor">
Chris@76 205 <tr class="titlebg">';
Chris@76 206 if (!empty($context['topics']))
Chris@76 207 echo '
Chris@76 208 <td width="10%" colspan="2">&nbsp;</td>
Chris@76 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>
Chris@76 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>
Chris@76 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>
Chris@76 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>
Chris@76 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>';
Chris@76 214 else
Chris@76 215 echo '
Chris@76 216 <td width="100%" colspan="7">' . $txt[151] . '</td>';
Chris@76 217 echo '
Chris@76 218 </tr>';
Chris@76 219
Chris@76 220 foreach ($context['topics'] as $topic)
Chris@76 221 {
Chris@76 222 echo '
Chris@76 223 <tr>
Chris@76 224 <td class="windowbg2" valign="middle" align="center" width="6%">
Chris@76 225 <img src="', $settings['images_url'], '/topic/', $topic['class'], '.gif" alt="" /></td>
Chris@76 226 <td class="windowbg2" valign="middle" align="center" width="4%">
Chris@76 227 <img src="', $settings[$context['icon_sources'][$topic['first_post']['icon']]], '/post/', $topic['first_post']['icon'], '.gif" alt="" border="0" align="middle" /></td>
Chris@76 228 <td class="windowbg" valign="middle" width="48%">
Chris@76 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>
Chris@76 230 <div class="smalltext"><i>', $txt['smf88'], ' ', $topic['board']['link'], '</i></div></td>
Chris@76 231 <td class="windowbg2" valign="middle" width="14%">
Chris@76 232 ', $topic['first_post']['member']['link'], '</td>
Chris@76 233 <td class="windowbg" valign="middle" width="4%" align="center">
Chris@76 234 ', $topic['replies'], '</td>
Chris@76 235 <td class="windowbg" valign="middle" width="4%" align="center">
Chris@76 236 ', $topic['views'], '</td>
Chris@76 237 <td class="windowbg2" valign="middle" width="27%">
Chris@76 238 <span class="smalltext">', $topic['last_post']['time'], '<br />', $txt[525], ' ', $topic['last_post']['member']['link'], '</span></td>
Chris@76 239 </tr>';
Chris@76 240 }
Chris@76 241
Chris@76 242 echo '
Chris@76 243 </table>
Chris@76 244
Chris@76 245 <div style="padding: 1px;" class="bordercolor">
Chris@76 246 <table width="100%" cellpadding="4" cellspacing="0" border="0" class="catbg">
Chris@76 247 <tr>
Chris@76 248 <td valign="middle"><b>', $txt[139], ':</b> ', $context['page_index'], '</td>
Chris@76 249 <td align="right" nowrap="nowrap" style="font-size: smaller;">';
Chris@76 250
Chris@76 251 if (isset($context['topics_to_mark']) && !empty($settings['show_mark_read']))
Chris@76 252 echo '
Chris@76 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>';
Chris@76 254
Chris@76 255 echo '
Chris@76 256 </td>
Chris@76 257 </tr>
Chris@76 258 </table>
Chris@76 259 </div>
Chris@76 260 </td></tr>
Chris@76 261 </table>
Chris@76 262
Chris@76 263 <table cellpadding="0" cellspacing="0" width="55%">
Chris@76 264 <tr>
Chris@76 265 <td class="smalltext" align="left" style="padding-top: 1ex;">
Chris@76 266 <img src="', $settings['images_url'], '/topic/my_normal_post.gif" alt="" align="middle" /> ', $txt[457], '<br />
Chris@76 267 <img src="', $settings['images_url'], '/topic/my_hot_post.gif" alt="" align="middle" /> ', $txt[454], '<br />
Chris@76 268 <img src="', $settings['images_url'], '/topic/my_veryhot_post.gif" alt="" align="middle" /> ', $txt[455], '
Chris@76 269 </td>
Chris@76 270 <td class="smalltext" align="left" valign="top" style="padding-top: 1ex;">
Chris@76 271 <img src="', $settings['images_url'], '/topic/my_normal_post_locked.gif" alt="" align="middle" /> ', $txt[456], '<br />', $modSettings['enableStickyTopics'] == '1' ? '
Chris@76 272 <img src="' . $settings['images_url'] . '/topic/my_normal_post_sticky.gif" alt="" align="middle" /> ' . $txt['smf96'] . '<br />' : '', $modSettings['pollMode'] == '1' ? '
Chris@76 273 <img src="' . $settings['images_url'] . '/topic/my_normal_poll.gif" alt="" align="middle" /> ' . $txt['smf43'] : '', '
Chris@76 274 </td>
Chris@76 275 </tr>
Chris@76 276 </table>';
Chris@76 277 }
Chris@76 278
Chris@76 279 ?>