Simple Machines Community Forum

Customizing SMF => SMF Coding Discussion => Aiheen aloitti: JTVaughn - elokuu 11, 2013, 05:06:15 AP

Otsikko: Menu highlighting problem -- "Notice: Undefined index: page"
Kirjoitti: JTVaughn - elokuu 11, 2013, 05:06:15 AP
Using SMF 2.0.4 and SimplePortal 2.3.5

I'm trying to get the menu highlighting working for pages. I've added these per other instructions:


elseif ($_REQUEST['page'] == 'vsnews')
  $current_action = 'vs_news';
elseif ($_REQUEST['page'] == 'socialnetworks')
  $current_action = 'social';


This gets the highlighting working, but throws up an error on the portal index saying "Notice: Undefined index: page".

Any ideas?
Otsikko: Re: Menu highlighting problem -- "Notice: Undefined index: page"
Kirjoitti: kat - elokuu 11, 2013, 05:13:53 AP
As this is gonna involve some discussion about coding, I've been a right rebel and moved this to the... er... "Coding discussion" board. ;)
Otsikko: Re: Menu highlighting problem -- "Notice: Undefined index: page"
Kirjoitti: JTVaughn - elokuu 11, 2013, 05:14:49 AP
I was torn between the two boards ;) Thanks for clarifying
Otsikko: Re: Menu highlighting problem -- "Notice: Undefined index: page"
Kirjoitti: Kays - elokuu 11, 2013, 07:27:20 AP
You should check if $_REQUEST['page'] exists before checking for  value. ;)


elseif (isset($_REQUEST['page']) && $_REQUEST['page'] == 'vsnews')
  $current_action = 'vs_news';
elseif (isset($_REQUEST['page']) && $_REQUEST['page'] == 'socialnetworks')
  $current_action = 'social';
Otsikko: Re: Menu highlighting problem -- "Notice: Undefined index: page"
Kirjoitti: JTVaughn - elokuu 11, 2013, 07:43:51 AP
Brilliant, thank you :)