News:

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

Main Menu

Link Tree

Started by Informatics, February 14, 2008, 02:22:22 AM

Previous topic - Next topic

Informatics

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!


You can catch me @ Forum Informatika a.k.a Indonesian Informatics Online Community @ http://if.web.id




Mods:
1. LinkTree v.1.1.0 [Topic  || Download]
2. Header Rotator v.1.1.0 for 1.1.x | v.2.1 for 2.0 [Topic || Download]

EagleTrades

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.
Regards,

Admin
Eagle Trades Ltd.
Website: www.eagletrades.net
Email: [email protected]

Informatics

thanx EagleTrades for the feedback, anyway, good job for doing manually.


You can catch me @ Forum Informatika a.k.a Indonesian Informatics Online Community @ http://if.web.id




Mods:
1. LinkTree v.1.1.0 [Topic  || Download]
2. Header Rotator v.1.1.0 for 1.1.x | v.2.1 for 2.0 [Topic || Download]

Informatics

This mod is compatible with 1.1.5


You can catch me @ Forum Informatika a.k.a Indonesian Informatics Online Community @ http://if.web.id




Mods:
1. LinkTree v.1.1.0 [Topic  || Download]
2. Header Rotator v.1.1.0 for 1.1.x | v.2.1 for 2.0 [Topic || Download]

flying.man


Informatics

Yeah... just go to the download link, and try to parse with 1.1.5


You can catch me @ Forum Informatika a.k.a Indonesian Informatics Online Community @ http://if.web.id




Mods:
1. LinkTree v.1.1.0 [Topic  || Download]
2. Header Rotator v.1.1.0 for 1.1.x | v.2.1 for 2.0 [Topic || Download]

flying.man


Informatics

you're welcome mate :)


You can catch me @ Forum Informatika a.k.a Indonesian Informatics Online Community @ http://if.web.id




Mods:
1. LinkTree v.1.1.0 [Topic  || Download]
2. Header Rotator v.1.1.0 for 1.1.x | v.2.1 for 2.0 [Topic || Download]

Final60

#28
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,


Informatics

OK... i'll try...
Just wait...


You can catch me @ Forum Informatika a.k.a Indonesian Informatics Online Community @ http://if.web.id




Mods:
1. LinkTree v.1.1.0 [Topic  || Download]
2. Header Rotator v.1.1.0 for 1.1.x | v.2.1 for 2.0 [Topic || Download]

Zagdul

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.

Informatics

I think, its depend on your theme style.


You can catch me @ Forum Informatika a.k.a Indonesian Informatics Online Community @ http://if.web.id




Mods:
1. LinkTree v.1.1.0 [Topic  || Download]
2. Header Rotator v.1.1.0 for 1.1.x | v.2.1 for 2.0 [Topic || Download]

indonesia

#32
hi cyclon,
how about this one?
<< SMF

<< 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

WarnetForum.com using SMF since 2007

Informatics

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.


You can catch me @ Forum Informatika a.k.a Indonesian Informatics Online Community @ http://if.web.id




Mods:
1. LinkTree v.1.1.0 [Topic  || Download]
2. Header Rotator v.1.1.0 for 1.1.x | v.2.1 for 2.0 [Topic || Download]

indonesia

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:

after:


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

}

WarnetForum.com using SMF since 2007

Informatics

OK... i'll try. Nice works.


You can catch me @ Forum Informatika a.k.a Indonesian Informatics Online Community @ http://if.web.id




Mods:
1. LinkTree v.1.1.0 [Topic  || Download]
2. Header Rotator v.1.1.0 for 1.1.x | v.2.1 for 2.0 [Topic || Download]

myktek

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

Informatics

Thanx. Maybe you could fix the design for us.


You can catch me @ Forum Informatika a.k.a Indonesian Informatics Online Community @ http://if.web.id




Mods:
1. LinkTree v.1.1.0 [Topic  || Download]
2. Header Rotator v.1.1.0 for 1.1.x | v.2.1 for 2.0 [Topic || Download]

SeMaForo

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?
Una frase no se gana a un pueblo, ni con un disfrazarse de poeta.

Informatics

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....


You can catch me @ Forum Informatika a.k.a Indonesian Informatics Online Community @ http://if.web.id




Mods:
1. LinkTree v.1.1.0 [Topic  || Download]
2. Header Rotator v.1.1.0 for 1.1.x | v.2.1 for 2.0 [Topic || Download]

Advertisement: