News:

SMF 2.0.19 has been released! Please update. Read more.

Main Menu

[TIP/TRICK] New Layout for "Replies / Views"

Started by Venera, August 15, 2013, 01:54:47 PM

Previous topic - Next topic

Venera

Hi,
I suggest a small change of default theme. It's not neccessary to repeat "Replies/Views" in the whole table with themes on Child bord, "Show unread posts sincce last visit" and "Show new replies to your posts" if it is in header of the tables yet. I put both old and new version, so you can see the difference between them and how much more is new version simply and elegant. ;)

Child Boards:

OLD                                          NEW
   

The following changes have to be done in message.template.php:


Find: <td class="stats ', $color_class, '">
', $topic['replies'], ' ', $txt['replies'], '
<br />
', $topic['views'], ' ', $txt['views'], '
</td>



Replace with:
<td class="stats ', $color_class, '">
', $topic['replies'], ' / ', $topic['views'], '
</td>


"Show unread posts sincce last visit" and "Show new replies to your posts":

OLD                                        NEW
   



In recent.template.php have be done changes because "/ Views" in header of the table are missing in

"Show unread posts since last visit":


Find: </th>
<th scope="col" width="14%" 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['replies'], $context['sort_by'] == 'replies' ? ' <img src="' . $settings['images_url'] . '/sort_' . $context['sort_direction'] . '.gif" alt="" />' : '', '</a>
</th>';


Replace with: </th>
<th scope="col" width="14%" 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['replies'], $context['sort_by'] == 'replies' ? ' <img src="' . $settings['images_url'] . '/sort_' . $context['sort_direction'] . '.gif" alt="" />' : '', '</a> /
<a href="', $scripturl, '?action=unread', $context['showing_all_topics'] ? ';all' : '', $context['querystring_board_limits'], ';sort=replies', $context['sort_by'] == 'views' && $context['sort_direction'] == 'up' ? ';desc' : '', '">', $txt['views'], $context['sort_by'] == 'views' ? ' <img src="' . $settings['images_url'] . '/sort_' . $context['sort_direction'] . '.gif" alt="" />' : '', '</a>
</th>';



and "Show new replies to your posts":

Find: </th>
<th scope="col" width="14%" align="center">
<a href="', $scripturl, '?action=unreadreplies', $context['querystring_board_limits'], ';sort=replies', $context['sort_by'] === 'replies' && $context['sort_direction'] === 'up' ? ';desc' : '', '">', $txt['replies'], $context['sort_by'] === 'replies' ? ' <img src="' . $settings['images_url'] . '/sort_' . $context['sort_direction'] . '.gif" alt="" />' : '', '</a>
</th>';



Reblice with: </th>
<th scope="col" width="14%" align="center">
<a href="', $scripturl, '?action=unreadreplies', $context['querystring_board_limits'], ';sort=replies', $context['sort_by'] === 'replies' && $context['sort_direction'] === 'up' ? ';desc' : '', '">', $txt['replies'], $context['sort_by'] === 'replies' ? ' <img src="' . $settings['images_url'] . '/sort_' . $context['sort_direction'] . '.gif" alt="" />' : '', '</a> /
<a href="', $scripturl, '?action=unreadreplies', $context['querystring_board_limits'], ';sort=replies', $context['sort_by'] === views' && $context['sort_direction'] === 'up' ? ';desc' : '', '">', $txt['views'], $context['sort_by'] === 'views' ? ' <img src="' . $settings['images_url'] . '/sort_' . $context['sort_direction'] . '.gif" alt="" />' : '', '</a>
</th>';



... and make the same changes in two places in recent.template.php:
1st place for "Show unread posts sincce last visit"
2nd place for "Show new replies to your posts"

Find: </td>
<td class="', $color_class, ' stats windowbg">
', $topic['replies'], ' ', $txt['replies'], '
<br />
', $topic['views'], ' ', $txt['views'], '
</td>



Replace with: </td>
<td class="', $color_class, ' stats windowbg">
', $topic['replies'], ' / ', $topic['views'], '
</td>




:) Best regards for all and sorry for Englesh. :)

Shambles

Sounds an ideal candidate for the Tips & Tricks section ;)

Venera



Dzonny



Venera


Advertisement: