Simple Machines Community Forum

General Community => Scripting Help => Aiheen aloitti: fahoo16 - kesäkuu 30, 2007, 11:31:11 IP

Otsikko: How to insert Link tree H1 Tags
Kirjoitti: fahoo16 - kesäkuu 30, 2007, 11:31:11 IP
Hi

I used below code to insert H1 tags to my forum (in index.template.php replace the theme_linktree() function with this one.). It really works. But H1 tag wasn't display in last url (page tital).


function theme_linktree()
{



global $context, $settings, $options;
    //print_r($context);



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.





if (!empty($context['current_topic']))





&nbsp; {





&nbsp; &nbsp; &nbsp; echo '<b>', $settings['linktree_link'] && isset($tree['url']) ? '<a href="' . $tree['url'] . '" class="nav">' . $tree['name'] . '</a>' : $tree['name'], '</b>';





&nbsp; }





else





&nbsp; {





&nbsp; if ($link_num != count($context['linktree']) - 1) {
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; echo '<b>', $settings['linktree_link'] && isset($tree['url']) ? '<a href="' . $tree['url'] . '" class="nav">' . $tree['name'] . '</a>' : $tree['name'], '</b>';





&nbsp; &nbsp; &nbsp; } else {





&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; echo "</div>\n<h1>" . $tree['name'] . "</h1>\n";





&nbsp; &nbsp; &nbsp; }





&nbsp; }





// Show something after the link...?





if (isset($tree['extra_after']))







echo $tree['extra_after'];





// Don't show a separator for the last one.





if (!empty($context['current_topic'])) {





&nbsp; if ($link_num != count($context['linktree']) - 1)



echo '&nbsp;&raquo;&nbsp;';





} else {
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if (($link_num != count($context['linktree']) - 1) && ($link_num != count($context['linktree']) - 2))



echo '&nbsp;&raquo;&nbsp;';





}



}
&nbsp; &nbsp; if (!empty($context['current_topic'])) echo '</div>';
}


I need to insert H1 tag in last topic url also. Pls help.

You can refer using www.openguys.org/forum (http://www.openguys.org/forum)
Otsikko: Re: How to insert Link tree H1 Tags
Kirjoitti: fahoo16 - heinäkuu 07, 2007, 11:31:50 IP
ANY NEWS ???