Link to my forum: http://www.wizzi.pl
SMF version: SMF 2.0.6
TP version: TP 1.0
Default Forum Language: Polish
Theme name and version: Blue-Moon (Gamer Theme modification)
Browser Name and Version: Chrome
Mods installed: screen attached
Related Error messages: screen attached
Well I got lot of errors in mine log, I found what is the reason but I dont know how to fix it. These error shows on any theme when I have this code in Subs.php file.
$buttons = array(
'home' => array(
'title' => $txt['home'],
'href' => $scripturl,
'show' => true,
'sub_buttons' => array(
),
'is_last' => $context['right_to_left'],
),
/* 'forum' => array(
'title' => isset($txt['tp-forum']) ? $txt['tp-forum'] : 'Forum',
'href' => $scripturl . '?action=forum',
'show' => true,
), */
'download' => array(
'title' => $txt['custom_download'],
'href' => $scripturl . '?action=tpmod;dl',
'show' => true,
),
When I uncomment code of forum button logs are clear. BTW when I change show parametr to false (in Forum button code) errors are back again.
Hey Nolt, good to see you again!
So I'm a bit confused. You are saying when the forum button is NOT commented out that you get no errors? But when you deactivate the button (comment it out) you get errors?
And why do you need to comment out the button? Does it behave the same if you unset() the forum button? You can do this either in the Sources file where the menu array is, or you can do it in the index.template right before it loops over the menu array.
In template you could add this right before it does foreach() on menu array.
unset($context['menu_buttons']['forum']);
Hi,
I wanna deactivate it because I left behind front page with articles and now (in TP options) site is redirecting directly to the forum index. So at now I got buttons > Home, Forum (now do the same work) Download, Help etc.
I comment part of code just to hide the button but unfortunately lot of errors has been generated in mine logs. If I uncommented "forum" button code and it appears as usually logs was clean.
Besides turning it off with parametr 'show' => false, should do the same thing like comment but errors are genereted. I thought its maybe a theme bug so I chagned to another one, but still errors are present.
EDIT:
I just tried with clean SMF+TP install and with code in Subs.php (default SMF+TP options)
'forum' => array(
'title' => isset($txt['tp-forum']) ? $txt['tp-forum'] : 'Forum',
'href' => $scripturl . '?action=forum',
'show' => false, // I changed this only
),
Logs are generating same errors Undefined index: title or Undefined index: title.
I haven't had the time to test this out for you sorry. But did you try the unset() option instead of commenting code out?
Not yet, I will give a try and update this message. But I think it will work only for theme which I use now, unfortunately this error shows on all installed themes.
Then you can put the unset() right after the array is created in the Sources file.
Seems it doesnt work or I put it in wrong place.
You can hide this entry if you
li#button_forum {
visibility:hidden !important;
display:none !important;
}
adding in your "./Themes/Blue-Moon/css/index.css".
EDIT: Sorry. I just see that you are doing to the error log.
Ok, finally had some time to debug. :D
You need to comment out or remove this code in Subs.php:
elseif (isset($_GET['board']) || isset($_GET['topic']))
$current_action = 'forum';
O0
Thank you very much, work like a charm.