News:

Want to get involved in developing SMF, then why not lend a hand on our github!

Main Menu

Undefined index for buttons

Started by mpforum, September 15, 2008, 12:36:49 AM

Previous topic - Next topic

mpforum

Hi all,

I've gone to add another button for the menu in the /sources/subs.php file, but in the error log, I am getting an undefined index error. Am I suposed to declare something somewhere?

Here is what I added to the file:
'Donate' => array(
   'title' => $txt['Donate'],
   'href' => 'http://www.mpforum.com.au/forum/index.php?action=profile;sa=subscriptions',
   'show' => !$user_info['is_guest'],
   'sub_buttons' => array(
   ),
),


Any ideas?

Nathaniel

I would guess that the "$txt['Donate']" code is causing your issue. Did you use a language string from a mod, or have you just put 'Donate' because that is what you want it to show?

If the former is true, then which mod are you using?
If the later is true, then replace "$txt['Donate']" with "Donate".
SMF Friend (Former Support Specialist) | SimplePortal Developer
My SMF Mods | SimplePortal

"Quis custodiet ipsos custodes?" - Who will Guard the Guards?

Please don't send me ANY support related PMs. I will just delete them.

mpforum

Ok, I changed it to read 'Donate', but now I'm getting the following error:
Use of undefined constant Donate - assumed 'Donate'

What does it mean?

Nathaniel

It means that you need to put quotes '' around the donate text. Like this:
'title' => 'Donate',
SMF Friend (Former Support Specialist) | SimplePortal Developer
My SMF Mods | SimplePortal

"Quis custodiet ipsos custodes?" - Who will Guard the Guards?

Please don't send me ANY support related PMs. I will just delete them.

mpforum

Mate, just another quick question. How the hell do you know so much about SMF???

I run an Aussie bike forum (www.mpforum.com.au) and the only reason that it's running so well is because of all the replies that you have given me.

Your a bloody champion, and I just want to say thanks.

Nathaniel

My Knowledge of SMF comes from months of looking through the SMF source code to try and fix problems for my own website, as well as looking through the forums, reading about common issues,  finding odd issues that people have had and then working out a way to solve them. ;D

I'm glad that your problem is now solved. :D
SMF Friend (Former Support Specialist) | SimplePortal Developer
My SMF Mods | SimplePortal

"Quis custodiet ipsos custodes?" - Who will Guard the Guards?

Please don't send me ANY support related PMs. I will just delete them.

Advertisement: