Simple Machines Community Forum

Customizing SMF => Modifications and Packages => Topic started by: Informatics on February 14, 2008, 02:22:22 AM

Title: Link Tree
Post by: Informatics on February 14, 2008, 02:22:22 AM
Link to Mod

---------------------
Link Tree
|  By: CyclonBoy
|  http://if.web.id (http://if.web.id)
---------------------

Mod Information:
For SMF 1.1.x

This mod is used for changing our default conventional links looks like a tree.

There are 2 different effects with some settings at Current theme settings.
You can see one option in Current Settings, that is: Enable inline links

If you check this option, it will generates links tree appeared like on the first image.

Conversely, you will see the links tree like on the second image.

Thanx.

UPDATED INFOs - 29 August 2009
-------------------------------------------------

- Nothing changed on this mod.
- Its still compatible with SMF 1.1.4, 1.1.5, 1.1.6, 1.1.7, 1.1.8, 1.1.9, 1.1.10

v.1.1.0
---------
- Fix minor for enhancement
- This mod can be implemented for all theme

V.1.0.0
---------
- Release beta
- Just for default theme.
Title: Re: Link Tree
Post by: kangkenyot on February 14, 2008, 08:28:35 PM
thanks.
works well on my 1.1.4
Title: Re: Link Tree
Post by: Informatics on February 14, 2008, 10:03:47 PM
you're welcome my friend.
Title: Re: Link Tree
Post by: Sakae on February 14, 2008, 10:36:58 PM
Before I try, I should ask: It supposed to work with Pretty URLs modification?

Ok, I installed and works great. Ty.
Title: Re: Link Tree
Post by: Informatics on February 15, 2008, 01:46:26 AM
Thanx softcore for your comment.
I'm happy that this little mod would be clearly works and usefull for every1.
Title: Re: Link Tree
Post by: Informatics on February 16, 2008, 05:13:04 AM
Guys, this afternoon, i just reupload this mod v.1.1.0.
I change some code at mods information, because the last file i upload had false version, that is 1.0.0.

I've change it into v.1.1.0. You can re-download it
Title: Re: Link Tree
Post by: qtime on February 16, 2008, 05:24:26 PM
Thx, very simple installing and usefull on different themes, it makes the tree much clearer. Thanks for your work!
Title: Re: Link Tree
Post by: Informatics on February 17, 2008, 08:49:48 PM
thanx qtime for your feedback.
Title: Re: Link Tree
Post by: [Lucien] on February 18, 2008, 11:17:43 AM
Really cool mod, vbulletin style  :D
Using it right now, thanks a lot!  :)
Title: Re: Link Tree
Post by: Informatics on February 18, 2008, 08:00:06 PM
yeah soMzE, nice to know you like it. Have fun!
Title: Re: Link Tree
Post by: Nibogo on February 23, 2008, 05:14:39 PM
Is a very simple and a nice mod ;)
Title: Re: Link Tree
Post by: Informatics on February 24, 2008, 08:08:25 PM
thanx nibogo.
Title: Re: Link Tree
Post by: netridge on February 26, 2008, 06:21:58 PM
how do you make this mod work with another theme.
Title: Re: Link Tree
Post by: Informatics on February 27, 2008, 07:32:42 PM
The calling of the images file that put on the default theme by other theme.
Title: Re: Link Tree
Post by: netridge on February 27, 2008, 09:15:06 PM
I just ran it through the mod parser and added the code thanks.
Title: Re: Link Tree
Post by: Informatics on February 28, 2008, 01:36:08 AM
you're welcome mate.
Title: Re: Link Tree
Post by: Filipina on March 09, 2008, 11:38:26 AM
hello and thanks for the MOD.. for some reason it does not seem to be producing the effect as shown in the images... I am running the current default theme and Mod installed with no errors... here is what i got with and without Enable inline links box checked.  Am I missing something I need to change? Thanks

http://www.melindaspenpals.com/images/linktreeone.jpg

http://www.melindaspenpals.com/images/linktree2.jpg


Title: Re: Link Tree
Post by: Filipina on March 09, 2008, 04:43:00 PM
Please disregard my post it works fine... i somehow forgot the final step of applying the MOD... lol... sorry .. it works great by the way :)
Title: Re: Link Tree
Post by: Informatics on March 10, 2008, 11:08:34 PM
thanx Filipina or Melinda, nice site.
Title: Re: Link Tree
Post by: EagleTrades on March 12, 2008, 04:57:23 PM
Hello,

I am using DilberMC theme and have installed your mod.  After doing so I restarted the forum and noticed that the links are still displayed in a single line instead of using the Tree modification.  Can you tell me:

1. If a hack is required?
2. What the hack would be?
3. What file needs to be modified?

Thank you in advance.  I look forward to your reply.
Title: Re: Link Tree
Post by: Informatics on March 13, 2008, 09:41:42 PM
hi EagleTrades, thanx for your interesting to this mod.

First, please find this code at your index.template.php, on function theme_linktree()


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


Change it manually with this code:


if($settings['linktree_inline'])
    echo '<img src="' . $settings['default_images_url'] . '/nav_inline_start.gif" alt="linktree" class="midimage" border="0" />&nbsp;';
// Each tree item has a URL and name.  Some may have extra_before and extra_after.
foreach ($context['linktree'] as $link_num => $tree)
{
// Show the | | |-[] Folders.
if (!$settings['linktree_inline'])
{
if ($link_num > 0)
echo str_repeat('<img src="' . $settings['default_images_url'] . '/icons/linktree_main.gif" alt="| " border="0" />', $link_num - 1), '<img src="' . $settings['default_images_url'] . '/icons/linktree_side.gif" alt="|-" border="0" />';
echo '<img src="' . $settings['default_images_url'] . '/icons/folder_open2.gif" alt="+" border="0" />&nbsp; ';
}

// 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 $settings['linktree_link'] && (isset($tree['url']) && $link_num != count($context['linktree']) - 1) ? '<a href="' . $tree['url'] . '" class="nav">' . $tree['name'] . '</a>' : $tree['name'];

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

if ($settings['linktree_inline'] && $link_num == count($context['linktree']) - 2)
        echo '<br /><img src="' . $settings['default_images_url'] . '/nav_inline_end.gif" alt="linktree" class="midimage" border="0" />&nbsp;';
// Don't show a separator for the last one.
if ($link_num != count($context['linktree']) - 1)
echo $settings['linktree_inline'] ? ($link_num < (count($context['linktree']) - 2) ? ' &nbsp;&gt;&nbsp; ' : '') : '<br />';
}


Dont forget to put these images to your image directory:
- nav_inline_end.gif
- nav_inline_start.gif

And this image on your image - icon directory.
- folder_open2.gif

Thanx you!
Title: Re: Link Tree
Post by: EagleTrades on March 13, 2008, 11:32:17 PM
Thank you for your relpy.  I have performed the steps that you recommend and the mod is working just fine. I did have to install it manually to get it to work. I believe this is because we are using a customized theme, not the default smf theme.

Anyway, thanks for your reply. The mod is working as stated.
Title: Re: Link Tree
Post by: Informatics on March 14, 2008, 09:35:31 PM
thanx EagleTrades for the feedback, anyway, good job for doing manually.
Title: Re: Link Tree
Post by: Informatics on May 20, 2008, 06:21:32 AM
This mod is compatible with 1.1.5
Title: Re: Link Tree
Post by: flying.man on June 06, 2008, 05:21:46 AM
Quote from: cyclon on May 20, 2008, 06:21:32 AM
This mod is compatible with 1.1.5

you sure?
Title: Re: Link Tree
Post by: Informatics on June 06, 2008, 09:50:21 PM
Yeah... just go to the download link, and try to parse with 1.1.5
Title: Re: Link Tree
Post by: flying.man on June 08, 2008, 10:45:57 AM
thanx dude!
Title: Re: Link Tree
Post by: Informatics on June 09, 2008, 03:53:41 AM
you're welcome mate :)
Title: Re: Link Tree
Post by: Final60 on July 07, 2008, 07:40:53 PM
Hey Ive been trying to manually install this mod without much luck, currently no link tree shows up at all (default or modified) on the custom theme Dark Fantasy, but it seems to work fine with the default theme.

heres the forum: www.dcpryzom.co.uk/forum

Ive attached the Dark Fantasy theme inde.template.php, would you mind taking a look at it, would be much appreciated!

regards,

Title: Re: Link Tree
Post by: Informatics on July 08, 2008, 01:53:04 AM
OK... i'll try...
Just wait...
Title: Re: Link Tree
Post by: Zagdul on September 22, 2008, 01:10:35 AM
Is it necessary to do a manual install if you're using a custom theme? I've done the package install and tried enabling / disabling inline links but it's not displaying any differently in my forum index.

If it is the case, that's fine, I am just asking.

Thanks for your time.
Title: Re: Link Tree
Post by: Informatics on September 22, 2008, 06:13:33 AM
I think, its depend on your theme style.
Title: Re: Link Tree
Post by: indonesia on March 27, 2009, 08:05:39 PM
hi cyclon,
how about this one?
(http://i39.tinypic.com/2uqchi0.gif) << SMF

(http://i44.tinypic.com/fbz49y.jpg) << vB

Code:


function theme_linktree()
{
global $context, $settings, $options;

// Folder style or inline?  Inline has a smaller font.
echo '<span class="nav"', $settings['linktree_inline'] ? ' style="font-size: smaller;"' : '', '>';

// Each tree item has a URL and name.  Some may have extra_before and extra_after.
foreach ($context['linktree'] as $link_num => $tree)
{
// Show the | | |-[] Folders.
if (!$settings['linktree_inline'])
{

if ($link_num == count($context['linktree']) - 1)
if ($link_num > 1)
echo str_repeat('<img src="' . $settings['images_url'] . '/icons/linktree_main.gif" alt="| " border="0" />'
, $link_num == count($context['linktree']) - 2), '<br /><img src="' . $settings['images_url'] . '/icons/linktree_side.gif" alt="|-" border="0" /><img src="' . $settings['images_url'] . '/icons/folder_open.gif" alt="+" border="0" />&nbsp; ';
if ($link_num >= 1)
if ($link_num !== count($context['linktree']) - 1)
echo ' &raquo; ';
if ($link_num < 1)
echo '<img src="' . $settings['images_url'] . '/icons/folder_open.gif" alt="+" border="0" />&nbsp; ';
}


//echo '<img src="' . $settings['images_url'] . '/icons/folder_open.gif" alt="+" border="0" />&nbsp; ';
// Show something before the link?
if (isset($tree['extra_before']))
echo $tree['extra_before'];

if ($link_num == count($context['linktree']) - 1)
echo '<span class="last">';

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

// 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 $settings['linktree_inline'] ? ' &nbsp;|&nbsp; ' : '';
}

echo '</span>';
}


im sorry, the code is not good

Title: Re: Link Tree
Post by: Informatics on May 03, 2009, 09:42:38 PM
sorry for my belate 1000x reply :)

i dont have any notifying email for this post.

btw, i dont have it try yet... OK. I'll try. THANX.
Title: Re: Link Tree
Post by: indonesia on May 04, 2009, 04:47:36 AM
Quote from: Cyclon Boy on May 03, 2009, 09:42:38 PM
sorry for my belate 1000x reply :)

i dont have any notifying email for this post.

btw, i dont have it try yet... OK. I'll try. THANX.

hi.. cyclon

im sorry, my code above have little bug...
if there are only two link_num, the last link is not become a tree...

before: (http://i42.tinypic.com/14y6f6v.jpg)

after: (http://i43.tinypic.com/2wd3uba.jpg)


Please use this code to fix it...

function theme_linktree()

{

   global $context, $settings, $options;



   // Folder style or inline?  Inline has a smaller font.

   echo '<span class="nav"', $settings['linktree_inline'] ? ' style="font-size: smaller;"' : '', '>';



   // Each tree item has a URL and name.  Some may have extra_before and extra_after.

   foreach ($context['linktree'] as $link_num => $tree)

   {

      // Show the | | |-[] Folders.

      if (!$settings['linktree_inline'])

      {



         if ($link_num == count($context['linktree']) - 1)

         if ($link_num > 0)

            //No str_repeat here.. :D

             echo '<br /><img src="' . $settings['images_url'] . '/icons/linktree_side.gif" alt="|-" border="0" />

             <img src="' . $settings['images_url'] . '/icons/folder_open.gif" alt="+" border="0" />&nbsp; ';

         

         if ($link_num >= 1)

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

         echo ' &raquo; ';

         if ($link_num < 1)

         echo '<img src="' . $settings['images_url'] . '/icons/folder_open.gif" alt="+" border="0" />&nbsp; ';

      }

           

      // Show something before the link?

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

         echo $tree['extra_before'];



if ($link_num == count($context['linktree']) - 1)

         echo '<span class="last">';

   

      // Show the link, including a URL if it should have one.

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



      // 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 $settings['linktree_inline'] ? ' &nbsp;|&nbsp; ' : '';

   }



   echo '</span>';

}

Title: Re: Link Tree
Post by: Informatics on May 04, 2009, 05:01:22 AM
OK... i'll try. Nice works.
Title: Re: Link Tree
Post by: myktek on October 18, 2009, 03:17:56 AM
i got it installed, btw like the mod and thanks, but it looks really horrible on my theme..?

smf 1.1.10
egad's gold night2 theme
manually replaced the code and copied the files to the images and images/icon directory
Title: Re: Link Tree
Post by: Informatics on October 19, 2009, 09:35:28 AM
Thanx. Maybe you could fix the design for us.
Title: Re: Link Tree
Post by: SeMaForo on November 06, 2009, 10:07:57 PM
Thanks a lot for the  explanatios, i've finally got it
By the way,what to do if you dont want the second linktree at the bottom of the last post appears?
Title: Re: Link Tree
Post by: Informatics on November 06, 2009, 10:58:53 PM
Quote from: SeMaForo on November 06, 2009, 10:07:57 PM
Thanks a lot for the  explanatios, i've finally got it
By the way,what to do if you dont want the second linktree at the bottom of the last post appears?

Thanx. Btw, i still dont understand what you mean....

Maybe, you just decrease the loop....
Title: Re: Link Tree
Post by: SeMaForo on November 19, 2009, 06:55:01 AM
Sorry Cyclon,my english is really poor...
When the board displays, i see two times my new linktree, one at he top, before the posts, and a second one just after the posts. Two times then. Is it possible to change that and force the linktree to appear just one time?, for instance only at the top?
Thanks very much
Title: Re: Link Tree
Post by: Informatics on November 19, 2009, 08:33:51 PM
My mother language is not English either :D

Can you show me the sample site of you. Thanx.
Title: Re: Link Tree
Post by: Joker™ on February 02, 2010, 02:30:09 AM
is it going to be updated for RC2
Title: Re: Link Tree
Post by: Informatics on February 02, 2010, 03:52:38 AM
^ i'm not sure can do this stuff anymore.... maybe somebody else want to develope it.

Thanx.
Title: Re: Link Tree
Post by: Joker™ on February 02, 2010, 03:53:49 AM
first of all very nicely written n easy to understand mod ... i played alot with it in my site

did it myself .... if  u allow i can post some of the changes i made

here's my site link if anyone wanna see how it looks...

www.freakygurus.com

thanx once again
Title: Re: Link Tree
Post by: Informatics on February 02, 2010, 04:39:05 AM
You can show your creativity here, maybe someone want to adapt it.
Thanx and what a nice forum you have :) .
Title: Re: Link Tree
Post by: Joker™ on February 02, 2010, 05:19:22 AM
sure ...here we go..

Find
// Each tree item has a URL and name. Some may have extra_before and extra_after.
foreach ($context['linktree'] as $link_num => $tree)
{


Replace:
echo '<img src="' . $settings['default_images_url'] . '/nav_inline_start.gif" alt="linktree" class="midimage" border="0" />&nbsp;';
// Each tree item has a URL and name.  Some may have extra_before and extra_after.
foreach ($context['linktree'] as $link_num => $tree)
{


Find:
// Don't show a separator for the last one (RTL mode)
if ($link_num != count($context['linktree']) - 1 && $context['right_to_left'])
echo '&#171;&nbsp;';


Add After
// Show the | | |-[] Folders.

if ($link_num > 0)

echo '<img src="' . $settings['default_images_url'] . '/icons/folder_open2.gif" alt="+" border="0" />&nbsp; ';
      

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


Replace:
// Show the link, including a URL if it should have one.
echo $settings['linktree_link'] && (isset($tree['url']) && $link_num != count($context['linktree']) - 1) ? '
<a href="' . $tree['url'] . '"><span>' . $tree['name'] . '</span></a>' : '<span>' . $tree['name'] .'</span>';


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

Replace:
if ($link_num == count($context['linktree']) - 2)
        echo '<br /><img src="' . $settings['default_images_url'] . '/nav_inline_end.gif" alt="linktree" class="midimage" border="0" />&nbsp;';

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


Thanx for the comment on site  :D

if possible can u pack these codes into mod,as i dont know how to make a mod.
It'll help people to install ur beautiful mod more easily.
Title: Re: Link Tree
Post by: Informatics on February 02, 2010, 05:35:46 AM
Nice share. I'll figure it later. Thanx.
Title: Re: Link Tree
Post by: Joker™ on February 02, 2010, 07:06:26 AM
Quote from: SeMaForo on November 19, 2009, 06:55:01 AM
Sorry Cyclon,my english is really poor...
When the board displays, i see two times my new linktree, one at he top, before the posts, and a second one just after the posts. Two times then. Is it possible to change that and force the linktree to appear just one time?, for instance only at the top?
Thanks very much

so u want to remove linktree from the bottom ...

ru asking for RC2 ??
Title: Re: Link Tree
Post by: Joker™ on February 04, 2010, 05:05:02 AM
i also added some more functionality to linktree .... like

the very first folder image  ---- if u click on it , it will reload the page

the connecting folder image below it --- if u click it , it will take u one step back,i.e the position u were

if anyone wanna see u can see here >> www.freakygurus.com :D
Title: Re: Link Tree
Post by: fullmoonya on March 17, 2012, 07:13:39 AM
could somebody update this for smf2.0.2?..
Title: Re: Link Tree
Post by: BaghdadGhost on August 11, 2012, 05:19:10 AM
Quote from: fullmoonya on March 17, 2012, 07:13:39 AM
could somebody update this for smf2.0.2?..

I second this request if possible.

thanks