SMF Support > SMF 2.0.x Support

Undefined variable: default_theme_url error

(1/2) > >>

Texan78:
Hello,

I have done a search for this problem and it has turned up a lot but nothing really focusing on what I am experiencing.

This is what I am getting in my error logs and the only thing that shows up. Minor issue, but would like to get it resolved before launching so I have no errors. I have disabled eval and this is what I get.


--- Code: ---8: Undefined variable: default_theme_url
Apply Filter: Only show the errors from this file
File: /XXXXXX/XXXXXX/public_html/weatherconnection/Themes/default/index.template.php
Line: 437 
--- End code ---

I am also getting the same error on line 439.

This is starting at line 437-441


--- Code: --- !empty($modSettings['xmlnews_enable']) && (!empty($modSettings['allow_guestAccess']) || $context['user']['is_logged']) ? '<li>|&nbsp;&nbsp;<a id="button_rss" href="' . $scripturl . '?action=.xml;type=rss" class="new_win"><span>RSS </span></a><img src="' . $default_theme_url . '/Themes/default/images/rss.png"></li>' : '', '<li>|&nbsp;&nbsp;<a id="button_wap2" href="', $scripturl , '?wap2" class="new_win"><span>WAP 2 </span></a><img src="/Themes/default/images/icons/mobile2.gif"></li>
<li>|&nbsp;&nbsp;<a href="http://www.twitter.com/WxConnection" target="_blank"><span>Twitter </span></a><img src="', $settings['default_theme_url'], '/images/icons/twitter1.png" alt="Visit Our Twitter Page" height="15" width="15" border="0"></li>
<li class="last">|&nbsp;&nbsp;<a href="http://www.facebook.com/WeatherConnectionForum" target="_blank"><span>Facebook </span></a><img src="', $settings['default_theme_url'], '/images/icons/facebook.png" alt="Visit Our Facebook Page" height="15" width="15" border="0"></li></ul><br />';
--- End code ---

Here is line 437, what gets me is all that extra after the last </li>


--- Code: ---, !empty($modSettings['xmlnews_enable']) && (!empty($modSettings['allow_guestAccess']) || $context['user']['is_logged']) ? '<li>|&nbsp;&nbsp;<a id="button_rss" href="' . $scripturl . '?action=.xml;type=rss" class="new_win"><span>RSS </span></a><img src="' . $default_theme_url . '/Themes/default/images/rss.png"></li>' : '', '
--- End code ---

Here is line 439


--- Code: ---<li>|&nbsp;&nbsp;<a href="http://www.twitter.com/WxConnection" target="_blank"><span>Twitter </span></a><img src="', $settings['default_theme_url'], '/images/icons/twitter1.png" alt="Visit Our Twitter Page" height="15" width="15" border="0"></li>
--- End code ---

I believe it has something to do with ', $settings['default_theme_url'], ' and ' . $default_theme_url . ' but I am not sure as to what. I have played around with it and have gotten some of the errors removed, but these two are still remaining. Any suggestions?

-Thanks

Chas Large:
I'm guessing here but as "twitter" is mentioned in those lines, you have a mod installed which allows members to share stuff on other fora / networks?

If this is the case, it could be that mod has introduced some rogue "undefined" code which is not being found correctly, hence the error messages.

Two fixes, try uninstalling the mod on a temporary basis, clear your site's cache and see if the errors go away. If they do then get in touch with the mod support topic (see the mod's download page) and report the issue, the mod builder is the best person to fix it.

It could be that an upgrade has caused errors in the code if you've recently upgraded from an older version, especially if you have mods installed, some code may not have been overwritten with the newer code. Download and expand the latest full version of SMF locally and compare the code lines with your site's code, you may find a subtle difference which you can hand code back to correct the issue.

Texan78:
The twitter that is mentioned is not from a mod. It is just a small twitter icon that is in my footer that I have that links to the forums twitter page that I added. I remove that line and the error for that line goes away. So I am guessing it is how that line is formatted?



I haven't upgraded from a older version. I have been running 2.0.2 since the start.

It also appears like the error on line 439 which is the link with that twitter icon has disappeared. This is the only line with the error now.


--- Code: ---, !empty($modSettings['xmlnews_enable']) && (!empty($modSettings['allow_guestAccess']) || $context['user']['is_logged']) ? '<li>|&nbsp;&nbsp;<a id="button_rss" href="' . $scripturl . '?action=.xml;type=rss" class="new_win"><span>RSS </span></a><img src="' . $default_theme_url . '/Themes/default/images/rss.png"></li>' : '', '
--- End code ---

-Thanks

Chas Large:
Can you post a copy (as an attachment) of your index.template.php file so I can check and test it?

Texan78:
I sure can, I have attached it below.

-Thanks

Navigation

[0] Message Index

[#] Next page

Go to full version