Simple Machines Community Forum

Customizing SMF => Tips and Tricks => Thema gestartet von: Venera in August 15, 2013, 01:54:47 NACHMITTAGS

Titel: [TIP/TRICK] New Layout for "Replies / Views"
Beitrag von: Venera in August 15, 2013, 01:54:47 NACHMITTAGS
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. :)
Titel: Re: New Layout for "Replies / Views"
Beitrag von: Shambles in August 15, 2013, 04:20:29 NACHMITTAGS
Sounds an ideal candidate for the Tips & Tricks section ;)
Titel: Re: New Layout for "Replies / Views"
Beitrag von: Venera in August 16, 2013, 04:55:56 VORMITTAG
Zitat von: Shambles in August 15, 2013, 04:20:29 NACHMITTAGS
Sounds an ideal candidate for the Tips & Tricks section ;)

Thanks!  :)
Titel: Re: New Layout for "Replies / Views"
Beitrag von: kat in August 16, 2013, 06:37:38 VORMITTAG
Duly moved. :)
Titel: Re: New Layout for "Replies / Views"
Beitrag von: Dzonny in August 19, 2013, 05:26:08 VORMITTAG
Thanks for a nice tip Venera :)
Titel: Re: New Layout for "Replies / Views"
Beitrag von: greak in August 23, 2013, 09:19:31 NACHMITTAGS
nice tip
Titel: Re: New Layout for "Replies / Views"
Beitrag von: Venera in August 24, 2013, 01:32:23 VORMITTAG
Thanks K@, Dzonny and greak.  :)