Compare commits

...

10 Commits

Author SHA1 Message Date
slawkens
81b8bd8a2c News: Do not cache if logged as admin, so it shows the admin buttons 2026-04-24 22:12:53 +02:00
slawkens
def432d4b7 tibiacom theme: Fix if gallery table not exist (develop branch) 2026-04-24 22:09:14 +02:00
slawkens
b0edbb79d9 Update characters.php 2026-04-24 21:58:42 +02:00
slawkens
ba1ee4bdb7 Nothing important [skip ci] 2026-04-24 21:22:27 +02:00
slawkens
54bdea85a3 Fix phpstan 2026-04-24 20:36:56 +02:00
slawkens
ac9a328206 Highscores: Prevent mass queries amount caused by getPlayerLink 2026-04-24 16:39:55 +02:00
slawkens
609cf152af Plugins: Fix uninstall when hook is without HOOK_ prefix 2026-04-24 16:24:06 +02:00
slawkens
ec7079dd57 Bye JetBrains, it was not my decision :( 2026-04-14 19:58:12 +02:00
slawkens
fa93187f80 Add $fillable to Account model 2026-04-12 09:56:01 +02:00
slawkens
7bc8a66cc1 BugTracker has been moved to plugins, remove the model 2026-04-11 18:13:25 +02:00
10 changed files with 26 additions and 30 deletions

View File

@@ -86,12 +86,6 @@ Look: [Contributing](https://docs.my-aac.org/misc/contributing) in our wiki.
If you have a great idea or want to contribute to the project - visit our website at https://www.my-aac.org
## Project supported by JetBrains
Many thanks to Jetbrains for kindly providing a license for me to work on this and other open-source projects.
[![JetBrains](https://resources.jetbrains.com/storage/products/company/brand/logos/jb_beam.svg)](https://www.jetbrains.com/?from=https://github.com/slawkens)
### License
This program and all associated files are released under the GNU Public License.

View File

@@ -30,9 +30,6 @@ parameters:
# Eloquent models
- '#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

@@ -47,7 +47,6 @@ if(isset($_REQUEST['name']))
if(empty($name))
{
$tmp_link = getPlayerLink($name);
echo 'Here you can get detailed information about a certain player on ' . $config['lua']['serverName'] . '.<br/>';
echo generate_search_form(true);
return;

View File

@@ -210,10 +210,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;
@@ -247,7 +251,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

@@ -108,8 +108,9 @@ $title = 'Latest News';
$cache = Cache::getInstance();
$news_cached = false;
if($cache->enabled())
if($cache->enabled() && !admin()) {
$news_cached = News::getCached(NEWS);
}
if(!$news_cached)
{

View File

@@ -18,6 +18,15 @@ class Account extends Model {
public $timestamps = false;
protected $fillable = [
'name', 'number', 'email', 'password',
'key', 'created', 'rlname', 'location', 'country',
'web_lastlogin', 'web_flags',
'email_new', 'email_new_time', 'email_code',
'premium_points', 'coins', 'coins_transferable',
'premium_ends_at', 'premend', 'lastday', 'premdays',
];
protected $casts = [
'lastday' => 'integer',
'premdays' => 'integer',

View File

@@ -1,15 +0,0 @@
<?php
namespace MyAAC\Models;
use Illuminate\Database\Eloquent\Model;
class BugTracker extends Model {
protected $table = TABLE_PREFIX . 'bugtracker';
public $timestamps = false;
protected $fillable = ['account', 'type', 'status', 'text', 'id', 'subject', 'reply', 'who', 'uid', 'tag'];
}

View File

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

View File

@@ -870,7 +870,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

@@ -2,7 +2,7 @@
use MyAAC\Models\Gallery;
if(PAGE !== 'news') {
if(PAGE !== 'news' || !$db->hasTable(TABLE_PREFIX . 'gallery')) {
return;
}