News:

SMF 2.1.4 has been released! Take it for a spin! Read more.

Main Menu

Getting thousands of errors an hour

Started by ACAMS, April 09, 2011, 06:36:52 PM

Previous topic - Next topic

ACAMS


I have SMF 2.0 RC3 with the RC4 Security patch

my error log says


http://gametechmods.com/forums/index.php?/topic%2c6022.855.html

8: Undefined index: page

File: /home/gametechmods/gametechmods.com/forums/Sources/Subs.php
Line: 4461



Line 4461 is 9th from bottom since Bold does not work inside the code tags or click File: and the link


   // Figure out which action we are doing so we can set the active tab.
   // Default to home.
   $current_action = $modSettings['sp_portal_mode'] == 3 && empty($context['standalone']) && empty($context['disable_sp']) ? 'forum' : 'home';


   if (isset($context['menu_buttons'][$context['current_action']]))
      $current_action = $context['current_action'];
   elseif ($context['current_action'] == 'search2')
      $current_action = 'search';
   elseif ($context['current_action'] == 'theme')
      $current_action = isset($_REQUEST['sa']) && $_REQUEST['sa'] == 'pick' ? 'profile' : 'admin';
   elseif(empty($context['disable_sp']) && ((isset($_GET['board']) || isset($_GET['topic']) || in_array($context['current_action'], array('unread', 'unreadreplies', 'recent', 'stats', 'who'))) && in_array($modSettings['sp_portal_mode'], array(1, 3))))
      $current_action = 'forum';
   elseif ($context['current_action'] == 'register2')
      $current_action = 'register';
   elseif ($context['current_action'] == 'login2' || ($user_info['is_guest'] && $context['current_action'] == 'reminder'))
      $current_action = 'login';
   elseif ($context['current_action'] == 'groups' && $context['allow_moderation_center'])
      $current_action = 'moderate';
   elseif ($_REQUEST['page'] == 'page1887')
      $current_action = 'Botexchange';   


   $context['menu_buttons'][$current_action]['active_button'] = true;


   if (!$user_info['is_guest'] && $context['user']['unread_messages'] > 0 && isset($context['menu_buttons']['pm']))
   {
      $context['menu_buttons']['pm']['alttitle'] = $context['menu_buttons']['pm']['title'] . ' [' . $context['user']['unread_messages'] . ']';
      $context['menu_buttons']['pm']['title'] .= ' [<strong>' . $context['user']['unread_messages'] . '</strong>]';
   }
}


Anybody have any idea what is throwing this code.....I have several similar pages and they don't throw a code


Here is the HTML code of the page
http://gametechmods.com/Temp/page1887.txt

THANKS for any help....I really don't want to disable logs, but will have to if I can't fix this.

Spoogs

Seems more of a Simple Portal issue, try their support topic/site

emanuele

I'm not sure where the code comes from, and then I'm not sure about the actual root of the problem, but changing:
   elseif ($_REQUEST['page'] == 'page1887')
      $current_action = 'Botexchange';

to
   elseif (!empty($_REQUEST['page']) && $_REQUEST['page'] == 'page1887')
      $current_action = 'Botexchange';

should solve the issue.


Take a peek at what I'm doing! ;D




Hai bisogno di supporto in Italiano?

Aiutateci ad aiutarvi: spiegate bene il vostro problema: no, "non funziona" non è una spiegazione!!
1) Cosa fai,
2) cosa ti aspetti,
3) cosa ottieni.

MrPhil

#3
If that doesn't work consistently, try changing !empty to issetempty(undefined variable) is supposed to act like !isset(undefined variable)...

fixed per Arantor

Arantor

Apart from the fact that empty is the spiritual opposite of isset as well as checking more, if (!empty($variable)) validates the $variable is set, is not equal to null, is not equal to an empty string or 0.

ACAMS

#5
Quote from: emanuele on April 09, 2011, 07:28:55 PM
I'm not sure where the code comes from, and then I'm not sure about the actual root of the problem, but changing:
   elseif ($_REQUEST['page'] == 'page1887')
      $current_action = 'Botexchange';

to
   elseif (!empty($_REQUEST['page']) && $_REQUEST['page'] == 'page1887')
      $current_action = 'Botexchange';

should solve the issue.



THANKS, that solved it.

Advertisement: