TP-Docs
HTML5 Icon HTML5 Icon HTML5 Icon
TP on Social Media

Recent

Welcome to TinyPortal. Please login or sign up.

March 29, 2024, 05:16:53 AM

Login with username, password and session length
Members
Stats
  • Total Posts: 195,105
  • Total Topics: 21,213
  • Online today: 310
  • Online ever: 3,540 (September 03, 2022, 01:38:54 AM)
Users Online
  • Users: 0
  • Guests: 262
  • Total: 262

Where to change the treelink name?

Started by jotade29, January 01, 2022, 06:30:18 AM

Previous topic - Next topic

0 Members and 2 Guests are viewing this topic.

jotade29

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.


@rjen

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
Running Latest TP on SMF2.1 at: www.fjr-club.nl

@rjen

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

Running Latest TP on SMF2.1 at: www.fjr-club.nl

jotade29

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


@rjen

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