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
17 stars 3 forks source link

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

Closed Darknico closed 1 month ago

Darknico commented 2 months 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 months 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 months ago

Fix tested and work correctly :+1: