I'm having a lot of errors in my log

Started by tonnybarros, March 17, 2010, 07:47:49 PM

Previous topic - Next topic

Kill Em All

Re-upload your old Subs.php to the server for now. :(

Sorry


My Site: KEAGaming.com

Manual Installation of Mods
Prevent Spam and Forum Attacks
Please do not PM or email me for support unless offered, help should be publicly displayed to others.


tonnybarros

Hello, do not even have to solve? I have to remove the buttons?

nend

lol, haven't been on here for a while but I was looking for a answer to your exact same problem. The code in the subs can be perfect as can be but SMF set a bad example on the template for the default theme and I am sure every other them is almost based off from it.

Here is your problem.

When you have a menu active_button is used, ok when you have a child of that menu active_button is not used, but for some strange reason when you have a grandchild at the very end of the menu active_button is used.

Easy fix I did.

This code in your index.template.php
foreach ($childbutton['sub_buttons'] as $grandchildbutton)
echo '
<li>
<a', $grandchildbutton['active_button'] ? ' class="active"' : '', ' href="', $grandchildbutton['href'], '"', isset($grandchildbutton['target']) ? ' target="' . $grandchildbutton['target'] . '"' : '', '>
<span', isset($grandchildbutton['is_last']) ? ' class="last"' : '', '>', $grandchildbutton['title'], '</span>
</a>
</li>';


Change it to
foreach ($childbutton['sub_buttons'] as $grandchildbutton)
echo '
<li>
<a href="', $grandchildbutton['href'], '"', isset($grandchildbutton['target']) ? ' target="' . $grandchildbutton['target'] . '"' : '', '>
<span', isset($grandchildbutton['is_last']) ? ' class="last"' : '', '>', $grandchildbutton['title'], '</span>
</a>
</li>';


Go figure it isn't like anyone is going to notice a active grandchild menu button right off the back. It is a minor SMF theme bug I think.  ;)

ʟink

#24
nend, I was searching for a solution to this error message, as well. Your solution fixed my problem; my error log is once again clean. Thanks! ;D
Obedire est vivere, Vivere est obedire


nend

Glad I could help. :D

I have also reported this as a bug in the bugs section of the forum. Still waiting on a response though on that thread. Apparently it looks like a bug, unless someone can prove me otherwise. I severely doubt they wanted a active grandchild button, but think this is the result of the copy and paste method of coding. Nothing wrong with that, I do it from time to time myself.

But as more people expand their menu systems from the child level to the grandchild level the more support request that are going to flood into here. This bug however is at the theme level and not in the sources and have no effect on forum performance besides a annoying error in the error logs.

Comes to another point though, allot of themes are based on the SMF default theme, so allot of theme developers will have to change their themes also. Just a small code patch, no big deal.  ;D

All in all this problem is very minor. Annoyance though, but minor.

Advertisement: