COA142 Posted January 25, 2020 Report Posted January 25, 2020 (edited) I am having a coding problem way is this showing this on my front page main for Ocean Blue v3.0.1 i went in the line were it is at i don,t seen anything wrong https://photos.app.goo.gl/ZGFZAR9ULviwwFBAA https://photos.app.goo.gl/uZpyZLPgUpJjMWXc7 https://photos.app.goo.gl/zdvGy5WvRFuTw4ma6 any ideas Edited January 26, 2020 by ProAvia Title edited to reflect PHP 7.2 Quote
flyalaska Posted January 25, 2020 Report Posted January 25, 2020 (edited) Can I have your url Edited January 25, 2020 by flyalaska Quote
Administrators ProAvia Posted January 26, 2020 Administrators Report Posted January 26, 2020 What version of phpVMS are you using? What PHP version are you using? I'm betting version 7.x Quote
COA142 Posted January 26, 2020 Author Report Posted January 26, 2020 I am using the PHPVMS Version 5.5.2.72 becuase my web hosting is using PHP Version7.2.26 http://flyeasternairlinesva.org/ Quote
gio1961 Posted January 26, 2020 Report Posted January 26, 2020 8 hours ago, ProAvia said: What version of phpVMS are you using? What PHP version are you using? I'm betting version 7.x How to solve the "Warning: count (): Parameter must be ..." problem I did a google search and many websites have this error. Surely they have installed higher php7.x on their servers I remember I said making a change Quote
Administrators ProAvia Posted January 26, 2020 Administrators Report Posted January 26, 2020 Your warning error is NOT caused by the skin you are using.... it is because of changes between PHP 5.6 and PHP 7.2 For front_page main.php line 157 - replace the "<?php ... ?>" section with <?php if(is_array(ACARSData::GetACARSData()) || (ACARSData::GetACARSData()) instanceof Countable) { echo count(ACARSData::GetACARSData()); }?> I don't have frontpage_map.php line 17 in front of me right now, but the fix is very similar to the above <?php if(is_array(...call after 'count') || (...call after 'count') instanceof Countable) { .... probably an echo line; }?> If you need the fix for frontpage_map.php to be more specific, you will need to post the code for that line here first. Chances are you may encounter these 'count' warning errrors again in different modules. For the most part, the fix is the same. The above changes only apply to PHP 7 and above. Quote
COA142 Posted January 27, 2020 Author Report Posted January 27, 2020 Ok I add the code for Line 7 but it comes up with a red X https://photos.app.goo.gl/vi7SCn2p9TfipjZx6 frontpage_main.zip Quote
Administrators ProAvia Posted January 27, 2020 Administrators Report Posted January 27, 2020 You need to re-read my reply above ..... there are 2 files to edit... frontpage_main.php and frontpage_map.php - two different files.... MAIN and MAP frontpage_main.php gets the first edit frontpage_map.php - you need to edit the contents as directed - along the same lines as the first file.... I used fake names for the calls cause I didn't have the file available this morning. Replace lines 16-56 <?php if(count($pireps) > 0) { foreach ($pireps as $pirep) { $pilotinfo = PilotData::getPilotData($pirep->pilotid); $pilotid = PilotData::getPilotCode($pilotinfo->code, $pilotinfo->pilotid); $acrid = OperationsData::getAircraftByReg($pirep->registration); echo '<tr>'; echo '<td><a href="'.SITE_URL.'/index.php/profile/view/'.$pilotinfo->pilotid.'">'.$pilotinfo->firstname.' '.$pilotinfo->lastname[0].'.</a></td>'; echo '<td><a href="'.SITE_URL.'/index.php/pireps/viewreport/'.$pirep->pirepid.'">'.$pirep->code.$pirep->flightnum.'</a></td>'; echo '<td>'.$pirep->depicao.'</td>'; echo '<td>'.$pirep->arricao.'</td>'; echo '<td>'.$pirep->aircraft.'</td>'; echo '<td>'.$pirep->flighttime.'</td>'; echo '<td>'.$pirep->landingrate.' ft/m</td>'; if($pirep->accepted == PIREP_ACCEPTED) echo '<td><button type="button" class="btn btn-outline btn-success btn-xs mb-2">Flight Approved</button></td>'; elseif($pirep->accepted == PIREP_REJECTED) echo '<td><button type="button" class="btn btn-outline btn-danger btn-xs mb-2">Flight Rejected</button></td>'; elseif($pirep->accepted == PIREP_PENDING) echo '<td><button type="button" class="btn btn-outline btn-primary btn-xs mb-2">Approval Pending</button></td>'; elseif($pirep->accepted == PIREP_INPROGRESS) echo '<td><button type="button" class="btn btn-outline btn-primary btn-xs mb-2">On Progress</button></td>'; echo '</tr>'; } } else { echo '<tr><td>There are no recent flights!</td></tr>'; } ?> With this <?php if(is_array($pireps) || ($pireps) instanceof Countable { if(count($pireps) > 0) { foreach ($pireps as $pirep) { $pilotinfo = PilotData::getPilotData($pirep->pilotid); $pilotid = PilotData::getPilotCode($pilotinfo->code, $pilotinfo->pilotid); $acrid = OperationsData::getAircraftByReg($pirep->registration); echo '<tr>'; echo '<td><a href="'.SITE_URL.'/index.php/profile/view/'.$pilotinfo->pilotid.'">'.$pilotinfo->firstname.' '.$pilotinfo->lastname[0].'.</a></td>'; echo '<td><a href="'.SITE_URL.'/index.php/pireps/viewreport/'.$pirep->pirepid.'">'.$pirep->code.$pirep->flightnum.'</a></td>'; echo '<td>'.$pirep->depicao.'</td>'; echo '<td>'.$pirep->arricao.'</td>'; echo '<td>'.$pirep->aircraft.'</td>'; echo '<td>'.$pirep->flighttime.'</td>'; echo '<td>'.$pirep->landingrate.' ft/m</td>'; if($pirep->accepted == PIREP_ACCEPTED) echo '<td><button type="button" class="btn btn-outline btn-success btn-xs mb-2">Flight Approved</button></td>'; elseif($pirep->accepted == PIREP_REJECTED) echo '<td><button type="button" class="btn btn-outline btn-danger btn-xs mb-2">Flight Rejected</button></td>'; elseif($pirep->accepted == PIREP_PENDING) echo '<td><button type="button" class="btn btn-outline btn-primary btn-xs mb-2">Approval Pending</button></td>'; elseif($pirep->accepted == PIREP_INPROGRESS) echo '<td><button type="button" class="btn btn-outline btn-primary btn-xs mb-2">On Progress</button></td>'; echo '</tr>'; } } else { echo '<tr><td>There are no recent flights!</td></tr>'; } } ?> So I think you may need to revert to the original files first and then edit the TWO files again. Hopefully your renamed the originals before saving the edit - if not, you can get the originals from the skin download. Sorry for any confusion on the second edit. The edit to the frontpage_map.php file should work - but I have no way to try it. I had to do the edit to frontpage_main.php on another site that was using php 7.2 and an older version of the Ocean Blue skin. Let us know how it works out. Quote
COA142 Posted January 27, 2020 Author Report Posted January 27, 2020 Ok i add that code and it is still giving me line 18 error and now my site dose not show https://photos.app.goo.gl/rizoCjGEGJ6opmZf6 https://photos.app.goo.gl/rizoCjGEGJ6opmZf6 Quote
Administrators ProAvia Posted January 27, 2020 Administrators Report Posted January 27, 2020 4 hours ago, COA142 said: Ok i add that code and it is still giving me line 18 error and now my site dose not show https://photos.app.goo.gl/rizoCjGEGJ6opmZf6 https://photos.app.goo.gl/rizoCjGEGJ6opmZf6 Both of those links are the same pic What is the error? Quote
COA142 Posted January 27, 2020 Author Report Posted January 27, 2020 sorry here is the other https://photos.app.goo.gl/8GJYWt3pP3XWNv3f7 Quote
Administrators ProAvia Posted January 27, 2020 Administrators Report Posted January 27, 2020 Well... let's try this then.... Near the end of frontpage_map.php...... change echo '</tr>'; } } else { echo '<tr><td>There are no recent flights!</td></tr>'; } } ?> To this echo '</tr>'; } } } else { echo '<tr><td>There are no recent flights!</td></tr>'; } ?> Basically, you are moving the last ' } ' to just before 'else'. Let us know how that works. 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.