TinyPortal

Development => Support => Topic started by: houston on January 30, 2006, 03:07:15 AM

Title: Adding DL Manager Button to smf1.1rc2 default theme.
Post by: houston on January 30, 2006, 03:07:15 AM
Adding this to the Babylon theme is quite easy. Unfortunately, adding it to the default theme in SMF 1.1 RC2 is not as easy. Has anybody been able to accomplish this task. I have gone through the code and have a pretty good idea how, but there is more information required than I know how to input.

Any help would be greatly appreciated.

Thanks
Title: Re: Adding DL Manager Button to smf1.1rc2 default theme.
Post by: Rasyr on January 30, 2006, 04:00:36 AM
Open the default index.template.php and find the following code (approximately line 563 or so):


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


Directly beneath it add the following code:


if ($context['current_action'] == 'tpmod')
$current_action = 'tpmod';


Then scroll down a little bit to the button definitions. Each one has a small comment before it to say what button the following snippet of code is for. I placed the following code between the Search and Admin buttons


// How about the [Downloads] button?
if($context['TPortal']['show_download']=='1')
echo ($current_action == 'tpmod' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' . $first . '">&nbsp;</td>' : '' , '
<td valign="top" class="maintab_' , $current_action == 'tpmod' ? 'active_back' : 'back' , '">
<a href="', $scripturl, '?action=tpmod;dl=0">' , $txt['tp-dldownloads'] , '</a>
</td>' , $current_action == 'tpmod' ? '<td class="maintab_active_' . $last . '">&nbsp;</td>' : '';



But you can place it almost anywhere in the line of buttons, I would think.

This gives me a button as shown in the following screenshots:






[attachment deleted by admin]

[attachment deleted by admin]
Title: Re: Adding DL Manager Button to smf1.1rc2 default theme.
Post by: houston on January 30, 2006, 04:45:36 AM
Thanks you very much. It worked great.

Cheers, :2funny:
Title: Re: Adding DL Manager Button to smf1.1rc2 default theme.
Post by: scope on January 30, 2006, 06:48:33 AM
how do I go about installing the download manager?  is it in TP .75?
Title: Re: Adding DL Manager Button to smf1.1rc2 default theme.
Post by: IchBin on January 30, 2006, 06:59:55 AM
DL manager will be released in the next version 0.85 which is coming very soon.