mirror of
https://github.com/slawkens/myaac.git
synced 2025-04-26 17:29:21 +02:00
Fraggers in characters page for TFS 1.x and canary
This commit is contained in:
parent
4f4965369d
commit
42f99c3edc
@ -8,6 +8,9 @@
|
||||
* @copyright 2019 MyAAC
|
||||
* @link https://my-aac.org
|
||||
*/
|
||||
|
||||
use MyAAC\Models\PlayerDeath;
|
||||
|
||||
defined('MYAAC') or die('Direct access not allowed!');
|
||||
$title = 'Characters';
|
||||
|
||||
@ -322,20 +325,38 @@ WHERE killers.death_id = '".$death['id']."' ORDER BY killers.final_hit DESC, kil
|
||||
|
||||
$frags = array();
|
||||
$frag_add_content = '';
|
||||
if($config['characters']['frags'] && $db->hasTable('killers')) {
|
||||
if ($config['characters']['frags']) {
|
||||
$frags_limit = 10; // frags limit to show? // default: 10
|
||||
|
||||
if ($db->hasTable('killers')) {
|
||||
//frags list by Xampy
|
||||
$i = 0;
|
||||
$frags_limit = 10; // frags limit to show? // default: 10
|
||||
$player_frags = $db->query('SELECT `player_deaths`.*, `players`.`name`, `killers`.`unjustified` FROM `player_deaths` LEFT JOIN `killers` ON `killers`.`death_id` = `player_deaths`.`id` LEFT JOIN `player_killers` ON `player_killers`.`kill_id` = `killers`.`id` LEFT JOIN `players` ON `players`.`id` = `player_deaths`.`player_id` WHERE `player_killers`.`player_id` = ' . $player->getId() . ' ORDER BY `date` DESC LIMIT 0,' . $frags_limit . ';')->fetchAll();
|
||||
if (count($player_frags)) {
|
||||
$row_count = 0;
|
||||
foreach($player_frags as $frag)
|
||||
{
|
||||
foreach ($player_frags as $frag) {
|
||||
$description = 'Fragged <a href="' . getPlayerLink($frag['name'], false) . '">' . $frag['name'] . '</a> at level ' . $frag['level'];
|
||||
$frags[] = array('time' => $frag['date'], 'description' => $description, 'unjustified' => $frag['unjustified'] != 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
else if($db->hasTable('player_deaths') && $db->hasColumn('player_deaths', 'killed_by')) {
|
||||
$i = 0;
|
||||
$player_frags = PlayerDeath::where('player_deaths.killed_by', $player->getName())
|
||||
->join('players', 'players.id', '=', 'player_deaths.player_id')
|
||||
->limit($frags_limit)
|
||||
->selectRaw('players.name, player_deaths.*')
|
||||
->get();
|
||||
|
||||
if ($player_frags->count()) {
|
||||
$row_count = 0;
|
||||
foreach ($player_frags as $frag) {
|
||||
$description = 'Fragged <a href="' . getPlayerLink($frag->name, false) . '">' . $frag->name . '</a> at level ' . $frag->level;
|
||||
$frags[] = array('time' => $frag->time, 'description' => $description, 'unjustified' => $frag->unjustified != 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// signature
|
||||
if(setting('core.signature_enabled')) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user