Undefined errors

Started by arreferee, July 10, 2018, 10:45:31 AM

Previous topic - Next topic

arreferee

I'm getting tons of undefined errors on my forum.  I cleaned out the error log and had over 100 in just a few minutes.  Here are a couple of examples.  How can these be fixed?

membername
111.111.111.111 
Today at 09:39:43 AM
c257d0816b807f5351e49d2b866e2a11
Type of error: Undefined
http://www.sitename.com/forum/index.php?
8: Undefined offset: 334
File: /home/abcdef/public_html/forum/Themes/default/BoardIndex.template.php
Line: 178


membername
111.111.111.111 
Today at 09:38:32 AM
cabca20782e6860fddc01732b27558d4
Type of error: Undefined
http://www.sitename.com/forum/index.php?
8: Undefined offset: 333
File: /home/abcde/public_html/forum/Themes/default/BoardIndex.template.php
Line: 164

Illori

are you using an SMF 1.1 theme on SMF 2.0? if so you cant do that.

arreferee

Quote from: Illori on July 10, 2018, 10:46:17 AM
are you using an SMF 1.1 theme on SMF 2.0? if so you cant do that.

I don't think so.  All of the themes listed look to be 2.0:

SMF Default Theme - Curve (2.0.14)
BnW (2.0)
Mobile (2.0.14)
Core Theme (2.0)

Illori

then we need you to attach the file so we can review it.

arreferee

Quote from: Illori on July 10, 2018, 10:50:29 AM
then we need you to attach the file so we can review it.

Sorry for the (possibly) dumb question, but how to I get the error log into a file that I can attach?

SychO

Quote from: arreferee on July 10, 2018, 10:52:22 AM
Sorry for the (possibly) dumb question, but how to I get the error log into a file that I can attach?

No, Attach this file
/home/abcde/public_html/forum/Themes/default/BoardIndex.template.php
Checkout My Themes:
-

Potato  •  Ackerman  •  SunRise  •  NightBreeze

spiros

If you click on the file name as displayed in the error log it will pop up a window with the lines before and after the error.

Alternatively, using FTP, just download the file in question, i.e. forum/Themes/default/BoardIndex.template.php

arreferee

#7
Quote from: spiros on July 10, 2018, 11:02:15 AM
If you click on the file name as displayed in the error log it will pop up a window with the lines before and after the error.

Alternatively, using FTP, just download the file in question, i.e. forum/Themes/default/BoardIndex.template.php

Hopefully this will work.  Here are the two most common errors:

158:
if ($board['new']) {
159:
if (file_exists($settings['theme_dir'] . '/icons/' . $board['id'] . '/on.png'))
160:
$board_new_img=$settings['theme_url']. '/icons/' . $board['id'] . '/on.png';
161:
else
162:
$board_new_img=$settings['images_url']. '/on.png';
163:
164:
echo '<img src="', $board_new_img,'" alt="', $txt[333], '" title="', $txt[333], '" border="0" />';
165:
} elseif ($board['children_new']) {
166:
if (file_exists($settings['theme_dir'] . '/icons/' . $board['id'] . '/on2.png'))
167:
$childboard_new_img=$settings['theme_url']. '/icons/' . $board['id'] . '/on2.png';
168:
else
169:
$childboard_new_img=$settings['images_url']. '/on2.png';
170:
171:
echo '<img src="', $childboard_new_img,'" alt="', $txt[333], '" title="', $txt[333], '" border="0" />';
172:
} else {
173:
if (file_exists($settings['theme_dir'] . '/icons/' . $board['id'] . '/off.png'))
174:
$board_nonew_img=$settings['theme_url']. '/icons/' . $board['id'] . '/off.png';
175:
else
176:
$board_nonew_img=$settings['images_url']. '/off.gif';
177:
==>178:
echo '<img src="', $board_nonew_img,'" alt="', $txt[334], '" title="', $txt[334], '" border="0" />';
179:
}
180:
echo '</a>
181:
</td>
182:
<td class="windowbg2">
183:
<b><a href="', $board['href'], '" name="b', $board['id'], '">', $board['name'], '</a></b>';
184:
185:
186: //end modifications for board icons
187:
188:
189:
190:
191:
192:
// Has it outstanding posts for approval?
193:
if ($board['can_approve_posts'] && ($board['unapproved_posts'] || $board['unapproved_topics']))
194:
echo '
195:
<a href="', $scripturl, '?action=moderate;area=postmod;sa=', ($board['unapproved_topics'] > 0 ? 'topics' : 'posts'), ';brd=', $board['id'], ';', $context['session_var'], '=', $context['session_id'], '" title="', sprintf($txt['unapproved_posts'], $board['unapproved_topics'], $board['unapproved_posts']), '" class="moderation_link">(!)</a><br />';
196:
197:
echo '
198:




144:
children (see below.), link_children (easier to use.), children_new (are they new?),
145:
topics (# of), posts (# of), link, href, and last_post. (see below.) */
146:
foreach ($category['boards'] as $board)
147:
{
148:
echo '
149:
<tr id="board_', $board['id'], '" class="windowbg2">
150:
<td class="icon windowbg"', !empty($board['children']) ? ' rowspan="2"' : '', '>
151:
<a href="', ($board['is_redirect'] || $context['user']['is_guest'] ? $board['href'] : $scripturl . '?action=unread;board=' . $board['id'] . '.0;children'), '">';
152:
153:
154:
155: //Start modifications for icon changes
156:
157:
// If the board is new, show a strong indicator.
158:
if ($board['new']) {
159:
if (file_exists($settings['theme_dir'] . '/icons/' . $board['id'] . '/on.png'))
160:
$board_new_img=$settings['theme_url']. '/icons/' . $board['id'] . '/on.png';
161:
else
162:
$board_new_img=$settings['images_url']. '/on.png';
163:
==>164:
echo '<img src="', $board_new_img,'" alt="', $txt[333], '" title="', $txt[333], '" border="0" />';
165:
} elseif ($board['children_new']) {
166:
if (file_exists($settings['theme_dir'] . '/icons/' . $board['id'] . '/on2.png'))
167:
$childboard_new_img=$settings['theme_url']. '/icons/' . $board['id'] . '/on2.png';
168:
else
169:
$childboard_new_img=$settings['images_url']. '/on2.png';
170:
171:
echo '<img src="', $childboard_new_img,'" alt="', $txt[333], '" title="', $txt[333], '" border="0" />';
172:
} else {
173:
if (file_exists($settings['theme_dir'] . '/icons/' . $board['id'] . '/off.png'))
174:
$board_nonew_img=$settings['theme_url']. '/icons/' . $board['id'] . '/off.png';
175:
else
176:
$board_nonew_img=$settings['images_url']. '/off.gif';
177:
178:
echo '<img src="', $board_nonew_img,'" alt="', $txt[334], '" title="', $txt[334], '" border="0" />';
179:
}
180:
echo '</a>
181:
</td>
182:
<td class="windowbg2">
183:
<b><a href="', $board['href'], '" name="b', $board['id'], '">', $board['name'], '</a></b>';
184:

Kindred

yes... somehow, you have code for a 1.1.x theme in the default for 2.0.x

there are no txt strings with numbers like that in 2.0.x
I am stunned that it works at all...

Unless you made some manual changes to the theme youself?

looking, I see a comment for... //end modifications for board icons

so, that suggests that you installed a 1.1.x mod into 2.0
That's going to cause issues...   maybe issues that you don't even see yet.

Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

spiros

Probably these are missing from your Themes/default/languages/index.english.php

$txt[333] = 'New Posts';
$txt[334] = 'No New Posts';

Illori

Quote from: spiros on July 10, 2018, 11:17:38 AM
Probably these are missing from your Themes/default/languages/index.english.php

$txt[333] = 'New Posts';
$txt[334] = 'No New Posts';


they are not present in SMF 2.0 at all, they never have as they are from SMF 1.1.*

arreferee

Quote from: Illori on July 10, 2018, 11:18:49 AM
Quote from: spiros on July 10, 2018, 11:17:38 AM
Probably these are missing from your Themes/default/languages/index.english.php

$txt[333] = 'New Posts';
$txt[334] = 'No New Posts';


they are not present in SMF 2.0 at all, they never have as they are from SMF 1.1.*

I see the following in my index.english.php file:

$txt['new_posts'] = 'New Posts';
$txt['old_posts'] = 'No New Posts';

I don't see the ones with 333 and 334 in them.

How can I fix this?

Illori

https://wiki.simplemachines.org/smf/How_to_upload_a_fresh_set_of_files would be the best way. do keep in mind you will need to reinstall any mods you have after this process has completed.

arreferee

Quote from: Illori on July 10, 2018, 11:25:51 AM
https://wiki.simplemachines.org/smf/How_to_upload_a_fresh_set_of_files would be the best way. do keep in mind you will need to reinstall any mods you have after this process has completed.

When I look at my list of installed mods, there are only 6 that are not SMF updates.  Would I only need to install those 6, or would I have to install those 6 plus the 15 SMF updates?

If I go this route, are there possibly things that I will lose from my forum through the process like themes, etc.?

Also, I'm using 2.0.15 and I don't see that listed on the download site.  It only goes up to 2.0.14.  Would I need to use 2.0.14 and then update to 2.0.15 again?

Kindred

Quote from: Kindred on July 10, 2018, 11:16:16 AM
looking, I see a comment for... //end modifications for board icons

so, that suggests that you installed a 1.1.x mod into 2.0
That's going to cause issues...   maybe issues that you don't even see yet.

Uninstall that mod.
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

spiros

QuoteI see the following in my index.english.php file:

$txt['new_posts'] = 'New Posts';
$txt['old_posts'] = 'No New Posts';

I don't see the ones with 333 and 334 in them.

How can I fix this?

Simply add the extra strings.

Kindred

No Spiros...   that only exacerbates the problem.
The problem is that the admin installed a 1.1.x mod into a 2.0.x forum.

THAT needs to be fixed (and will fix the issues, along the way)
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

arreferee

Quote from: Kindred on July 10, 2018, 01:39:25 PM
No Spiros...   that only exacerbates the problem.
The problem is that the admin installed a 1.1.x mod into a 2.0.x forum.

THAT needs to be fixed (and will fix the issues, along the way)

Is there an easy way to determine which mod is a 1.1.x?

Gary

The mod site will list compatible versions.

Some mods will combine compatibility between versions in one package, and let SMF detect that automatically, others will include separate files and post an indication in the description to what package is compatible with which version, and there's also some that will use the package's filename to determine the compatible versions.
Gary M. Gadsdon
Do NOT PM me unless I say so
War of the Simpsons
Bongo Comics Fan Forum
Youtube Let's Plays

^ YT is changing monetisation policy, help reach 1000 sub threshold.

Kindred

Quote from: arreferee on July 10, 2018, 02:05:18 PM
Is there an easy way to determine which mod is a 1.1.x?

I've alreayd TOLD you which mod -- there is a comment right in the code!!
Quote from: Kindred on July 10, 2018, 12:57:48 PM
Quote from: Kindred on July 10, 2018, 11:16:16 AM
looking, I see a comment for... //end modifications for board icons

Uninstall that mod.
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

Advertisement: