TinyPortal

Development => Support => Topic started by: WBA Dude on June 13, 2009, 04:30:38 PM

Title: Using tpdownload, need a tab
Post by: WBA Dude on June 13, 2009, 04:30:38 PM
Hi

I am using the latest tinyportal and wanting to use the download system which is included with this. What would I put so it showed up as a tab, Downloads?

Thanks  :up:
Title: Re: Using tpdownload, need a tab
Post by: Zetan on June 13, 2009, 05:11:14 PM
See these topics:

Please read  and follow the Posting Guidelines.html (http://www.tinyportal.net/index.php/topic,581)

In particular, Theme, Theme Author and possibly a sample of the menu code from the theme index.template.php file.

A general guide:
How to add a Home button or a new tab? (http://docs.tinyportal.co.uk/index.php?topic=30)
Title: Re: Using tpdownload, need a tab
Post by: WBA Dude on June 13, 2009, 05:23:44 PM
Tat is for a FORUM tab. What would it be for a downloads tab leading to the tinyportal downloads?  ???
Title: Re: Using tpdownload, need a tab
Post by: Zetan on June 13, 2009, 05:32:38 PM
Quote from: WBA Dude on June 13, 2009, 05:23:44 PM
Tat is for a FORUM tab. What would it be for a downloads tab leading to the tinyportal downloads?  ???

No, it's a general guide on how to add a Home button, or any other tab. You need to adapt it for a Download tab. The principle is the same. If you get stuck, then post the code with the details requested in the Posting Guide.

If you are willing to make an effort, people are usually more willing to help if you do get stuck :)
Title: Re: Using tpdownload, need a tab
Post by: WBA Dude on June 13, 2009, 06:20:29 PM
Quote from: Zetan on June 13, 2009, 05:32:38 PM
Quote from: WBA Dude on June 13, 2009, 05:23:44 PM
Tat is for a FORUM tab. What would it be for a downloads tab leading to the tinyportal downloads?  ???

No, it's a general guide on how to add a Home button, or any other tab. You need to adapt it for a Download tab. The principle is the same. If you get stuck, then post the code with the details requested in the Posting Guide.

If you are willing to make an effort, people are usually more willing to help if you do get stuck :)

I am stuck. lol.
Title: Re: Using tpdownload, need a tab
Post by: Zetan on June 13, 2009, 06:24:10 PM
Me too, because you still haven't followed the posting guide.
Title: Re: Using tpdownload, need a tab
Post by: Renegd98 on June 13, 2009, 09:26:35 PM
Yep, until you provide the data requested as Zetan has requested we will continue to be stuck.
Title: Re: Using tpdownload, need a tab
Post by: WBA Dude on June 14, 2009, 09:17:41 AM
Ok. I am using these mods.

Modification Packages
   Mod Name    Version    
1.    SMF File Manager    2.1.3    [ Uninstall ] [ List Files ] [ Delete ]
2.    Website Button    1.1.4    [ Uninstall ] [ List Files ] [ Delete ]
3.    Highlight Message Backgrounds    1.12    [ Uninstall ] [ List Files ] [ Delete ]
4.    Skype Integration    1.0    [ Uninstall ] [ List Files ] [ Delete ]
5.    SMF 1.0.16 / 1.1.8 Update    1.0    [ Uninstall ] [ List Files ] [ Delete ]
6.    Aeva ~ Auto-Embed Video & Audio    5.2.56    [ Uninstall ] [ List Files ] [ Delete ]
7.    SMFShop    3.0    [ Uninstall ] [ List Files ] [ Delete ]
8.    TinyPortal    1.075    [ Uninstall ] [ List Files ] [ Delete ]
9.    User Control Panel By Alan S    2.0    [ Uninstall ] [ List Files ] [ Delete ]
SMF SHOP Packages
   Mod Name    Version    
1.    SMFShop Inventory Post Mod    0.2    [ Uninstall ] [ List Files ] [ Delete ]
2.    SMFShop Stats Mod    0.1



At the moment, the first bit of the add a custom tab in the docs on this site in my index.template.php is:

if (in_array($context['current_action'], array('usercp','search', 'admin', 'calendar', 'profile', 'mlist', 'register', 'login', 'help', 'pm')))

I really don't understand what to put for a download tab  :'(
Title: Re: Using tpdownload, need a tab
Post by: Zetan on June 14, 2009, 10:13:23 AM
THEME?

All themes are different.




I asked this in my first post.
Title: Re: Using tpdownload, need a tab
Post by: WBA Dude on June 14, 2009, 10:16:59 AM
Default. Sorry :)
Title: Re: Using tpdownload, need a tab
Post by: Zetan on June 14, 2009, 10:28:29 AM
You know.. these are getting tiring.

ALL themes are DIFFERENT, they have Different menus. Are you going to use the Default theme?
Or, are you going to install a custom theme, you know, for your band? The default theme does what it does, but it's bland and not really eye candy for a music site.

Title: Re: Using tpdownload, need a tab
Post by: WBA Dude on June 14, 2009, 10:31:23 AM
I am using the default theme!  I won't change!

Title: Re: Using tpdownload, need a tab
Post by: Zetan on June 14, 2009, 10:36:24 AM
Righty then.. Give me 5 - 10 mins...
Title: Re: Using tpdownload, need a tab
Post by: WBA Dude on June 14, 2009, 10:38:59 AM
Ok.
Title: Re: Using tpdownload, need a tab
Post by: Zetan on June 14, 2009, 11:14:24 AM
in the Default Theme index.template.php file:

Code (Find) Select


// 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', )))




Code (Replace With) Select


// 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', 'downloads')))




Code (Find) Select


// The end of tab section.
echo '
<td class="maintab_' , $last , '">&nbsp;</td>




Code (Add Before) Select


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




Open: /Themes/default/languages/index.english.php

Code (Find) Select


$txt['attach_times'] = 'times';




Code (Add After) Select


$txt['downloads'] = 'downloads';




Let me know if it works :)
Title: Re: Using tpdownload, need a tab
Post by: WBA Dude on June 14, 2009, 11:25:14 AM
IT WORKS!  Thank You So Much!

www.chillbandforum.tk
Title: Re: Using tpdownload, need a tab
Post by: Zetan on June 14, 2009, 11:31:17 AM
Great :up:

Please, in future.. follow the posting guide and be descriptive. It helps us to help you :)


Thanks
Title: Re: Using tpdownload, need a tab
Post by: Zetan on June 14, 2009, 11:33:10 AM
Ok, it's not working quite right as the tab isn't staying highlighted, I'll get back with a fix.
Title: Re: Using tpdownload, need a tab
Post by: WBA Dude on June 14, 2009, 11:34:56 AM
ok. I moved the tab so it was in the middle. Not at the end
Title: Re: Using tpdownload, need a tab
Post by: Zetan on June 14, 2009, 12:07:27 PM
:) cool.

I have to go out for a while, lunch with some friends. I'll be back to take a look at the tab highlight later.
Title: Re: Using tpdownload, need a tab
Post by: WBA Dude on June 14, 2009, 06:34:29 PM
Okay
Title: Re: Using tpdownload, need a tab
Post by: IchBin on June 14, 2009, 06:53:01 PM
The reason it is not highlighted is because "downloads" in the array does not exist. You'll need to add a bit of custom code to make this work. Add this code after the line $current_action='home';

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


That should highlight the button code while in the downloads section. Let me know if it does not work. If it does not, please post the code along with the 5 lines of code above an below. Thanks.

Title: Re: Using tpdownload, need a tab
Post by: WBA Dude on June 14, 2009, 07:16:54 PM
is this in index.template.php
Title: Re: Using tpdownload, need a tab
Post by: G6Cad on June 14, 2009, 07:52:22 PM
Yes
Title: Re: Using tpdownload, need a tab
Post by: WBA Dude on June 14, 2009, 08:07:12 PM
Thanks. Will do it tomorrow. Going to bed. Been up all night!!
Title: Re: Using tpdownload, need a tab
Post by: WBA Dude on June 18, 2009, 06:16:37 PM
Quote from: IchBinâ„¢ on June 14, 2009, 06:53:01 PM
The reason it is not highlighted is because "downloads" in the array does not exist. You'll need to add a bit of custom code to make this work. Add this code after the line $current_action='home';

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


That should highlight the button code while in the downloads section. Let me know if it does not work. If it does not, please post the code along with the 5 lines of code above an below. Thanks.



Ok. Doesn't highlight

Attached my index.template.php

Title: Re: Using tpdownload, need a tab
Post by: Zetan on June 18, 2009, 06:25:33 PM
Quote from: WBA Dude on June 18, 2009, 06:16:37 PM

Ok. Doesn't highlight

Attached my index.template.php



I had tried that already, thought I may have missed something. I'll have another look later, or if IchBin has a solution. I'm a bit busy at the mo.
Title: Re: Using tpdownload, need a tab
Post by: WBA Dude on June 18, 2009, 06:31:15 PM
Quote from: Zetan on June 18, 2009, 06:25:33 PM
Quote from: WBA Dude on June 18, 2009, 06:16:37 PM

Ok. Doesn't highlight

Attached my index.template.php



I had tried that already, thought I may have missed something. I'll have another look later, or if IchBin has a solution. I'm a bit busy at the mo.

That was for IchBin

Sorry :)
Title: Re: Using tpdownload, need a tab
Post by: Zetan on June 18, 2009, 06:35:30 PM
Quote from: WBA Dude on June 18, 2009, 06:31:15 PM
Quote from: Zetan on June 18, 2009, 06:25:33 PM
Quote from: WBA Dude on June 18, 2009, 06:16:37 PM

Ok. Doesn't highlight

Attached my index.template.php



I had tried that already, thought I may have missed something. I'll have another look later, or if IchBin has a solution. I'm a bit busy at the mo.

That was for IchBin

Sorry :)

lol, why? we're all on the same team. No worries though :)
Title: Re: Using tpdownload, need a tab
Post by: WBA Dude on June 18, 2009, 06:38:03 PM
Oh ok. He seemed to know how to do it.
Title: Re: Using tpdownload, need a tab
Post by: Zetan on June 18, 2009, 07:08:31 PM
Use this instead, just a slight change from what IchBin posted:



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

Title: Re: Using tpdownload, need a tab
Post by: IchBin on June 18, 2009, 09:24:33 PM
You needed to change the current_action in the button code too.
Title: Re: Using tpdownload, need a tab
Post by: WBA Dude on June 21, 2009, 07:39:51 PM
Ok.

I added the if (isset($_GET['dl']))
$current_action='tpmod;dl';


Still doesn't highlight  :-\
Title: Re: Using tpdownload, need a tab
Post by: IchBin on June 21, 2009, 11:25:30 PM
Quote from: WBA Dude on June 21, 2009, 07:39:51 PM
Ok.

I added the if (isset($_GET['dl']))
$current_action='tpmod;dl';


Still doesn't highlight  :-\

Then perhaps you should try the file I attached in my last post above...
Title: Re: Using tpdownload, need a tab
Post by: WBA Dude on June 22, 2009, 04:54:37 PM
Quote from: IchBinâ„¢ on June 21, 2009, 11:25:30 PM
Quote from: WBA Dude on June 21, 2009, 07:39:51 PM
Ok.

I added the if (isset($_GET['dl']))
$current_action='tpmod;dl';


Still doesn't highlight  :-\

Then perhaps you should try the file I attached in my last post above...

It works finally. Thank You All!
Title: Re: Using tpdownload, need a tab
Post by: G6Cad on June 22, 2009, 06:03:53 PM
Marked solved then  :up: