Jump to content

servetas

Moderators
  • Posts

    1726
  • Joined

  • Last visited

  • Days Won

    4

Everything posted by servetas

  1. There is not any specific table cause everything is being calculated in the background using an algorithm. You can check the tips and tricks on your vacenter profile page: PS:Moving the thread to the vacentral support forum.
  2. You can remove the following line: MainController::Run('Activity', 'Frontpage', 20);
  3. As you can see, a part of code is twice in the file. Check below: <?php if(!defined('IN_PHPVMS') && IN_PHPVMS !== true) { die(); } ?> <div id="mainbox"> <?php // Show the News module, call the function ShowNewsFront // This is in the modules/Frontpage folder MainController::Run('News', 'ShowNewsFront', 5); // Show the activity feed MainController::Run('Activity', 'Frontpage', 20); ?> </div> <div id="sidebar"> <h3>Vôos Recentes</h3> <?php MainController::Run('PIREPS', 'RecentFrontPage', 5); ?> <h3>Novos Pilotos</h3> <?php MainController::Run('Pilots', 'RecentFrontPage', 5); ?> <h3>Usuários onlines</h3> <p><i>Houve <?php echo count($usersonline)?> usuário(s), e <?php echo count($guestsonline);?> visitante(s) online(s) nos últimos <?php echo Config::Get('USERS_ONLINE_TIME')?> minutos.</i></p> <?php /* $usersonline also has the list of users - really simple example Or if you're not on the frontpage: $usersonline = StatsData::UsersOnline(); foreach($usersonline as $pilot) { echo "{$pilot->firstname} {$pilot->lastname}<br />"; } */ ?> </div>
  4. If you do not paste your frontpage file here, we will not be able to help you.
  5. I have moved the thread to Paid Services board.
  6. Personally i do not know what causes the problem if i do not see it. Could you please send me your cpanel login details via PM in order to check it? If I find the solution, i will post it here.
  7. servetas

    Map

    Check this: http://www.crazycreatives.com/downloads/airline-route-map/
  8. Can you give us your website url?
  9. This is something quite simple and that is why i just described you how to do it. Read what i said above and i am sure that you will manage to do it. Post the code for us as soon as you complete it.
  10. I know that some of you do not know a lot of things about coding. As you have noticed, i am always trying to help the community members as much as i can, whenever i can and wherever i can. The thing is that we are not here to serve you ready codes to build your website. I did not say it to offend you. I fully explained you how to do it with three fully comprehensible steps. It's not that bad to run it, experiment and make a few tests. It might take you some time but in the end, you will learn much more things than just copying it.
  11. Do not expect everything "on your plate". If you check the code it is obvious. On the second line we store the current year on the $year variable. On the third line we store the current month-1(which means the previous month) on the $month variable. As soon as you remove the -1 from the $month, the whole if statement is useless and it can be removed too (lines 4-7). Customize the above code based on what i wrote, and you will have the present month stats ready.
  12. As i can see, you are using a free webhosting. It has been reported quite a lot in the past that phpVMS does not work with most of the free web hosting providers due to their limited settings. Personally i would suggest you switching to a payware hosting provider and especially someone from the phpVMS community cause our servers are optimized and well configured to work with phpVMS without any errors plus we know how to solve any unexpected issues.
  13. I have updated the topic title accordingly. It would be better if you could describe what do you need exactly.
  14. Then i think that you can straight add the if statement (and make the required changes) on your Pilot.php file. If you exclude the hub from the beginning, you will not have to add the if statement on the pilots_list file.
  15. I suspect that this has to do with the database connection. Have you checked if the database details in the localconfig are correct and the user of the database has all the required permissions over the database?
  16. You can use the "philosophy" it already has (commented) for the retired pilots. <h3><?php echo $title?></h3> <?php if(!$allpilots) { echo 'There are no pilots!'; return; } ?> <table id="tabledlist" class="tablesorter"> <thead> <tr> <th>Pilot ID</th> <th>Name</th> <th>Rank & Awards</th> <th>Joined</th> <th>Flights</th> <th>Hours</th> <th>Last Flight</th> <th>Status</th> </tr> </thead> <tbody> <?php foreach($allpilots as $pilot) { /* To include a custom field, use the following example: <td> <?php echo PilotData::GetFieldValue($pilot->pilotid, 'VATSIM ID'); ?> </td> For instance, if you added a field called "IVAO Callsign": echo PilotData::GetFieldValue($pilot->pilotid, 'IVAO Callsign'); */ // To skip a retired pilot, uncomment the next line: //if($pilot->retired == 1) { continue; } if($pilot->hub == 'Set here the ICAO of the HUB') {echo continue; } ?> <tr> <td width="1%" nowrap><a href="<?php echo url('/profile/view/'.$pilot->pilotid);?>"> <?php echo PilotData::GetPilotCode($pilot->code, $pilot->pilotid)?></a> </td> <td> <img src="<?php echo Countries::getCountryImage($pilot->location);?>" alt="<?php echo Countries::getCountryName($pilot->location);?>" /> <?php echo $pilot->firstname.' '.$pilot->lastname?> </td> <td align="center"><img src="<?php echo $pilot->rankimage?>" alt="<?php echo $pilot->rank;?>" /></td> <td align="center"><?php echo $pilot->joindate?></td> <td align="center"><?php echo $pilot->totalflights?></td> <td align="center"><?php echo Util::AddTime($pilot->totalhours, $pilot->transferhours); ?></td> <td align="center"><?php echo $pilot->lastpirep?></td> <td><?php if($pilot->retired == '1') {echo '<img src="'.SITE_URL.'/lib/skins/rafairuk/images/red_thumbs_button_b.jpg" alt="warning" /> - Inactive';} else {echo '<img src="'.SITE_URL.'/lib/skins/rafairuk/images/green_thumbs_button_b.jpg" alt="warning" /> - Active';} ?></td> <?php } ?> </tbody> </table>
  17. You set a percentage width for each <td>. For example: <td width="50%"> This will give specific "space" for each table column.
  18. I think that this should work accordingly: <?php $year = date("Y"); $month = date("m")-1; if($month == 0) { //If it's january, previous month is december. $month = 12; $year -= 1; } $pilot = TopPilotData::top_pilot_hours($month, $year, 5); echo '<table>'; foreach ($pilot as $top) { $pilot = PilotData::GetPilotData($top->pilot_id); echo '<tr>'; echo '<td>'.$pilot->firstname.' '.$pilot->lastname.' - '.PilotData::GetPilotCode($pilot->code, $pilot->pilotid).'</td>'; echo '<td>'.$top->hours.'</td>'; echo '</tr>'; } echo '</table>'; ?>
  19. Personally, i suspect that the only problem with this will be the thing that the submitted by will be empty whenever someone reaches a pirep which has been flown by a pilot who has been deleted from the system.
  20. If you mean phpvms admin center, yes but all the pilot's pireps will be deleted if you do not use the code which was stated above. If you mean phpmyadmin, yes but not all of us know how to use it and it's better to suggest ways and do things through the admin center. Bare in mind that you don't have to delete the pilot from the pilot's database table only. You have to delete all the pilot data such as his acarsdata, his bids, his pesmissions and plenty other in order to have a "clear" database.
  21. As it was stated before, you can comment out the code that delete's the pilot pireps. Open your PilotData.class.php, find this: public static function deletePilot($pilotid) { $sql = array(); unset(self::$pilot_data[$pilotid]); $sql[] = 'DELETE FROM '.TABLE_PREFIX.'acarsdata WHERE pilotid='.$pilotid; $sql[] = 'DELETE FROM '.TABLE_PREFIX.'bids WHERE pilotid='.$pilotid; $sql[] = 'DELETE FROM '.TABLE_PREFIX.'pireps WHERE pilotid='.$pilotid; $sql[] = 'DELETE FROM '.TABLE_PREFIX.'pilots WHERE pilotid='.$pilotid; # These SHOULD delete on cascade, but incase they don't $sql[] = 'DELETE FROM '.TABLE_PREFIX.'fieldvalues WHERE pilotid='.$pilotid; $sql[] = 'DELETE FROM '.TABLE_PREFIX.'groupmembers WHERE pilotid='.$pilotid; $sql[] = 'DELETE FROM '.TABLE_PREFIX.'pirepcomments WHERE pilotid='.$pilotid; foreach($sql as $query) { $res = DB::query($query); } if(DB::errno() != 0) return false; return true; } and replace it with this: public static function deletePilot($pilotid) { $sql = array(); unset(self::$pilot_data[$pilotid]); $sql[] = 'DELETE FROM '.TABLE_PREFIX.'acarsdata WHERE pilotid='.$pilotid; $sql[] = 'DELETE FROM '.TABLE_PREFIX.'bids WHERE pilotid='.$pilotid; //$sql[] = 'DELETE FROM '.TABLE_PREFIX.'pireps WHERE pilotid='.$pilotid; $sql[] = 'DELETE FROM '.TABLE_PREFIX.'pilots WHERE pilotid='.$pilotid; # These SHOULD delete on cascade, but incase they don't $sql[] = 'DELETE FROM '.TABLE_PREFIX.'fieldvalues WHERE pilotid='.$pilotid; $sql[] = 'DELETE FROM '.TABLE_PREFIX.'groupmembers WHERE pilotid='.$pilotid; //$sql[] = 'DELETE FROM '.TABLE_PREFIX.'pirepcomments WHERE pilotid='.$pilotid; foreach($sql as $query) { $res = DB::query($query); } if(DB::errno() != 0) return false; return true; } I have not tested it. You can run it on a backup website first.
  22. Number of Daily Departures: <?php echo StatsData::totalflightstoday(); ?> For the number of destinations i do not think that there is already a counter but you can use this. Just open your StasData.class.php file and place this: public static function total_destinations() { $key = 'total_destinations'; $total = CodonCache::read($key); if($total === false) { $sql = "SELECT COUNT(DISTINCT arricao) AS total FROM ".TABLE_PREFIX."schedules WHERE enabled=1"; $result = DB::get_row($sql); if(!$result) { return 0; } $total = $result->total; CodonCache::write($key, $total, '15minute'); } return $total; } after that, you can use this part of code to show the number of destinations: <?php echo StatsData::total_destinations(); ?>
  23. Could you please let us know the url of your website?
  24. Have to tried to run the Reset Pilot PIREP Count maintenance function through your phpvms admin center?
×
×
  • Create New...