StartVM Posted July 27, 2014 Report Share Posted July 27, 2014 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 Quote Link to comment Share on other sites More sharing options...
JustinFHI Posted July 28, 2014 Report Share Posted July 28, 2014 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. Quote Link to comment Share on other sites More sharing options...
StartVM Posted July 28, 2014 Author Report Share Posted July 28, 2014 It doesn't work syntax error. Unexpected "<" on line 5 Quote Link to comment Share on other sites More sharing options...
Tom Posted July 28, 2014 Report Share Posted July 28, 2014 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 } ?> Quote Link to comment Share on other sites More sharing options...
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.