TinyPortal

Development => Support => Topic started by: jotade29 on January 01, 2022, 06:30:18 AM

Title: Where to change the treelink name?
Post by: jotade29 on January 01, 2022, 06:30:18 AM
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.

Title: Re: Where to change the treelink name?
Post by: @rjen on January 01, 2022, 03:58:20 PM
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:


// 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
Title: Re: Where to change the treelink name?
Post by: @rjen on January 01, 2022, 04:29:12 PM
Hmm, to make it better (and allow language dependent texts to be picked up correctly) you can make another change..

Change

// 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

// 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'));

Title: Re: Where to change the treelink name?
Post by: jotade29 on January 01, 2022, 07:08:56 PM
Quote from: @rjen on January 01, 2022, 04:29:12 PM
Hmm, to make it better (and allow language dependent texts to be picked up correctly) you can make another change..

Change

// 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

// 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!!

Title: Re: Where to change the treelink name?
Post by: @rjen on January 01, 2022, 07: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