News:

Bored?  Looking to kill some time?  Want to chat with other SMF users?  Join us in IRC chat or Discord

Main Menu

Error in Subs.php, line 3936, in every click

Started by leftezi, August 12, 2009, 01:37:36 PM

Previous topic - Next topic

leftezi

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?


N3RVE

Out of curiosity, did you have this mod installed? It seems you're missing variable from the language files at ./Themes/default/languages
Which mods do you have installed?

-[n3rve]
Ralph "[n3rve]" Otowo
Former Marketing Co-ordinator, Simple Machines.
ralph [at] simplemachines [dot] org                       
Quote"Somewhere, something incredible is waiting to be known." - Carl Sagan

leftezi

I have only this three mods:

1.     Global Headers Footers     2.0
2.    Ad Managment    2.3.5
3.    YouTube BBCode    2.5.1

Arantor


leftezi

#4
WorkDesk from Bloc

Arantor

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.

leftezi

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.

Arantor

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.

leftezi

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.

leftezi

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?

Arantor

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.

leftezi

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:[email protected]">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.

*/


leftezi

Any help?
My database grows up about every click and i have to clear it out frequently.

Arantor


leftezi

#14
As you can see, no: (link removed)

Arantor

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.

leftezi

#16
Here is it.

(removed - i have updated to RC1.2)

Norv

Is the WorkDesk theme for SMF 1.1.x ? One of the codes you quoted above seems to say so.
To-do lists are for deferral. The more things you write down the later they're done... until you have 100s of lists of things you don't do.

File a security report | Developers' Blog | Bug Tracker


Also known as Norv on D* | Norv N. on G+ | Norv on Github

leftezi


leftezi

I have updated the forum in 2.0 RC 1.2 but the error remains
Here is my new file:

Advertisement: