Moderators joeri Posted March 27, 2010 Moderators Report Posted March 27, 2010 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 Quote
Moderators mark1million Posted March 27, 2010 Moderators Report Posted March 27, 2010 I think the code is about here somewhere, its an if else if i remember. Quote
Moderators joeri Posted March 27, 2010 Author Moderators Report Posted March 27, 2010 yeah done the search but couldn't find it therefor i asked Quote
Administrators simpilot Posted March 28, 2010 Administrators Report Posted March 28, 2010 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(); ?> Quote
Moderators joeri Posted March 28, 2010 Author Moderators Report Posted March 28, 2010 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 Quote
Administrators simpilot Posted March 28, 2010 Administrators Report Posted March 28, 2010 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? Quote
Moderators joeri Posted March 28, 2010 Author Moderators Report Posted March 28, 2010 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 Quote
Moderators joeri Posted March 29, 2010 Author Moderators Report Posted March 29, 2010 i just updated to the last beta now the code isnt working annymore on my frontage main this one <?php echo StatsData::ActivePilots(); ?> Quote
Administrators Nabeel Posted March 29, 2010 Administrators Report Posted March 29, 2010 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(); Quote
Administrators simpilot Posted March 29, 2010 Administrators Report Posted March 29, 2010 Joeri, the new piece of code was overwritten when you updated. Quote
Moderators joeri Posted March 30, 2010 Author Moderators Report Posted March 30, 2010 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 Quote
Moderators joeri Posted March 30, 2010 Author Moderators Report Posted March 30, 2010 Joeri, the new piece of code was overwritten when you updated. Quote
Administrators simpilot Posted March 30, 2010 Administrators Report Posted March 30, 2010 ? - 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. Quote
Moderators joeri Posted March 30, 2010 Author Moderators Report Posted March 30, 2010 ? - 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 Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.