Welcome, Guest. Please login or register.

ShoutBox!

 

Skhilled

2024-08-09, 18:19:29
Awww! Poor thing! LOL
 

Ken

2024-08-09, 09:20:52
 

Skhilled

2024-07-06, 10:33:18
 :D
 

Ken

2024-07-06, 06:40:47
Happy Saturday after the 4th of July!
 :fireworks:
 

Skhilled

2024-07-04, 20:27:02
Happy Day Off From Work!  :D
 

Ken

2024-06-25, 06:23:12
84... who knew?  laughing7
...2013 was my *magic* year
 

Skhilled

2024-06-14, 22:09:12
I hope so! LOL
 

Ken

2024-06-14, 21:41:30
My B-Day is forthcoming and maybe it will be far enough along so that I can be a regular Dancing Fool for that day!!! :banana: :2funny:
 

Ken

2024-06-14, 21:38:38
Happy Friday everyone! I'm  SOOO glad to see Friday and not just because it's the weekend, but because it marks one more day in the recovery of my foot!  laughing7

Scrubmeister

2024-04-19, 10:32:40
Good to see the site back faster than ever. :)

Recent Topics

TP Articles


Search in titles
Search in article texts

Author Topic: TinyPortal Navigation Button  (Read 5694 times)

0 Members and 1 Guest are viewing this topic.

Offline Ken (OP)

  • Vietnam Era Veteran
  • Administrator
  • *
  • Posts: 11942
  • 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: 9424
  • Gender: Male
  • All of my passwords are protected by amnesia...
  • 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: 11942
  • 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: 9424
  • Gender: Male
  • All of my passwords are protected by amnesia...
  • 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: 11942
  • 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: 9424
  • Gender: Male
  • All of my passwords are protected by amnesia...
  • 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: 11942
  • 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: 9424
  • Gender: Male
  • All of my passwords are protected by amnesia...
  • 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: 11942
  • 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: 11942
  • 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.