Welcome, Guest. Please login or register.

ShoutBox!

 

Skhilled

2024-03-24, 09:52:09
It may be released as early as today...if we all agree on it. ;)
 

Skhilled

2024-03-24, 09:37:46
Thank you, sir!  :)
 

Ken

2024-03-24, 09:28:38
I like it. Dark themes are not my first choice, but I like the crisp, clean lines.  :thumbup:
 

Skhilled

2024-03-24, 08:56:28
The original theme is here:

https://www.jpr62.com/demos/index.php
 

Skhilled

2024-03-24, 08:53:17
You can always see the latest previews here but registration is disabled:

https://skhilled.com/cztest/index.php
 

Ken

2024-03-24, 08:50:36
Any previews yet?
 

Skhilled

2024-03-24, 08:46:18
We almost have another theme completed.  :laugh:
 

Skhilled

2024-03-24, 08:45:18
What's up, bro?  :drinking:
 

Ken

2024-03-24, 08:42:45
Hi Steve.  :)
 

Skhilled

2024-02-21, 21:11:25
I missed that one. LOL

Recent Topics

TP Articles


Search in titles
Search in article texts

Author Topic: TinyPortal Navigation Button  (Read 4548 times)

0 Members and 1 Guest are viewing this topic.

Offline Ken (OP)

  • Vietnam Era Veteran
  • Administrator
  • *
  • Posts: 11657
  • 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: 8972
  • 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: 11657
  • 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: 8972
  • 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: 11657
  • 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: 8972
  • 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: 11657
  • 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: 8972
  • 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: 11657
  • 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: 11657
  • 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.