Jump to content

Recommended Posts

Posted

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) {

recent.png

  • Moderators
Posted

It works. :D

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:

25.png

  • Moderators
Posted

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:

activ.png

  • Moderators
Posted

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:

activity.png

  • 1 month later...
Posted

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:

activity.png

Where we have to put it :( ??

  • 1 year later...

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