Merge branch 'develop' into blacktek-toml

This commit is contained in:
slawkens
2026-04-24 21:44:03 +02:00
6 changed files with 23 additions and 16 deletions

View File

@@ -31,8 +31,6 @@ parameters:
- '#Call to an undefined method [a-zA-Z0-9\\_]+::[a-zA-Z0-9\\_]+\(\)#'
- '#Call to an undefined static method [a-zA-Z0-9\\_]+::[a-zA-Z0-9\\_]+\(\)#'
# system/pages/highscores.php
- '#Access to an undefined property Illuminate\\Database\\Eloquent\\Model::\$online_status#'
- '#Access to an undefined property Illuminate\\Database\\Eloquent\\Model::\$vocation_name#'
-
message: '#Variable \$tmp in empty\(\) always exists and is always falsy#'
path: templates\kathrine\javascript.php

View File

@@ -207,10 +207,14 @@ if (empty($highscores)) {
}
$highscores = $query->get()->map(function($row) {
/**
* @var Player $row
*/
$tmp = $row->toArray();
$tmp['online'] = $row->online_status;
$tmp['vocation'] = $row->vocation_name;
$tmp['outfit_url'] = $row->outfit_url; // @phpstan-ignore-line
$tmp['outfit_url'] = $row->outfit_url;
$tmp['link'] = getPlayerLink($row->name, false);
unset($tmp['online_table']);
return $tmp;
@@ -244,7 +248,6 @@ foreach($highscores as $id => &$player)
$player['experience'] = number_format($player['experience']);
}
$player['link'] = getPlayerLink($player['name'], false);
$player['flag'] = getFlagImage($player['country']);
$player['outfit'] = '<img style="position:absolute;margin-top:-50px;margin-left:-30px" src="' . $player['outfit_url'] . '" alt="" />';

View File

@@ -5,6 +5,7 @@ use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\HasOne;
/**
* @property string $name
* @property int $level
* @property int $vocation
* @property int $online
@@ -14,6 +15,9 @@ use Illuminate\Database\Eloquent\Relations\HasOne;
* @property int $looklegs
* @property int $lookfeet
* @property int $lookaddons
* @property int $promotion
* @property bool $online_status
* @property string $vocation_name
* @property string $outfit_url
* @property hasOne $onlineTable
*/

View File

@@ -890,7 +890,11 @@ class Plugins {
global $hooks;
foreach($plugin_info['hooks'] ?? [] as $name => $info) {
$hooks->unregister($name, $info['type'], $info['file']);
if (str_contains($info['type'], 'HOOK_')) {
$info['type'] = str_replace('HOOK_', '', $info['type']);
}
$hooks->unregister($name, 'HOOK_' . $info['type'], $info['file']);
}
clearCache();

View File

@@ -1,15 +1,13 @@
<?php
$topPlayers = getTopPlayers(5);
foreach($topPlayers as &$player) {
$outfit_url = '';
if (setting('core.online_outfit')) {
$outfit_url = setting('core.outfit_images_url') . '?id=' . $player['looktype'] . (!empty
($player['lookaddons']) ? '&addons=' . $player['lookaddons'] : '') . '&head=' . $player['lookhead'] . '&body=' . $player['lookbody'] . '&legs=' . $player['looklegs'] . '&feet=' . $player['lookfeet'];
$player['outfit'] = $outfit_url;
$topPlayers = Cache::remember('tibiacom_highscores_top_players', 10 * 60, function() {
$topPlayers = getTopPlayers(5);
foreach($topPlayers as &$player) {
$player['outfit'] = $player['outfit_url'];
$player['link'] = getPlayerLink($player['id'], false);
}
}
return $topPlayers;
});
$twig->display('highscores.html.twig', array(
'topPlayers' => $topPlayers

View File

@@ -44,7 +44,7 @@
<div id="Topbar" class="Themebox" style="background-image:url({{ template_path }}/images/themeboxes/highscores/highscores.png);">
<div class="top_level" style="background:url({{ template_path }}/images/themeboxes/bg_top.png)" align=" ">
{% for player in topPlayers %}
<div style="text-align:left"><a href="{{ getPlayerLink(player['name'], false) }} " class="topfont {% if player['online'] %}online{% else %}offline{% endif %}">
<div style="text-align:left"><a href="{{ player['link'] }} " class="topfont {% if player['online'] %}online{% else %}offline{% endif %}">
{% if setting('core.online_outfit') %}
<img style="position:absolute;margin-top:-45px;margin-left:-25px;" src="{{ player.outfit }}" alt="player outfit"/>
{% endif %}