TinyPortal

Development => Support => Topic started by: WillyP on May 17, 2010, 04:09:43 AM

Title: [SOLVED] Keeping "Files" Highlighted While Viewing Categories/ Files
Post by: WillyP on May 17, 2010, 04:09:43 AM
SMF2 rc3
TP 1.0 beta 5-1
This is my testing forum: http://www.test.planetdescent.net/index.php?action=tpmod;dl (http://www.test.planetdescent.net/index.php?action=tpmod;dl)

I've added 'Files' to the SMF menu, when in the files section the highlighting goes back to the home button. I have tried adapting the instructions on how to do this for the forum button, as given in this thread (http://www.tinyportal.net/index.php?topic=32687.msg262531#new). However nothing I've tried works. Here is the code I added to subs.php:
Code (subs.php) Select
'files' => array(
'title' => 'Files',
'href' => $scripturl . '?action=tpmod;dl',
'show' => true,
'sub_buttons' => array(
   'general' => array(
  'title' => 'General',
  'href' => $scripturl . '?action=tpmod;dl=files',
  'show' => true,
),
   'd3files' => array(
  'title' => 'Descent 3',
  'href' => $scripturl . '?action=tpmod;dl=d3files',
  'show' => true,
  'sub_buttons' => array(
   'd3missions' => array(
  'title' => 'Descent 3 Missions',
  'href' => $scripturl . '?action=tpmod;dl=cat29',
  'show' => true,
),
'd3music' => array(
  'title' => 'Descent 3 Music',
  'href' => $scripturl . '?action=tpmod;dl=cat30',
  'show' => true,
),
),
),
'd1d2files' => array(
  'title' => 'Descent 1 & 2',
  'href' => $scripturl . '?action=tpmod;dl=d1d2files',
  'show' => true,
  'sub_buttons' => array(
'd1missions' => array(
  'title' => 'Descent 1 Missions',
  'href' => $scripturl . '?action=tpmod;dl=d1missions',
  'show' => true,
),
'd1music' => array(
  'title' => 'Descent 1 Music',
  'href' => $scripturl . '?action=tpmod;dl=Descent 1 Music',
  'show' => true,
),
'd2missions' => array(
  'title' => 'Descent 2 Missions',
  'href' => $scripturl . '?action=tpmod;dl=cat50',
  'show' => true,
),
'd2music' => array(
  'title' => 'Descent 2 Music',
  'href' => $scripturl . '?action=tpmod;dl=d2Music',
  'show' => true,
),
),
),
),
),


Thanks for your help!
Title: Re: Keeping "Files" Highlighted While Viewing Categories/ Files
Post by: IchBin on May 17, 2010, 05:44:01 AM
You'll have to add in a check for the parameters in the URL. Something like this:
if (isset($_GET['dl']))
    $current_action='files';


If you look in the Subs.php file you'll see there are some other similar checks going on below that section of code you posted.
Title: Re: Keeping "Files" Highlighted While Viewing Categories/ Files
Post by: WillyP on May 17, 2010, 12:44:25 PM
That worked! Thank you very much!