Simple Machines Community Forum

SMF Support => SMF 2.0.x Support => Topic started by: leftezi on August 12, 2009, 01:37:36 PM

Title: Error in Subs.php, line 3936, in every click
Post by: leftezi on August 12, 2009, 01:37:36 PM
My forum produces this error after every click. In the end of the day they are thousands of them in the error log:


8: Undefined index:
file: ......./Sources/Subs.php
line: 3936


Here is a part from my subs.php code with the 3936 line included:

3928:  // Creates an image/text button
3929: function create_button($name, $alt, $label = '', $custom = '')
3930: {
3931: global $settings, $txt, $context;
3932:
3933: if (!$settings['use_image_buttons'])
3934: return $txt[$alt];
3935: elseif (!empty($settings['use_buttons']))

==>3936: return '<img src="' . $settings['images_url'] . '/buttons/' . $name . '" alt="' . $txt[$alt] . '" ' . $custom . ' />' . ($label != '' ? '<b>' . $txt[$label] . '</b>' : '');

3937: else
3938: return '<img src="' . $settings['lang_images_url'] . '/' . $name . '" alt="' . $txt[$alt] . '" ' . $custom . ' />';
3939: }


My forum is 2.0 RC 1.1 (I have updated in 2.0 RC 1.2 but the error remains)
Any suggestions?

Title: Re: Error in Subs.php, line 3936, in every click
Post by: N3RVE on August 14, 2009, 09:25:39 PM
Out of curiosity, did you have this (http://www.simplemachines.org/community/index.php?topic=329609) mod installed? It seems you're missing variable from the language files at ./Themes/default/languages
Which mods do you have installed?

-[n3rve]
Title: Re: Error in Subs.php, line 3936, in every click
Post by: leftezi on August 14, 2009, 10:00:54 PM
I have only this three mods:

1.     Global Headers Footers     2.0
2.    Ad Managment    2.3.5
3.    YouTube BBCode    2.5.1
Title: Re: Error in Subs.php, line 3936, in every click
Post by: Arantor on August 16, 2009, 08:03:38 PM
Which theme are you using?
Title: Re: Error in Subs.php, line 3936, in every click
Post by: leftezi on August 16, 2009, 09:22:47 PM
WorkDesk from Bloc
Title: Re: Error in Subs.php, line 3936, in every click
Post by: Arantor on August 16, 2009, 09:37:05 PM
I suspect the theme is missing some language strings. Compare the files from Themes/default/languages and Themes/WorkDesk/languages (or whatever the folder is called). It's not a free theme so I can't see it unfortunately.
Title: Re: Error in Subs.php, line 3936, in every click
Post by: leftezi on August 16, 2009, 10:32:54 PM
I have turned my profile in English an tried some clicks, the errors are here again (from me).
The error is produced when i click in a thread title (from a board index) to read it.
Title: Re: Error in Subs.php, line 3936, in every click
Post by: Arantor on August 16, 2009, 10:35:16 PM
I don't think it matters what language you're using. It's missing some information - please check between the default and your current theme - to see if there's more in one than the other.
Title: Re: Error in Subs.php, line 3936, in every click
Post by: leftezi on August 16, 2009, 10:42:09 PM
Yes i checked that. The difference is huge.
In the default theme are more than 60 files an in the WorkDesk theme only two: Settings.english.php and ThemeStrings.english.php with very few data. Only about 10 - 15 lines.
Title: Re: Error in Subs.php, line 3936, in every click
Post by: leftezi on August 16, 2009, 10:48:25 PM
I think you have right. It has something to do with the theme.
I have turned the forum in default theme and it produces no errors.

Is there a way to find what causes that?
Title: Re: Error in Subs.php, line 3936, in every click
Post by: Arantor on August 16, 2009, 10:49:28 PM
Right, that means it's using the language files in the default theme, which is good.

What you need to do now is compare the contents of Settings.english.php and ThemeStrings.english.php from the WorkDesk theme with those in the default theme.
Title: Re: Error in Subs.php, line 3936, in every click
Post by: leftezi on August 16, 2009, 11:09:32 PM
There are differences but i don't know what that means.

The settings.english.php from the default theme:

<?php
// Version: 2.0 RC1; Settings

// Important! Before editing these language files please read the text at the top of index.english.php.

global $settings;

$txt['theme_thumbnail_href'] = $settings['images_url'] . '/thumbnail.gif';
$txt['theme_description'] = 'The default theme from Simple Machines.<br /><br />Thanks go to Bloc and the design team.';

?>


The settings.english.php from the WorkDesk theme:

<?php
// Version: 1.1; Settings

// Important! Before editing these language files please read the text at the top of index.english.php.

$txt['theme_thumbnail_href'] = $settings['images_url'] . '/thumbnail.jpg';
$txt['theme_description'] = 'WorkDesk is a premium theme by <a href="mailto:bloc@tinyportal.net">Bloc</a>. 
For more information about this and other premium themes visit <a target="_blank" href="http://www.tinyportal.net">Tinyportal.net</a>.'
;

?>



The ThemeStrings.english.php from the WorkDesk theme (this file does not exist in default theme):

<?php
// Version: 1.1; ThemeStrings

// Important! Before editing these language files please read the text at the top of index.english.php.

$txt['phobos_sticky'] = 'Sticky topics';
$txt['phobos_normal'] = 'Normal topics';


?>



And the warning from the index.english.php

// Version: 2.0 RC1; index.english.php

/* Important note about language files in SMF 2.0 upwards:
1) All language entries in SMF 2.0 are cached. All edits should therefore be made through the admin menu. If you do
   edit a language file manually you will not see the changes in SMF until the cache refreshes. To manually refresh
   the cache go to Admin => Maintenance => Clean Cache.

2) Please also note that strings should use single quotes, not double quotes for enclosing the string
   except for line breaks.

*/

Title: Re: Error in Subs.php, line 3936, in every click
Post by: leftezi on August 22, 2009, 02:46:11 PM
Any help?
My database grows up about every click and i have to clear it out frequently.
Title: Re: Error in Subs.php, line 3936, in every click
Post by: Arantor on August 26, 2009, 08:12:47 AM
Did you add any tabs to the menu?
Title: Re: Error in Subs.php, line 3936, in every click
Post by: leftezi on August 26, 2009, 08:25:09 AM
As you can see, no: (link removed)
Title: Re: Error in Subs.php, line 3936, in every click
Post by: Arantor on August 26, 2009, 08:28:05 AM
I didn't know if you'd added anything that non-signed-in users could see but I also don't know the language.

Please attach your Subs.php file here so we can take a look at it.
Title: Re: Error in Subs.php, line 3936, in every click
Post by: leftezi on August 26, 2009, 08:38:14 AM
Here is it.

(removed - i have updated to RC1.2)
Title: Re: Error in Subs.php, line 3936, in every click
Post by: Norv on August 26, 2009, 08:42:37 AM
Is the WorkDesk theme for SMF 1.1.x ? One of the codes you quoted above seems to say so.
Title: Re: Error in Subs.php, line 3936, in every click
Post by: leftezi on August 26, 2009, 08:44:41 AM
No, its for 2.0 RC1
Title: Re: Error in Subs.php, line 3936, in every click
Post by: leftezi on September 01, 2009, 10:16:49 PM
I have updated the forum in 2.0 RC 1.2 but the error remains
Here is my new file:
Title: Re: Error in Subs.php, line 3936, in every click
Post by: Arantor on September 20, 2009, 04:57:12 PM
Is this still a problem?

It's not anything wrong with Subs.php that I can immediately see though.

Also, if you remove the mods one by one, does that make the issue go away?
Title: Re: Error in Subs.php, line 3936, in every click
Post by: leftezi on September 20, 2009, 05:55:26 PM
As i said
Quote from: leftezi on August 16, 2009, 10:48:25 PM
I think you have right. It has something to do with the theme.
I have turned the forum in default theme and it produces no errors.

I think i have to live with it for a while.  :-[
Title: Re: Error in Subs.php, line 3936, in every click
Post by: Arantor on September 20, 2009, 06:01:53 PM
As this is a premium theme you should actually be entitled to support from the author.
Title: Re: Error in Subs.php, line 3936, in every click
Post by: leftezi on September 20, 2009, 06:26:18 PM
I think you have right. I will.
Should i mark this as solved?
Title: Re: Error in Subs.php, line 3936, in every click
Post by: Arantor on September 20, 2009, 06:27:52 PM
Not if it isn't solved. Ask over on the site for the theme, but if that doesn't work out we'll see what we can do here.

If you get an answer on the site for this problem, please then do mark it solved.

Either way please let us know how it goes.
Title: Re: Error in Subs.php, line 3936, in every click
Post by: leftezi on October 04, 2009, 01:58:32 PM
It was a theme issue.
I contacted the author. He will correct this.

Thank you for your help.