Simple Machines Community Forum

Customizing SMF => SMF Coding Discussion => Topic started by: gebekzor on November 11, 2011, 09:24:23 AM

Title: modify linktree
Post by: gebekzor on November 11, 2011, 09:24:23 AM
It is possible to modify linktree of this:

(http://gamebite.pl/przed.png)
on that?
(http://gamebite.pl/po.png)

change ". $ context ['forum_name']. in the image and remove the board link
Title: Re: modify linktree
Post by: MrPhil on November 12, 2011, 09:41:52 AM
It should be possible. Look for and modify all the theme_linktree() functions in your Themes. I think there's a $link_num or something similarly named counting the links from left (0) to right. It looks like you want to replace the text entry (name) for $link_num == 0, within the <a> tag, with an image instead of the text. Something like
Code: [Select]
if ($link_num == 0) {
   echo '<a blah blah><img src='blah blah home icon' /></a>';  // image for home link
} else {
   echo '<a blah blah.......';  // regular code for all other links
}
You may have to tweak the CSS to fit your icon in that line.

Then it looks like you simply want to skip the entire $link_num == 1 link. For that, at the top of the loop, just something like
Code: [Select]
if ($link_num == 1) continue;should work.
Title: Re: modify linktree
Post by: Matthew K. on November 12, 2011, 10:33:34 AM
Either something like MrPhil suggested, or you can modify the base linktree (which should be in Load.php)
Title: Re: modify linktree
Post by: gebekzor on November 12, 2011, 05:13:29 PM
It should be possible. Look for and modify all the theme_linktree() functions in your Themes. I think there's a $link_num or something similarly named counting the links from left (0) to right. It looks like you want to replace the text entry (name) for $link_num == 0, within the <a> tag, with an image instead of the text. Something like
Code: [Select]
if ($link_num == 0) {
   echo '<a blah blah><img src='blah blah home icon' /></a>';  // image for home link
} else {
   echo '<a blah blah.......';  // regular code for all other links
}
You may have to tweak the CSS to fit your icon in that line.

Then it looks like you simply want to skip the entire $link_num == 1 link. For that, at the top of the loop, just something like
Code: [Select]
if ($link_num == 1) continue;should work.

Thanks, works.
Title: Re: modify linktree
Post by: Matthew K. on November 12, 2011, 05:16:43 PM
Marking topic solved, glad you were able to get it done :)