Jump to content

Vataware Top Route for pilot brief


airhaul

Recommended Posts

Add under routes section on schedule_briefing.tpl

Will display top route flown from vataware

I admit not the most graceful code....but what the hay...it works

<?php
$url = 'http://vataware.com/citypair/'.$schedule->depicao.'-'.$schedule->arricao.'';
$page = file_get_contents($url);
$start_char = '/flight/';
$end_char = '</a></td>';
$start_pos = strpos($page, $start_char);
$end_pos = strpos($page, $end_char);
$start_pos += strlen($start_char);
$end_pos += strlen($end_char);
$string = substr($page, $start_pos, ($end_pos - $start_pos));
$start_char = '>';
$start_pos = strpos($string, $start_char) + 1;
$string = substr($string, $start_pos);
echo $string;
?>

Link to comment
Share on other sites

  • 3 months later...
  • 3 weeks later...

That is all the code that is needed...just make sure you are inserting it into schedule_briefing.tpl.....maybe do a print_r($schedule->depicao); first to make sure the variables are being called correctly to the page....only way it wouldn't work is if variables are not being called or using a different name

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...