Jump to content

Recommended Posts

Posted

With the following script <?php MainController::Run('PIREPS', 'RecentFrontPage', 5); ?> it displays the last 5 pireps submitted. I am trying to modify the frontpage_reports.tpl file so it displays that users last 5 fives flights instead of everyones.

http://pastebin.com/zNkYd8tF

Can someone please help me out with this? Thanks

Posted

Hi,

you can fix it like this:

//Script order
<?php MainController::Run('PIREPS', 'RecentFrontPage'); ?>


//Content of frontpage_recent.tpl
<?php
$pir_sel = "SELECT * FROM pireps WHERE pilotid = 'Auth::$userinfo->pilotid' ORDER BY id DESC LIMIT 5";
$pir_go = mysql_query($pir_sql);
while($report = mysql_fetch_object) {
 <li><a href="<?php echo url('/pireps/viewreport/'.$report->pirepid);?>">#<?php echo $report->pirepid
 . ' - ' . $report->code.$report->flightnum?> <span class="icon-align-left"></span><strong> Flying from <?php echo $report->depICAO . ' to ' . $report->arrICAO?></strong></a></li>
}
?>

I know that doesn't work with modules, but I think it's the easyst method.

Posted

It doesn't work syntax error. Unexpected "<" on line 5

So check line 5 and work it out ;)

Here, I did it for you:

//Script order
<?php MainController::Run('PIREPS', 'RecentFrontPage'); ?>


//Content of frontpage_recent.tpl
<?php
$pir_sel = "SELECT * FROM pireps WHERE pilotid = 'Auth::$userinfo->pilotid' ORDER BY id DESC LIMIT 5";
$pir_go = mysql_query($pir_sql);
while($report = mysql_fetch_object) { ?>
        <li><a href="<?php echo url('/pireps/viewreport/'.$report->pirepid);?>">#<?php echo $report->pirepid
        . ' - ' . $report->code.$report->flightnum?> <span class="icon-align-left"></span><strong> Flying from <?php echo $report->depICAO . ' to ' . $report->arrICAO?></strong></a></li>
<?php
}
?>

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...