Simple Machines Community Forum

Customizing SMF => Tips and Tricks => Topic started by: Ivan Minic on February 12, 2006, 09:49:25 PM

Title: Showing number of posts/topics next to child boards in 1.0.x
Post by: Ivan Minic on February 12, 2006, 09:49:25 PM
Open: BoardIndex.template.php

Find:
// Show the "Child Boards: ". (there's a link_children but we're going to bold the new ones...)
if (!empty($board['children']))
{
// Sort the links into an array with new boards bold so it can be imploded.
$children = array();
/* Each child in each board's children has:
id, name, description, new (is it new?), topics (#), posts (#), href, link, and last_post. */
foreach ($board['children'] as $child)
{
$child['link'] = '<a href="' . $child['href'] . '" title="' . ($child['new'] ? $txt[333] : $txt[334]) . ' (' . $txt[330] . ': ' . $child['topics'] . ', ' . $txt[21] . ': ' . $child['posts'] . ')">' . $child['name'] . '</a>';
$children[] = $child['new'] ? '<b>' . $child['link'] . '</b>' : $child['link'];
}



Replace with:
// Show the "Child Boards: ". (there's a link_children but we're going to bold the new ones...)
if (!empty($board['children']))
{
// Sort the links into an array with new boards bold so it can be imploded.
$children = array();
/* Each child in each board's children has:
id, name, description, new (is it new?), topics (#), posts (#), href, link, and last_post. */
foreach ($board['children'] as $child)
{
$child['name'] = $child['new'] ? '<font color="#800000">' . $child['name'] . '</font>' : $child['name'];
$child['link'] = $child['new'] ? '<a href="' . $child['href'] . '" title="' . ($txt[333]) . ' (' . $txt[330] . ': ' . $child['topics'] . ', ' . $txt[21] . ': ' . $child['posts'] . ')"><img src="' .  $settings['images_url'] . '/subfo-on.gif" alt="' . $txt[333] . '" title="' . $txt[333] . '" border="0" /></a> <a href="' . $child['href'] . '" title="' . ($txt[333]) . ' (' . $txt[330] . ': ' .  $child['topics'] . ', ' . $txt[21] . ': ' . $child['posts'] . ')"><b>' . $child['name'] . '</b></a> [' . $txt['21'] . ' ' . $child['posts'] . ' ' . $txt['smf88'] . ' ' . $child['topics'] . ' ' . $txt[330]  .']' : '<a href="' . $child['href'] . '" title="' . ($txt[334]) . ' (' . $txt[330] . ' : ' . $child['topics'] . ', ' . $txt[21] . ': ' . $child['posts'] . ')"><img src="' . $settings['images_url'] .  '/subfo-off.gif" alt="' . $txt[334] . '" title="' . $txt[334] . '" border="0" /></a> <a href="' . $child['href'] . '" title="' . ($txt[334]) . ' (' . $txt[330] . ' : ' . $child['topics'] . ', ' .  $txt[21] . ': ' . $child['posts'] . ')"><b>' . $child['name'] . '</b></a> [' . $txt['21'] . ' ' . $child['posts'] . ' ' . $txt['smf88'] . ' ' . $child['topics'] . ' ' . $txt[330] .']';
$children[] = $child['link'];
}


And that will result in:
(http://img95.imageshack.us/img95/8185/skren2hg.png)
Translation is serbian and screenshot is from Burek Forum (http://forum.burek.co.yu), it will be shown correct on your board with language you use
Title: Re: Showing number of posts/topics next to child boards in 1.0.x
Post by: Klozi on March 19, 2006, 01:47:08 PM
Hi.

Very well, I gonna need it next time.


Cheers
Title: Re: Showing number of posts/topics next to child boards in 1.0.x
Post by: ArkServer on March 20, 2006, 02:16:26 PM
How come it says:
Child Boards: No New Posts  tho its working.
http://arkserver.servehttp.com/index.php
Title: Re: Showing number of posts/topics next to child boards in 1.0.x
Post by: Klozi on March 20, 2006, 02:48:21 PM
Hi.

search for the <img> tag. You can take changes what ever you want to do.


Cheers
Title: Re: Showing number of posts/topics next to child boards in 1.0.x
Post by: Harvester on March 24, 2006, 06:11:25 AM
I think it works for me but I dont have the images it needs... subfo-on.gif and subfo-off.gif
I could make them myself I am pretty sure BUT I have no idea what they should look like.
Title: Re: Showing number of posts/topics next to child boards in 1.0.x
Post by: DJINN on July 21, 2006, 06:47:39 PM
What I need to do to put image instead "No new posts"?
Title: Re: Showing number of posts/topics next to child boards in 1.0.x
Post by: DJINN on July 24, 2006, 11:58:05 AM
I find what was the problem, I didn't have images uploaded.
Title: Re: Showing number of posts/topics next to child boards in 1.0.x
Post by: TechnoDragon on July 25, 2006, 06:24:32 PM
Here are two images i made...very simple ones....(http://forum.technodragon.net/Themes/Storage/images/subfo-off.gif) & (http://forum.technodragon.net/Themes/Storage/images/subfo-on.gif)
Title: Re: Showing number of posts/topics next to child boards in 1.0.x
Post by: DJINN on July 26, 2006, 02:44:50 PM
very nice
Title: Re: Showing number of posts/topics next to child boards in 1.0.x
Post by: L.G.S on August 18, 2006, 04:53:09 PM
Any chance of having this cool tip for 1.1RC2 please?
Title: Re: Showing number of posts/topics next to child boards in 1.0.x
Post by: TechnoDragon on August 19, 2006, 01:09:27 AM
That is what I have this installed on...RC2
Title: Re: Showing number of posts/topics next to child boards in 1.0.x
Post by: Michael D. Garcia on May 02, 2007, 10:41:42 PM
I've applied this mod to 1.1.2 and it works fine.

MDg