JohnMck93 Posted January 27, 2010 Report Posted January 27, 2010 I know there is code somewhere and forgive me if it has been released but I cant find it. Could someone share the code to place Recent Arrivals in a table? Thank you Quote
piper338 Posted January 27, 2010 Report Posted January 27, 2010 I'm probably the wrong guy to be giving advise, but here is how I did it. First copy frontpage_reports.tpl to your skin folder. I edited mine to look like this <style type="text/css"> a:link { color: ##FFCC33; } a:visited { color: ##FFCC33; } a:hover { color: ##FF9933; } a:active { color: ##FF9933; } .style2 {color: #FFFFFF} .style3 {color: #000000; } </style> <table width="100%" class="tablesorter" id="tabledlist"> <thead> <td colspan="6"> <div align="center"><img src="<?php echo SITE_URL?>/lib/skins/valujet2/images/arrivals.png"> </div></td> <tr> <th bgcolor="#666666"><div align="center" class="style2">Flight Number</div></th> <th bgcolor="#666666"><div align="center" class="style2">Depart</div></th> <th bgcolor="#666666"><div align="center" class="style2">Arrive</div></th> <th bgcolor="#666666" class="style2">Pilot Name</th> <th bgcolor="#666666"><div align="center" class="style2">Aircraft</div></th> <th bgcolor="#666666"><div align="center" class="style2">Flight Time</div></th> </tr> </thead> <tbody> <?php if(!$reports) { echo 'No reports have been filed'; return; } foreach($reports as $report) { ?> <tr> <td align="center" bgcolor="#CCCCCC"><table border="0" cellpadding="0" cellspacing="0"> <tr> <td><a href="<?php echo url('/pireps/view/'.$report->pirepid);?>" class="style3"><img src="<?php echo SITE_URL?>/lib/skins/valujet2/images/smallplane.png"></a></td> </tr> </table> <a href="<?php echo url('/pireps/view/'.$report->pirepid);?>" class="style3"><?php echo $report->code . $report->flightnum; ?></a> </td> <td align="center" bgcolor="#CCCCCC"><span class="style1 style3"><?php echo $report->depicao; ?></span></td> <td align="center" bgcolor="#CCCCCC"><span class="style1 style3"><?php echo $report->arricao; ?></span></td> <td align="center" bgcolor="#CCCCCC"><a href="<?php echo url('/profile/view/'.$report->pilotid);?>"><?php echo $report->firstname . ' ' . $report->lastname?></td> <td align="center" bgcolor="#CCCCCC"><span class="style1 style3"><?php echo $report->aircraft . " ($report->registration)"; ?></span></td> <td align="center" bgcolor="#CCCCCC"><span class="style1 style3"><?php echo $report->flighttime; ?> Hours</span></td> </tr> <?php } ?> </tbody> </table> Then Just place this where ever you want it to be displayed <?php MainController::Run('PIREPS', 'RecentFrontPage', 5); ?> Someone correct me if I'm wrong. There might be a more correct way to do it. 1 Quote
JohnMck93 Posted January 27, 2010 Author Report Posted January 27, 2010 Err read the post again give me one sec to update lol Okay changed the coding and It says Recent reports then the error below still on the line of the echo, I dont see any error on it though two quick things do i place the first code ( all the css and stuff ) in the header, or the pirep page..... also im getting a php error Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING the line of code is echo 'No reports have been filed'; Quote
piper338 Posted January 27, 2010 Report Posted January 27, 2010 Well the css you can ignore I should have that in an external style sheet... it is just in my .tpl though... Now the error. I am not sure that was just copied out of the old (frontpage_reports.tpl) <?php if(!$reports) { echo 'No reports have been filed'; return; } foreach($reports as $report) { ?> Maybe someone better with php could help us out here? Quote
JohnMck93 Posted January 27, 2010 Author Report Posted January 27, 2010 Hope so, I dont know why it seems like im the only one with php errors Quote
JohnMck93 Posted January 27, 2010 Author Report Posted January 27, 2010 fixed the first error but now got this Parse error: syntax error, unexpected T_VARIABLE trying to fix that now 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.