TP-Docs
HTML5 Icon HTML5 Icon HTML5 Icon
TP on Social Media

Recent

Welcome to TinyPortal. Please login or sign up.

May 17, 2024, 04:28:02 PM

Login with username, password and session length
Members
  • Total Members: 3,886
  • Latest: Grendor
Stats
  • Total Posts: 195,189
  • Total Topics: 21,220
  • Online today: 98
  • Online ever: 3,540 (September 03, 2022, 01:38:54 AM)
Users Online
  • Users: 1
  • Guests: 68
  • Total: 69
  • tino

Lot of errors in log with href & title

Started by Nolt, November 12, 2013, 04:54:11 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Nolt

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.

IchBin

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']);


Nolt

#2
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.

IchBin

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?

Nolt

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.

IchBin

Then you can put the unset() right after the array is created in the Sources file.

Nolt

Seems it doesnt work or I put it in wrong place.

DeVIL-I386

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.

IchBin

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';

Nolt

 O0
Thank you very much, work like a charm.