Add protection, nothing important - thrown exception before

This commit is contained in:
slawkens 2023-07-22 14:03:57 +02:00
parent 5791d1e7f9
commit 4a629b4418
5 changed files with 10 additions and 0 deletions

View File

@ -1,4 +1,6 @@
<?php
defined('MYAAC') or die('Direct access not allowed!');
$balance = ($db->hasColumn('players', 'balance') ? $db->query('SELECT `balance`, `id`, `name`,`level` FROM `players` ORDER BY `balance` DESC LIMIT 10;') : 0);
$twig->display('balance.html.twig', array(

View File

@ -1,4 +1,6 @@
<?php
defined('MYAAC') or die('Direct access not allowed!');
$coins = ($db->hasColumn('accounts', 'coins') ? $db->query('SELECT `coins`, `' . (USE_ACCOUNT_NAME ? 'name' : 'id') . '` as `name` FROM `accounts` ORDER BY `coins` DESC LIMIT 10;') : 0);
$twig->display('coins.html.twig', array(

View File

@ -1,4 +1,6 @@
<?php
defined('MYAAC') or die('Direct access not allowed!');
$players = ($db->hasColumn('accounts', 'created') ? $db->query('SELECT `created`, `' . (USE_ACCOUNT_NAME ? 'name' : 'id') . '` as `name` FROM `accounts` ORDER BY `created` DESC LIMIT 10;') : 0);
$twig->display('created.html.twig', array(

View File

@ -1,4 +1,6 @@
<?php
defined('MYAAC') or die('Direct access not allowed!');
$players = ($db->hasColumn('players', 'lastlogin') ? $db->query('SELECT name, level, lastlogin FROM players ORDER BY lastlogin DESC LIMIT 10;') : 0);
$twig->display('lastlogin.html.twig', array(
'players' => $players,

View File

@ -1,4 +1,6 @@
<?php
defined('MYAAC') or die('Direct access not allowed!');
$points = ($db->hasColumn('accounts', 'premium_points') ? $db->query('SELECT `premium_points`, `' . (USE_ACCOUNT_NAME ? 'name' : 'id') . '` as `name` FROM `accounts` ORDER BY `premium_points` DESC LIMIT 10;') : 0);
$twig->display('points.html.twig', array(