flyalaska Posted February 27, 2013 Report Posted February 27, 2013 I got the PIREPS tp post to Twitter, can not get the recent activity to post on my page, I get an error. Warning: Invalid argument supplied for foreach() in /home/flyakaco/public_html/lib/skins/flyalaska_1.0/activity_list.tpl on line 3 Line 3 is foreach($allactivities as $activity) { Quote
Moderators Parkho Posted March 1, 2013 Moderators Report Posted March 1, 2013 $allactivities should read the data from a class file. Something like : $allactivities = ActivityData::getActivity(); Quote
flyalaska Posted March 1, 2013 Author Report Posted March 1, 2013 I tried that, it screws up my site. How do I exactly replace the code on line 3? foreach($allactivities as $activity) { Quote
Moderators Parkho Posted March 2, 2013 Moderators Report Posted March 2, 2013 Try this: $count = 10; $allactivities = ActivityData::getActivity(array(), $count); Quote
Moderators Parkho Posted March 4, 2013 Moderators Report Posted March 4, 2013 It works. Code: <h3>Activities</h3> <hr> <table> <?php $count = 10; $allactivities = ActivityData::getActivity(array(), $count); foreach($allactivities as $activity) { ?> <tr><td><?php echo $activity->message ;?></td></tr> <?php } ?> </table> Screenshot: Quote
flyalaska Posted March 4, 2013 Author Report Posted March 4, 2013 I have progress. I have no errors now. http://www.flyaka.com/index.php/ Look on the bottom Not displaying the Name or pilot ID, neither is yours. Quote
Moderators Parkho Posted March 4, 2013 Moderators Report Posted March 4, 2013 That's correct. Because I intended to show only the message. If you need to specify the pilot name along with the pilot ID then you'll need to get the pilot id and use it in another function to pull information for that pilot id, so: The code: <h3>Activities</h3> <hr> <table> <?php $count = 10; $allactivities = ActivityData::getActivity(array(), $count); foreach($allactivities as $activity) { $pilot = PilotData::getPilotData($activity->pilotid); ?> <tr><td><?php echo $pilot->code.$pilot->pilotid ;?> - <?php echo $pilot->firstname.' '.$pilot->lastname ;?> - <?php echo $activity->message ;?></td></tr> <?php } ?> </table> Screenshot: Quote
Moderators Parkho Posted March 5, 2013 Moderators Report Posted March 5, 2013 You're welcome. Do you want to add their country flag right next to their names? Quote
flyalaska Posted March 5, 2013 Author Report Posted March 5, 2013 It's perfect the way it is. Thank for all your help. Quote
sherming Posted March 5, 2013 Report Posted March 5, 2013 Hi parkho, I would like to have the code with the country flag next to their names please Quote
Moderators Parkho Posted March 5, 2013 Moderators Report Posted March 5, 2013 lol! Of course you do. Let me come up with the code and let you know. Quote
Moderators Parkho Posted March 5, 2013 Moderators Report Posted March 5, 2013 The code: <h3>Activities</h3> <hr> <table> <?php $count = 10; $allactivities = ActivityData::getActivity(array(), $count); foreach($allactivities as $activity) { $pilot = PilotData::getPilotData($activity->pilotid); ?> <tr><td><?php echo $pilot->code.$pilot->pilotid ;?> - <?php echo $pilot->firstname.' '.$pilot->lastname ;?> ( <img src="<?php echo Countries::getCountryImage($pilot->location);?>"> ) - <?php echo $activity->message ;?> </td></tr> <?php } ?> </table> Screenshot: Quote
flyalaska Posted March 6, 2013 Author Report Posted March 6, 2013 I ran into another issue. When a new pilot is accepted or when a pilot receives an award. It displays as -- has been promoted..... Quote
Moderators Parkho Posted March 6, 2013 Moderators Report Posted March 6, 2013 I think you have empty pilotid column for those rows in activity table. Quote
Gantcho Posted April 9, 2013 Report Posted April 9, 2013 The code: <h3>Activities</h3> <hr> <table> <?php $count = 10; $allactivities = ActivityData::getActivity(array(), $count); foreach($allactivities as $activity) { $pilot = PilotData::getPilotData($activity->pilotid); ?> <tr><td><?php echo $pilot->code.$pilot->pilotid ;?> - <?php echo $pilot->firstname.' '.$pilot->lastname ;?> ( <img src="<?php echo Countries::getCountryImage($pilot->location);?>"> ) - <?php echo $activity->message ;?> </td></tr> <?php } ?> </table> Screenshot: Where we have to put it ?? Quote
Moderators Parkho Posted April 13, 2013 Moderators Report Posted April 13, 2013 Where we have to put it ?? Where you want to use it. Normally people will add that to their website's front page. Quote
Moderators mark1million Posted September 9, 2014 Moderators Report Posted September 9, 2014 Twitter changed its access policy in June 2013 and now this push no longer works, has anyone looked at this since? 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.