• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Fragslist php

SoloQ

Hard With Style
Joined
Mar 12, 2009
Messages
557
Reaction score
21
Location
Netherlands ;3
Hello,

I am using [Gesior AAC] Victims list (https://otland.net/threads/gesior-aac-victims-list.69303/)
PHP:
           //frags list by Xampy
            
            $frags_limit = 10; // frags limit to show? // default: 10
            $player_frags = $SQL->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.';');
            if(count($player_frags))
            {
                $frags = 0;
                $frag_add_content .= '<TABLE BORDER=0 CELLSPACING=1 CELLPADDING=4 WIDTH=100%><br><TR BGCOLOR='.$config['site']['vdarkborder'].'><TD COLSPAN=2 CLASS=white><B>Victims</B></TD></TR>';
                foreach($player_frags as $frag)
                {
                $frags++;
                    if(is_int($number_of_rows / 2)) $bgcolor = $config['site']['darkborder']; else $bgcolor = $config['site']['lightborder'];
                    $number_of_rows++;
                    $frag_add_content .= "<tr bgcolor=\"".$bgcolor."\">
                    <td width=\"20%\" align=\"center\">".date("j M Y, H:i", $frag['date'])."</td>
                    <td>".(($player->getSex() == 0) ? 'She' : 'He')." fragged <a href=\"index.php?subtopic=characters&name=".$frag[name]."\">".$frag[name]."</a> at level ".$frag[level]."";
 
                    $frag_add_content .= ". (".(($frag[unjustified] == 0) ? "<font size=\"1\" color=\"green\">Justified</font>" : "<font size=\"1\" color=\"red\">Unjustified</font>").")</td></tr>";
                }
            if($frags >= 1)
                $main_content .= $frag_add_content . '</TABLE>';
            }
            // end of frags list by Xampy

Yet I am getting the following error;
Warning: count(): Parameter must be an array or an object that implements Countable in C:\xampp\htdocs\pages\characters.php on line 283

283 is if(count($player_frags))
Looking online this should be a valid line of code ( count() )
What do I adjust?

Also whilst tinkering it I get the following errors:

Code:
Warning: count(): Parameter must be an array or an object that implements Countable in C:\xampp\htdocs\pages\characters.php on line 283

Warning: Use of undefined constant name - assumed 'name' (this will throw an Error in a future version of PHP) in C:\xampp\htdocs\pages\characters.php on line 294

Warning: Use of undefined constant name - assumed 'name' (this will throw an Error in a future version of PHP) in C:\xampp\htdocs\pages\characters.php on line 294

Warning: Use of undefined constant level - assumed 'level' (this will throw an Error in a future version of PHP) in C:\xampp\htdocs\pages\characters.php on line 294

Warning: Use of undefined constant unjustified - assumed 'unjustified' (this will throw an Error in a future version of PHP) in C:\xampp\htdocs\pages\characters.php on line 296

Warning: Use of undefined constant name - assumed 'name' (this will throw an Error in a future version of PHP) in C:\xampp\htdocs\pages\characters.php on line 294

Warning: Use of undefined constant name - assumed 'name' (this will throw an Error in a future version of PHP) in C:\xampp\htdocs\pages\characters.php on line 294

Warning: Use of undefined constant level - assumed 'level' (this will throw an Error in a future version of PHP) in C:\xampp\htdocs\pages\characters.php on line 294

Warning: Use of undefined constant unjustified - assumed 'unjustified' (this will throw an Error in a future version of PHP) in C:\xampp\htdocs\pages\characters.php on line 296

Warning: Use of undefined constant name - assumed 'name' (this will throw an Error in a future version of PHP) in C:\xampp\htdocs\pages\characters.php on line 294

Warning: Use of undefined constant name - assumed 'name' (this will throw an Error in a future version of PHP) in C:\xampp\htdocs\pages\characters.php on line 294

Warning: Use of undefined constant level - assumed 'level' (this will throw an Error in a future version of PHP) in C:\xampp\htdocs\pages\characters.php on line 294

Warning: Use of undefined constant unjustified - assumed 'unjustified' (this will throw an Error in a future version of PHP) in C:\xampp\htdocs\pages\characters.php on line 296

I would love a good push in the right direction.
(I am pretty sure I am using an older version of php but even with the new version everything still works except for this)
 
Back
Top