Ocean Blue v3.0.1 coding problem w/ php 7.2

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

Can I have your url

What version of phpVMS are you using?

What PHP version are you using? I’m betting version 7.x 

I am using the PHPVMS Version 5.5.2.72 becuase my web hosting is using PHP Version7.2.26 http://flyeasternairlinesva.org/

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

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.

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](< base_url >/applications/core/interface/file/attachment.php?id=4357)

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.

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

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?

sorry here is the other https://photos.app.goo.gl/8GJYWt3pP3XWNv3f7

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.