News: When asking for support, it helps us and you, if you read the Posting Guidelines

Login  |  Register
HTML5 Icon HTML5 Icon HTML5 Icon
TP on Social Media
Welcome, Guest. Please login or register.
Did you miss your activation email?

April 02, 2020, 12:08:12 PM

Login with username, password and session length

Recent

Members
Stats
  • Total Posts: 189572
  • Total Topics: 20808
  • Online Today: 625
  • Online Ever: 917
  • (January 21, 2020, 09:02:26 AM)
Users Online
Users: 0
Guests: 46
Total: 46

Author Topic: Lot of errors in log with href & title  (Read 7351 times)

0 Members and 1 Guest are viewing this topic.

Offline Nolt

  • Beta Tester
  • *
  • Posts: 301
    • Wizzi
Lot of errors in log with href & title
« on: November 12, 2013, 09:54:11 AM »
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.
Code: [Select]
$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.
« Last Edit: November 28, 2013, 06:11:23 AM by ZarPrime »

Offline IchBin™

  • Developer
  • *
  • Posts: 16228
    • My Website
Re: Lot of errors in log with href & title
« Reply #1 on: November 12, 2013, 11:03:45 AM »
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']);


Offline Nolt

  • Beta Tester
  • *
  • Posts: 301
    • Wizzi
Re: Lot of errors in log with href & title
« Reply #2 on: November 13, 2013, 04:07:10 AM »
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)
Code: [Select]
'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.
« Last Edit: November 13, 2013, 05:30:49 AM by Nolt »

Offline IchBin™

  • Developer
  • *
  • Posts: 16228
    • My Website
Re: Lot of errors in log with href & title
« Reply #3 on: November 14, 2013, 12:03:24 PM »
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?

Offline Nolt

  • Beta Tester
  • *
  • Posts: 301
    • Wizzi
Re: Lot of errors in log with href & title
« Reply #4 on: November 14, 2013, 12:45:54 PM »
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.

Offline IchBin™

  • Developer
  • *
  • Posts: 16228
    • My Website
Re: Lot of errors in log with href & title
« Reply #5 on: November 14, 2013, 07:43:19 PM »
Then you can put the unset() right after the array is created in the Sources file.

Offline Nolt

  • Beta Tester
  • *
  • Posts: 301
    • Wizzi
Re: Lot of errors in log with href & title
« Reply #6 on: November 26, 2013, 05:01:45 AM »
Seems it doesnt work or I put it in wrong place.

Offline DeVIL-I386

  • Jr. Member
  • **
  • Posts: 27
Re: Lot of errors in log with href & title
« Reply #7 on: November 26, 2013, 03:12:12 PM »
You can hide this entry if you

Code: [Select]
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.

Offline IchBin™

  • Developer
  • *
  • Posts: 16228
    • My Website
Re: Lot of errors in log with href & title
« Reply #8 on: November 26, 2013, 10:35:54 PM »
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';

Offline Nolt

  • Beta Tester
  • *
  • Posts: 301
    • Wizzi
Re: Lot of errors in log with href & title
« Reply #9 on: November 28, 2013, 04:59:56 AM »
 O0
Thank you very much, work like a charm.