Login  |  Register
HTML5 Icon HTML5 Icon HTML5 Icon
TP on Social Media

Recent

Welcome, Guest. Please login or register.
Did you miss your activation email?

May 24, 2022, 01:44:29 PM

Login with username, password and session length
Members
Stats
  • Total Posts: 193371
  • Total Topics: 21076
  • Online today: 58
  • Online ever: 1035
  • (November 26, 2020, 04:45:12 AM)
Users Online
Users: 0
Guests: 50
Total: 50

Author Topic: Where to change the treelink name?  (Read 394 times)

0 Members and 1 Guest are viewing this topic.

Offline jotade29

  • Jr. Member
  • **
  • Posts: 5
Where to change the treelink name?
« on: December 31, 2021, 11:30:18 PM »
Hi, when I install the TinyPortal, the forum moves to action: index.php? Action = forum. I would like to know how I can modify the name of 'forum' in the treelink. Attached screenshot to indicate better.


Offline @rjen

  • Support Team
  • *
  • Posts: 3236
    • FJR-club Nederland
Re: Where to change the treelink name?
« Reply #1 on: January 01, 2022, 08:58:20 AM »
First thing we have to know is what SMF version and what TP version you are using...

I just checked it and in SMF2.0.x using TinyPortal 2.1.1 you need to check the load.php file:

an edit is made there with this code:

Code: [Select]
// Assume they are not a moderator.
$user_info['is_mod'] = false;
$context['user']['is_mod'] = &$user_info['is_mod'];

// Start the linktree off empty..not quite, have to insert forum
$context['linktree'] = array(array('url' => $scripturl . '?action=forum', 'name' => isset($txt['tp-forum']) ? $txt['tp-forum'] : 'Forum'));

// Have they by chance specified a message id but nothing else?

The linktree should use the language key that is found in the file:  Tportal.english.php
// Various
$txt['tp-forum'] = 'Forum';

But due to a bug this does not work, change the string 'Forum' in Load.php

In SMF2.1 changing the text string in Tportal.english.php (or Tportal.yourlanguage.php) does the trick
Running Latest TP on SMF2.1 at: www.fjr-club.nl

Testing TP on SMF2.0
Testing TP on SMF2.1 (latest Github)
Want to check what php version I am testing on? See: PHP Info

Offline @rjen

  • Support Team
  • *
  • Posts: 3236
    • FJR-club Nederland
Re: Where to change the treelink name?
« Reply #2 on: January 01, 2022, 09:29:12 AM »
Hmm, to make it better (and allow language dependent texts to be picked up correctly) you can make another change..

Change
Code: [Select]
// Assume they are not a moderator.
$user_info['is_mod'] = false;
$context['user']['is_mod'] = &$user_info['is_mod'];

// Start the linktree off empty..not quite, have to insert forum
$context['linktree'] = array(array('url' => $scripturl . '?action=forum', 'name' => isset($txt['tp-forum']) ? $txt['tp-forum'] : 'Forum'));

to
Code: [Select]
// Assume they are not a moderator.
$user_info['is_mod'] = false;
$context['user']['is_mod'] = &$user_info['is_mod'];

// load language file
if(loadLanguage('TPortal') == false) {
loadLanguage('TPortal', 'english');
    }

// Start the linktree off empty..not quite, have to insert forum
$context['linktree'] = array(array('url' => $scripturl . '?action=forum', 'name' => isset($txt['tp-forum']) ? $txt['tp-forum'] : 'Forum'));
Running Latest TP on SMF2.1 at: www.fjr-club.nl

Testing TP on SMF2.0
Testing TP on SMF2.1 (latest Github)
Want to check what php version I am testing on? See: PHP Info

Offline jotade29

  • Jr. Member
  • **
  • Posts: 5
Re: Where to change the treelink name?
« Reply #3 on: January 01, 2022, 12:08:56 PM »
Hmm, to make it better (and allow language dependent texts to be picked up correctly) you can make another change..

Change
Code: [Select]
// Assume they are not a moderator.
$user_info['is_mod'] = false;
$context['user']['is_mod'] = &$user_info['is_mod'];

// Start the linktree off empty..not quite, have to insert forum
$context['linktree'] = array(array('url' => $scripturl . '?action=forum', 'name' => isset($txt['tp-forum']) ? $txt['tp-forum'] : 'Forum'));

to
Code: [Select]
// Assume they are not a moderator.
$user_info['is_mod'] = false;
$context['user']['is_mod'] = &$user_info['is_mod'];

// load language file
if(loadLanguage('TPortal') == false) {
loadLanguage('TPortal', 'english');
    }

// Start the linktree off empty..not quite, have to insert forum
$context['linktree'] = array(array('url' => $scripturl . '?action=forum', 'name' => isset($txt['tp-forum']) ? $txt['tp-forum'] : 'Forum'));

Perfect, this work perfect!! U are fantastic!!


Offline @rjen

  • Support Team
  • *
  • Posts: 3236
    • FJR-club Nederland
Re: Where to change the treelink name?
« Reply #4 on: January 01, 2022, 12:46:20 PM »
No probs , it’s a bug that is at least 3 years old already… we should really fix that for the next release
Running Latest TP on SMF2.1 at: www.fjr-club.nl

Testing TP on SMF2.0
Testing TP on SMF2.1 (latest Github)
Want to check what php version I am testing on? See: PHP Info