haviong a quick question curently i use this to see my pilots count
Total Pilots: <?php echo StatsData::PilotCount() ?>
but it will show all active and inactive is there a way to only show how many active pilots there are.
gr joeri
haviong a quick question curently i use this to see my pilots count
Total Pilots: <?php echo StatsData::PilotCount() ?>
but it will show all active and inactive is there a way to only show how many active pilots there are.
gr joeri
I think the code is about here somewhere, its an if else if i remember.
yeah done the search but couldn’t find it therefor i asked
I dont see anything that would be easily configured, but you could…
add to StatsData.class.php ->
public static function ActivePilots() {
$query = 'SELECT COUNT(*) AS total
FROM '.TABLE_PREFIX.'pilots
WHERE retired=0';
$result=DB::get_row($query);
if (!$result){
return '0';
}
else {
return $result->total;
}
}
Then where you want your active pilot count to appear ->
<?php echo StatsData::ActivePilots(); ?>
then i get this sadly
Parse error: syntax error, unexpected $end, expecting T_FUNCTION in /home/tntvirtua/domains/tnt-virtual.be/public_html/core/common/StatsData.class.php on line 831
You probably need to move the code up inside the last } for the file. It just looks like it is ending the class right before the new section of code.
If that doesnt work, what is line 831?
You probably need to move the code up inside the last } for the file. It just looks like it is ending the class right before the new section of code.
If that doesnt work, what is line 831?
that did the job i was deleting the last } my mistake
thanks
i just updated to the last beta now the code isnt working annymore
on my frontage main
this one
<?php echo StatsData::ActivePilots(); ?>
i just updated to the last beta now the code isnt working annymore
on my frontage main
this one
<?php echo StatsData::ActivePilots(); ?>
Well you added that manually, right?
Just make a new file in /core/common called
CustomData.class.php
and in it put
class CustomData {
// paste your function
}
Then just call it
CustomData::ActivePilots();
Joeri, the new piece of code was overwritten when you updated.
Joeri, the new piece of code was overwritten when you updated.
negative dave i looked in to it and the code was still there in the statsdata.php i will try what Nabeel sugested wil see iff that is working
thanks all
Joeri, the new piece of code was overwritten when you updated.
? - statsdata.class.php should have been overwritten when you updated… Not sure what is going on. A new class would be best anyway, that way it will not get overwritten in future updates.
? - statsdata.class.php should have been overwritten when you updated… Not sure what is going on. A new class would be best anyway, that way it will not get overwritten in future updates.
indeed but i dont upload files that arent new so only updated file u ftp
will make a new claas than
thanks dave and Nabeel