ShoutBox!

 

Ken

2021 Oct 13 11:14:20
Captain Kirk is now officially an Astronaut!!!  :heart: 😍
 

Ken

2021 Oct 09 05:09:32
 

Ken

2021 Aug 14 04:29:02
... a little late, but what the hey!  laughing7

 

Ken

2021 Aug 06 07:47:47
 

Ken

2021 Jul 30 22:30:30
 

Ken

2021 Jul 02 09:38:25
Hahahaha!  :banana:
 

Skhilled

2021 Jul 02 08:15:50
It's that day again. :)
 

Skhilled

2021 Jun 19 11:22:12
LOL
 

Ken

2021 Jun 18 15:07:53
 

Ken

2021 Jun 15 09:36:59
Just chillin  laughing7

Recent Topics

Author Topic: TinyPortal Navigation Button  (Read 1982 times)

0 Members and 1 Guest are viewing this topic.

Offline Ken (OP)

  • Vietnam Era Veteran
  • Administrator
  • *
  • Posts: 10214
  • Gender: Male
  • View Gallery
TinyPortal Navigation Button
« on: December 09, 2018, 07:42:30 AM »
BigGuy started a topic over on TP about adding an Articles link under the TinyPortal navigation button and I'm trying to get it to work here.
https://www.tinyportal.net/index.php?topic=36205.0

So far I've tried two different sets of code and both throw errors, the latest one throws this error:
Quote
syntax error, unexpected '=>' (T_DOUBLE_ARROW)

Code goes in TPSubs.php
The code:
Code: [Select]
'articles' => array(
'title' => $txt['tp-articles'],
'href' => $scripturl . '?cat=ga',
'show' => !$user_info['is_guest'],
'sub_buttons' => array(
),
),
"Not all who wander are lost."-Tolkien
Yesterday When I was Young.

Offline Skhilled

  • Administrator
  • *
  • Posts: 6771
  • Gender: Male
  • Once you stop trying to learn, you stop living!
  • View Gallery
    • Buildz Hosting
Re: TinyPortal Navigation Button
« Reply #1 on: December 09, 2018, 07:55:06 AM »
First, the select link for selecting the code shown doesn't work for me. I'm using FF. I get the same at TP. I just didn't want to forgot to mention that...

Second, do you use the code Geoff used?

Code: [Select]
   if($context['user']['is_logged'])
        $buts['articles'] = array(
            'title' => $txt['tp-articles'],
            'href' => 'https://www.whatsurbeef.net/index.php?cat=ga',
            'show' => true,
            'active_button' => false,
            'sub_buttons' => array(),
        );

Offline Ken (OP)

  • Vietnam Era Veteran
  • Administrator
  • *
  • Posts: 10214
  • Gender: Male
  • View Gallery
Re: TinyPortal Navigation Button
« Reply #2 on: December 09, 2018, 08:04:38 AM »
I tried his code (using the OFF address) and it threw a blank page.

Maybe the 'https://www.ourfamilyforum.org/FamilyForum/index.php' should be dropped and just use the '?cat=ga'
"Not all who wander are lost."-Tolkien
Yesterday When I was Young.

Offline Skhilled

  • Administrator
  • *
  • Posts: 6771
  • Gender: Male
  • Once you stop trying to learn, you stop living!
  • View Gallery
    • Buildz Hosting
Re: TinyPortal Navigation Button
« Reply #3 on: December 09, 2018, 08:06:23 AM »
Maybe there's a conflict somewhere?

Offline Ken (OP)

  • Vietnam Era Veteran
  • Administrator
  • *
  • Posts: 10214
  • Gender: Male
  • View Gallery
Re: TinyPortal Navigation Button
« Reply #4 on: December 09, 2018, 08:16:39 AM »
I tried his code (using the OFF address) and it threw a blank page.

Maybe the 'https://www.ourfamilyforum.org/FamilyForum/index.php' should be dropped and just use the '?cat=ga'

Just tried this and got the error page:
Quote
syntax error, unexpected '=>' (T_DOUBLE_ARROW)
"Not all who wander are lost."-Tolkien
Yesterday When I was Young.

Offline Skhilled

  • Administrator
  • *
  • Posts: 6771
  • Gender: Male
  • Once you stop trying to learn, you stop living!
  • View Gallery
    • Buildz Hosting
Re: TinyPortal Navigation Button
« Reply #5 on: December 09, 2018, 08:46:52 AM »
Show me the code where you add it plus a 10 lines or so above and below the code.

Offline Ken (OP)

  • Vietnam Era Veteran
  • Administrator
  • *
  • Posts: 10214
  • Gender: Male
  • View Gallery
Re: TinyPortal Navigation Button
« Reply #6 on: December 09, 2018, 09:11:15 AM »
In the TPSubs file @about line 241 look for "// the Articles link"
Code: [Select]
// the Articles link
   if($context['user']['is_logged'])
        $buts['articles'] = array(
            'title' => $txt['tp-articles'],
            'href' => '?cat=ga',
            'show' => true,
            'active_button' => false,
            'sub_buttons' => array(),
        );
There you'll find the latest try, plus the previous try as well, "// the Articles link #2 old"
Code: [Select]
// the Articles link #2 old
/*   if($context['user']['is_logged'])
        $buts['articles'] = array(
            'title' => $txt['tp-articles'],
            'href' => '?cat=ga',
            'show' => true,
            'active_button' => false,
            'sub_buttons' => array(),
        ); */

In the TPortal.english.php file @about line 23 look for this code:
Code: [Select]
$txt['tp-articles'] => 'Articles';
"Not all who wander are lost."-Tolkien
Yesterday When I was Young.

Offline Skhilled

  • Administrator
  • *
  • Posts: 6771
  • Gender: Male
  • Once you stop trying to learn, you stop living!
  • View Gallery
    • Buildz Hosting
Re: TinyPortal Navigation Button
« Reply #7 on: December 09, 2018, 03:07:57 PM »
The select issue seems to only be with Firefox for some reason.

Anywho, you're code is incorrect in TPortal.english.php. This:

Code: [Select]
$txt['tp-articles'] => 'Articles';
Should be this:

Code: [Select]
$txt['tp-articles'] = 'Articles';
The arrow is never used in the language files that I'm aware of. Look at the other code. ;)

And in TPSubs the other code above and below it has "$scripturl" in the link like the follow and yours doesn't:

Code: [Select]
if($context['user']['is_logged'])
$buts['tpeditwonarticle'] = array(
'title' => $txt['tp-myarticles'],
'href' => $scripturl . '?action=tpmod;sa=myarticles',
'show' => true,
'active_button' => false,
'sub_buttons' => array(),
);
« Last Edit: December 09, 2018, 03:15:39 PM by Skhilled »

Offline Ken (OP)

  • Vietnam Era Veteran
  • Administrator
  • *
  • Posts: 10214
  • Gender: Male
  • View Gallery
Re: TinyPortal Navigation Button
« Reply #8 on: December 10, 2018, 10:59:11 AM »
Lost my internet connection mid-day yesterday due to the snow storm and it's just now back on, but kind of in and out. I'll try to get back on the articles link soon.
"Not all who wander are lost."-Tolkien
Yesterday When I was Young.

Offline Ken (OP)

  • Vietnam Era Veteran
  • Administrator
  • *
  • Posts: 10214
  • Gender: Male
  • View Gallery
Re: TinyPortal Navigation Button
« Reply #9 on: December 10, 2018, 11:59:04 AM »
Just had this interchange with BigGuy over on TP:
OK, it's sorted now, but the "?cat=ga" throws an error page so the 'ga' needs to be changed. I'll play with it a little to see what works.

Error:
Quote
The category doesn't exist.

Rename a category to General Articles.

Ah! Ha! Progress.
There was already a category called 'General articles' so I renamed it to 'General Articles' but that didn't change anything. But, while in that screen I noticed that the Short name option was blank so 'ga' was added and that fixed the link. Now it's just a matter of refining what gets displayed when the link is clicked. 

Thanks BigGuy. O0

I'm also going to look at your code Steve, the link needs to be refined to give more detail.
"Not all who wander are lost."-Tolkien
Yesterday When I was Young.