TinyPortal

Development => Support => Topic started by: gffb on May 27, 2007, 03:41:07 AM

Title: Download link in top menu
Post by: gffb on May 27, 2007, 03:41:07 AM
I would like a link to the downloads section in the top horisontal menu how can this be done, I am using the default theme only.
Any help and if buttons need they would be appreciated also.
Title: Re: Download link in top menu
Post by: Porky on May 27, 2007, 03:44:06 AM
Look here it describes how to add a button
http://www.tinyportal.net/index.php?topic=9919
Title: Re: Download link in top menu
Post by: gffb on May 27, 2007, 09:19:13 PM
That worked fine the only thing it does not do is put the highlight box around the download word when selected, using the default template any ideas?
Title: Re: Download link in top menu
Post by: Porky on May 27, 2007, 09:22:25 PM
can we get a link to your site and post the code you used.
Title: Re: Download link in top menu
Post by: gffb on May 27, 2007, 09:27:30 PM
sure thing new index code is below
// Work out where we currently are.
$current_action = 'home';
if (in_array($context['current_action'], array('admin', 'ban', 'boardrecount', 'cleanperms', 'detailedversion', 'dumpdb', 'featuresettings', 'featuresettings2', 'findmember', 'maintain', 'manageattachments', 'manageboards', 'managecalendar', 'managesearch', 'membergroups', 'modlog', 'news', 'optimizetables', 'packageget', 'packages', 'permissions', 'pgdownload', 'postsettings', 'regcenter', 'repairboards', 'reports', 'serversettings', 'serversettings2', 'smileys', 'viewErrorLog', 'viewmembers')))
$current_action = 'admin';
if (in_array($context['current_action'], array('contact','gallery','search', 'admin', 'calendar', 'profile', 'mlist', 'register', 'login', 'help', 'pm', 'forum', 'tpadmin', 'downloads')))
$current_action = $context['current_action'];
if ($context['current_action'] == 'search2')
$current_action = 'search';

if (isset($_GET['dl']))
$current_action = 'dlmanager';

if (isset($_GET['board']) || isset($_GET['topic']))
$current_action = 'forum';

if ($context['current_action'] == 'theme')
$current_action = isset($_REQUEST['sa']) && $_REQUEST['sa'] == 'pick' ? 'profile' : 'admin';

// Are we using right-to-left orientation?
if ($context['right_to_left'])
{
$first = 'last';
$last = 'first';
}
else
{
$first = 'first';
$last = 'last';
}

// Show the start of the tab section.
echo '
<table cellpadding="0" cellspacing="0" border="0" style="margin-left: 10px;">
<tr>
<td class="maintab_' , $first , '">&nbsp;</td>';

// Show the [home] button.
echo ($current_action=='home' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' . $first . '">&nbsp;</td>' : '' , '
<td valign="top" class="maintab_' , $current_action == 'home' ? 'active_back' : 'back' , '">
<a href="', $scripturl, '">' , $txt[103] , '</a>
</td>' , $current_action == 'home' ? '<td class="maintab_active_' . $last . '">&nbsp;</td>' : '';

if($settings['TPortal_front_type']!='boardindex')
// Show the [forum] button.
echo ($current_action=='forum' || $context['browser']['is_ie4']) ? '<td class="maintab_active_first">&nbsp;</td>' : '' , '
<td valign="top" class="maintab_' , $current_action=='forum' ? 'active_back' : 'back' , '">
<a href="', $scripturl, '?action=forum">'.$txt['tp-forum'].'</a>
</td>' , $current_action=='forum' ? '<td class="maintab_active_last">&nbsp;</td>' : '';
// Show the [downloads] button.
if ($context['allow_search'])
echo ($current_action == 'downloads' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' . $first . '">&nbsp;</td>' : '' , '
<td valign="top" class="maintab_' , $current_action == 'download' ? 'active_back' : 'back' , '">
<a href="', $scripturl, '?action=tpmod;dl=0">downloads</a>
</td>' , $current_action == 'downloads' ? '<td class="maintab_active_' . $last . '">&nbsp;</td>' : '';

// Show the [help] button.
echo ($current_action == 'help' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' . $first . '">&nbsp;</td>' : '' , '
<td valign="top" class="maintab_' , $current_action == 'help' ? 'active_back' : 'back' , '">
<a href="', $scripturl, '?action=help">' , $txt[119] , '</a>
</td>' , $current_action == 'help' ? '<td class="maintab_active_' . $last . '">&nbsp;</td>' : '';

// How about the [search] button?
if ($context['allow_search'])
echo ($current_action == 'search' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' . $first . '">&nbsp;</td>' : '' , '
<td valign="top" class="maintab_' , $current_action == 'search' ? 'active_back' : 'back' , '">
<a href="', $scripturl, '?action=search">' , $txt[182] , '</a>
</td>' , $current_action == 'search' ? '<td class="maintab_active_' . $last . '">&nbsp;</td>' : ''


site is www.harrowcwu.org
Title: Re: Download link in top menu
Post by: Porky on May 27, 2007, 09:33:21 PM
PS can you approve my account Humanporkrind
Title: Re: Download link in top menu
Post by: gffb on May 27, 2007, 09:34:46 PM
done do u need any extra permissions?
Title: Re: Download link in top menu
Post by: Porky on May 27, 2007, 09:36:12 PM
No just need to see what it is doing so I understand it
Title: Re: Download link in top menu
Post by: gffb on May 27, 2007, 09:36:30 PM
sure thing all done
Title: Re: Download link in top menu
Post by: Porky on May 27, 2007, 09:37:17 PM
ok give me a couple min
Title: Re: Download link in top menu
Post by: Porky on May 27, 2007, 09:56:00 PM
Ok this has me completely stumped, never ran into this before, I am going to shift someone else to this to help you out.
Title: Re: Download link in top menu
Post by: gffb on May 27, 2007, 10:06:21 PM
Thanks :)
Title: Re: Download link in top menu
Post by: G6Cad on May 27, 2007, 11:01:50 PM
In the array, try and change the action from 'downloads', to 'tpmod;dl', and if that doesent work just set it to 'download', (remove the s )
Title: Re: Download link in top menu
Post by: gffb on May 27, 2007, 11:07:11 PM
renamed all the downloads to download still not luck.
also changed download to tpmod;dl in the correct place i think
$current_action = 'admin';
if (in_array($context['current_action'], array('contact','gallery','search', 'admin', 'calendar', 'profile', 'mlist', 'register', 'login', 'help', 'pm', 'forum', 'tpadmin', 'tpmod;dl')))
Title: Re: Download link in top menu
Post by: IchBin on May 27, 2007, 11:08:05 PM
Actually all you need to do is change the $current_action=download parts in your button to say $current_action=dlmanager
Title: Re: Download link in top menu
Post by: gffb on May 27, 2007, 11:11:00 PM
that was it here is the owrking code
// Show the [download] button.
if ($context['allow_search'])
echo ($current_action == 'dlmanager' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' . $first . '">&nbsp;</td>' : '' , '
<td valign="top" class="maintab_' , $current_action == 'dlmanager' ? 'active_back' : 'back' , '">
<a href="', $scripturl, '?action=tpmod;dl=0">download</a>
</td>' , $current_action == 'dlmanager' ? '<td class="maintab_active_' . $last . '">&nbsp;</td>' : '';


Thanks to all......
Title: Re: Download link in top menu
Post by: IchBin on May 27, 2007, 11:14:25 PM
Post your whole menu_template code again. The code you posted at this post did not have what you say you have.
http://www.tinyportal.net/index.php?topic=16263.msg134700#msg134700
Title: Re: Download link in top menu
Post by: gffb on May 27, 2007, 11:17:22 PM
// Work out where we currently are.
$current_action = 'home';
if (in_array($context['current_action'], array('admin', 'ban', 'boardrecount', 'cleanperms', 'detailedversion', 'dumpdb', 'featuresettings', 'featuresettings2', 'findmember', 'maintain', 'manageattachments', 'manageboards', 'managecalendar', 'managesearch', 'membergroups', 'modlog', 'news', 'optimizetables', 'packageget', 'packages', 'permissions', 'pgdownload', 'postsettings', 'regcenter', 'repairboards', 'reports', 'serversettings', 'serversettings2', 'smileys', 'viewErrorLog', 'viewmembers')))
$current_action = 'admin';
if (in_array($context['current_action'], array('contact','gallery','search', 'admin', 'calendar', 'profile', 'mlist', 'register', 'login', 'help', 'pm', 'forum', 'tpadmin', 'download')))
$current_action = $context['current_action'];
if ($context['current_action'] == 'search2')
$current_action = 'search';

if (isset($_GET['dl']))
$current_action = 'dlmanager';

if (isset($_GET['board']) || isset($_GET['topic']))
$current_action = 'forum';

if ($context['current_action'] == 'theme')
$current_action = isset($_REQUEST['sa']) && $_REQUEST['sa'] == 'pick' ? 'profile' : 'admin';

// Are we using right-to-left orientation?
if ($context['right_to_left'])
{
$first = 'last';
$last = 'first';
}
else
{
$first = 'first';
$last = 'last';
}

// Show the start of the tab section.
echo '
<table cellpadding="0" cellspacing="0" border="0" style="margin-left: 10px;">
<tr>
<td class="maintab_' , $first , '">&nbsp;</td>';

// Show the [home] button.
echo ($current_action=='home' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' . $first . '">&nbsp;</td>' : '' , '
<td valign="top" class="maintab_' , $current_action == 'home' ? 'active_back' : 'back' , '">
<a href="', $scripturl, '">' , $txt[103] , '</a>
</td>' , $current_action == 'home' ? '<td class="maintab_active_' . $last . '">&nbsp;</td>' : '';

if($settings['TPortal_front_type']!='boardindex')
// Show the [forum] button.
echo ($current_action=='forum' || $context['browser']['is_ie4']) ? '<td class="maintab_active_first">&nbsp;</td>' : '' , '
<td valign="top" class="maintab_' , $current_action=='forum' ? 'active_back' : 'back' , '">
<a href="', $scripturl, '?action=forum">'.$txt['tp-forum'].'</a>
</td>' , $current_action=='forum' ? '<td class="maintab_active_last">&nbsp;</td>' : '';
// Show the [download] button.
if ($context['allow_search'])
echo ($current_action == 'dlmanager' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' . $first . '">&nbsp;</td>' : '' , '
<td valign="top" class="maintab_' , $current_action == 'dlmanager' ? 'active_back' : 'back' , '">
<a href="', $scripturl, '?action=tpmod;dl=0">download</a>
</td>' , $current_action == 'dlmanager' ? '<td class="maintab_active_' . $last . '">&nbsp;</td>' : '';

// Show the [help] button.
echo ($current_action == 'help' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' . $first . '">&nbsp;</td>' : '' , '
<td valign="top" class="maintab_' , $current_action == 'help' ? 'active_back' : 'back' , '">
<a href="', $scripturl, '?action=help">' , $txt[119] , '</a>
</td>' , $current_action == 'help' ? '<td class="maintab_active_' . $last . '">&nbsp;</td>' : '';
Title: Re: Download link in top menu
Post by: IchBin on May 27, 2007, 11:40:27 PM
You have an admin test account that you wouldn't mind sharing with me so I can look at it?
Title: Re: Download link in top menu
Post by: gffb on May 27, 2007, 11:41:39 PM
sure shall I pm you details?

It all seems working fine no though but you are welcome to have a peek?