Jump to content

servetas

Moderators
  • Posts

    1726
  • Joined

  • Last visited

  • Days Won

    4

Everything posted by servetas

  1. 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.
  2. 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.
  3. 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.
  4. 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.
  5. I have updated the topic title accordingly. It would be better if you could describe what do you need exactly.
  6. 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.
  7. 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?
  8. 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>
  9. You set a percentage width for each <td>. For example: <td width="50%"> This will give specific "space" for each table column.
  10. 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>'; ?>
  11. 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.
  12. 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.
  13. 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.
  14. 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(); ?>
  15. Could you please let us know the url of your website?
  16. Have to tried to run the Reset Pilot PIREP Count maintenance function through your phpvms admin center?
  17. A good atlernative way (if you can't do it using css etc) would be to create different images with the progress bar loading and call them based on a specific percentage. For example, if the pilot is on the 50%, you will call the "progress/50.png" etc.
  18. Open core/common/FrontSchedulesData.class.php file and replace this: public function findschedule($arricao, $depicao, $airline) { $query = "SELECT phpvms_schedules.*, phpvms_aircraft.name AS aircraft, phpvms_aircraft.registration FROM phpvms_schedules, phpvms_aircraft WHERE phpvms_schedules.depicao LIKE '$depicao' AND phpvms_schedules.arricao LIKE '$arricao' AND phpvms_schedules.code LIKE '$airline' AND phpvms_aircraft.id LIKE phpvms_schedules.aircraft"; return DB::get_results($query); } with this one: public function findschedule($arricao, $depicao, $airline) { $query = "SELECT phpvms_schedules.*, phpvms_aircraft.name AS aircraft, phpvms_aircraft.registration, phpvms_aircraft.ranklevel AS aircraftlevel FROM phpvms_schedules, phpvms_aircraft WHERE phpvms_schedules.depicao LIKE '$depicao' AND phpvms_schedules.arricao LIKE '$arricao' AND phpvms_schedules.code LIKE '$airline' AND phpvms_aircraft.id LIKE phpvms_schedules.aircraft"; return DB::get_results($query); }
  19. Open your local.config.php file and update the following setting accordingly: Config::Set('LiquidUnit', '2'); # 0=liter 1=gal 2=kg 3=lbs It should exist somewhere inside the file.
  20. First of all, if you check the PHP-Mods Terms and Conditions, support for the free modules is not offered through our Billing System. This means that our Staff is not obliged to offer support for the freeware modules based on the workload. Please pm me with your website details and a description with the problem and i will try to see what i can do for you. Let me state that the problem had been already corrected on 20th of May by myself and now for some reason, it happened again. Last but not least, if you do not describe what is your problem, we are not able to support you. You have not even said what is the module you are talking about. I will be waiting for your pm.
  21. Does the core/modules/FAQ/Faq.php file exists on your website's directory?
  22. Hello, This does not help us to solve the problem. Can't you upload any screenshots or describe the problem some more?
  23. You can just redirect your visitors to the module as soon as they press the registration button and as soon as they accept the rules they will be redirected to the registration form. Here is how i am using it on my website: http://greeceairwaysva.com/
  24. I can't say if using affiliate urls makes someone objective about a web hosting company...
×
×
  • Create New...