Uutiset:

Bored?  Looking to kill some time?  Want to chat with other SMF users?  Join us in IRC chat or Discord

Main Menu
Advertisement:

Creating vB styled tree links.

Aloittaja Nidoking, helmikuu 25, 2005, 09:25:00 IP

« edellinen - seuraava »

Nidoking

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.

Oldiesmann

You'd need to modify the theme_linktree() function in index.template.php.
Michael Eshom
Christian Metal Fans

bloc

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>';
}

Advertisement: