dragomano / Light-Portal

A fancy portal mod for SMF 2.1.x
https://custom.simplemachines.org/index.php?mod=4244
GNU General Public License v3.0
16 stars 3 forks source link

Who's Online - placeholder issue if viewing the board index #240

Open Darknico opened 2 weeks ago

Darknico commented 2 weeks ago

Describe the bug (Опишите баг) If an user is viewing the board index, the placeholder not work correctly

To Reproduce (Как воспроизвести, по шагам) Steps to reproduce the behavior:

  1. Go to Who's Online
  2. Check the list.

Expected behavior (Ожидаемое поведение — что хотели получить вместо бага) The correct string, for example "Viewing the board index of My Forum"

Screenshots immagine

Environment

Darknico commented 2 weeks ago

I fixed in my forum with this edit:

file: /Sources/LightPortal/Hooks/WhosOnline.php

Search:

    if ($actions['action'] === 'forum') {
        $result = Lang::getTxt('who_index', [
            Config::$scripturl . '?action=forum',
            Utils::$context['forum_name']
        ]);
    }

Replace with:

    if ($actions['action'] === 'forum') {
        $result = sprintf(
            Lang::$txt['who_index'],
            Config::$scripturl . '?action=forum',
            Utils::$context['forum_name']
        );
    }
Darknico commented 2 weeks ago

Fix tested and work correctly :+1: