Uutiset:

SMF 2.1.4 has been released! Take it for a spin! Read more.

Main Menu
Advertisement:

Linktree in Thread view Question

Aloittaja Biology Forums, elokuu 10, 2011, 12:06:29 AP

« edellinen - seuraava »

Biology Forums

Hi,

I would like to know how to remove the Website title name and the thread title from the link tree that's found in the topic view;

I.e. Currently

Biology Forums - For All Your Science Needs > Homework Help (University / College Level) > Anatomy and Physiology > Human Anatomy & Physiology 1 Lab Exercise 3

I want to Truncate this to:

Homework Help (University / College Level) > Anatomy and Physiology

Sir Osis of Liver


You can remove the topic title in /Sources/Display.php by commenting out this:



// Build the link tree.
$context['linktree'][] = array(
'url' => $scripturl . '?topic=' . $topic . '.0',
'name' => $topicinfo['subject'],
'extra_before' => $settings['linktree_inline'] ? $txt['topic'] . ': ' : ''
);




It only affects the linktree in the post display.   I think you'd have to modify the theme_linktree() function to eliminate the forum title (can't find it), and it would affect the linktree everywhere.

When in Emor, do as the Snamors.
                              - D. Lister


Sir Osis of Liver


If you delete the forum title in Admin -> Server Settings it removes it from the linktree.  The hack I posted above will remove the topic name.  If you need something more elaborate, you can edit the theme_linktree() function in index.template.php here -



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

echo '<div class="nav" style="font-size: smaller; margin-bottom: 2ex; margin-top: 2ex;">';

// Each tree item has a URL and name. Some may have extra_before and extra_after.
foreach ($context['linktree'] as $link_num => $tree)
{
// Show something before the link?
if (isset($tree['extra_before']))
echo $tree['extra_before'];

// Show the link, including a URL if it should have one.
echo '<b>', $settings['linktree_link'] && isset($tree['url']) ? '<a href="' . $tree['url'] . '" class="nav">' . $tree['name'] . '</a>' : $tree['name'], '</b>';

// Show something after the link...?
if (isset($tree['extra_after']))
echo $tree['extra_after'];

// Don't show a separator for the last one.
if ($link_num != count($context['linktree']) - 1)
echo '&nbsp;>&nbsp;';
}

echo '</div>';
}


When in Emor, do as the Snamors.
                              - D. Lister

Biology Forums

LainaaIf you delete the forum title in Admin -> Server Settings it removes it from the linktree.  The hack I posted above will remove the topic name.  If you need something more elaborate, you can edit the theme_linktree() function in index.template.php here -

Thanks for the suggestion, but commenting out that code actually worked while in thread view, but not while in post view, I wanted it gone in both. Crap.

Sir Osis of Liver

In /Sources/Post.php -



// Build the link tree.
// if (empty($topic))
// $context['linktree'][] = array(
// 'name' => '<i>' . $txt[33] . '</i>'
// );
// else
// $context['linktree'][] = array(
// 'url' => $scripturl . '?topic=' . $topic . '.' . $_REQUEST['start'],
// 'name' => $form_subject,
// 'extra_before' => '<span' . ($settings['linktree_inline'] ? ' class="smalltext"' : '') . '><b class="nav">' . $context['page_title'] . ' ( </b></span>',
// 'extra_after' => '<span' . ($settings['linktree_inline'] ? ' class="smalltext"' : '') . '><b class="nav"> )</b></span>'
// );


When in Emor, do as the Snamors.
                              - D. Lister


Advertisement: