Simple Machines Community Forum

SMF Support => SMF 1.1.x Support => Aiheen aloitti: Nidoking - helmikuu 25, 2005, 09:25:00 IP

Otsikko: Creating vB styled tree links.
Kirjoitti: Nidoking - helmikuu 25, 2005, 09:25:00 IP
How can I modify the tree links so they are styled like vB's?

EXAMPLE
Category > Forum
|_Thread

Note that the category and forum would be hyperlinked, but the thread would not. And, of course, the italicized parts would be fully editable.
Otsikko: Re: Creating vB styled tree links.
Kirjoitti: Oldiesmann - helmikuu 26, 2005, 12:53:27 IP
You'd need to modify the theme_linktree() function in index.template.php.
Otsikko: Re: Creating vB styled tree links.
Kirjoitti: bloc - helmikuu 27, 2005, 03:03:13 AP
I did some time ago something you might be able to use...

Haven't tested it extensively - so if it contains errors, let me know.

// Show a linktree.  This is that thing that shows "My Community | General Category | General Discussion"..
function theme_linktree()
{
        global $context, $settings, $options;

        // Folder style or inline?  Inline has a smaller font.
         echo '<span style="font-family: tahoma; text-align: left;"><img align="absmiddle" src="' . $settings['images_url'] . '/icons/folder_open.gif" alt="+" border="0" />&nbsp;<b>';
        // Each tree item has a URL and name.  Some may have extra_before and extra_after.
        foreach ($context['linktree'] as $link_num => $tree)
        {


                // Don't show a separator for the last one.
                if ($link_num != count($context['linktree']) - 1)
                // Show the link, including a URL if it should have one.
                       echo  isset($tree['url']) ? '<a href="' . $tree['url'] . '" class="nav">' . $tree['name'] . '</a> > ' : $tree['name'].' > ';
                else
                       echo  isset($tree['url']) ? '<br /><img align="absmiddle" src="' . $settings['images_url'] . '/icons/folder_open2.gif" alt="+" border="0" />&nbsp;<a href="' . $tree['url'] . '" class="nav">' . $tree['name'] . '</a>' : '<br /><img src="' . $settings['images_url'] . '/icons/folder_open2.gif" alt="+" border="0" />&nbsp;'.$tree['name'];

        }

        echo '</b></span>';
}