Advertisement:

Menu highlighting problem -- "Notice: Undefined index: page"

Aloittaja JTVaughn, elokuu 11, 2013, 05:06:15 AP

« edellinen - seuraava »

JTVaughn

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?

kat

As this is gonna involve some discussion about coding, I've been a right rebel and moved this to the... er... "Coding discussion" board. ;)

JTVaughn

I was torn between the two boards ;) Thanks for clarifying

Kays

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';

If at first you don't succeed, use a bigger hammer. If that fails, read the manual.
My Mods


Advertisement: