TP-Docs
HTML5 Icon HTML5 Icon HTML5 Icon
TP on Social Media

Recent

Welcome to TinyPortal. Please login or sign up.

Members
  • Total Members: 3,973
  • Latest: NonStop
Stats
  • Total Posts: 196,230
  • Total Topics: 21,353
  • Online today: 446
  • Online ever: 8,223 (February 19, 2025, 04:35:35 AM)
Users Online
  • Users: 1
  • Guests: 309
  • Total: 310
  • lurkalot

[SOLVED] Keeping "Files" Highlighted While Viewing Categories/ Files

Started by WillyP, May 17, 2010, 04:09:43 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

WillyP

SMF2 rc3
TP 1.0 beta 5-1
This is my testing forum: 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. 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!

IchBin

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.

WillyP


This website is proudly hosted on Crocweb Cloud Website Hosting.