Skip to content

Instantly share code, notes, and snippets.

@martisj
Created September 6, 2012 11:29
Show Gist options
  • Save martisj/3655139 to your computer and use it in GitHub Desktop.
Save martisj/3655139 to your computer and use it in GitHub Desktop.
The part that generates the specific activity entry, i.e. the one that shows the connections between the current users friends.
<?
$friends_friend = repo('Users')->findOneBy(array('id'=>$notification->get_entity_id()));
$connected = array();
$displayed = array(); //used to prevent multiple classes being displayed
foreach($all_notifications as $connected_to)
{
// var_doctrine($connected_to);
// die();
$fid = $connected_to->get_user_from_id();
echo $fid;
if(!in_array($fid, $displayed))
{
$friend = repo('Users')->findOneBy(array('id'=>$connected_to->get_user_from_id()));
$connected[] = anchor('user/profile/'.$friend->getId(),$friend->getUsername());
$displayed[] = $fid;
}
}
$connected = implode_and($connected);
?>
<div class="icon home_icon">
<?= img(array('src'=>get_user_profile_pic($friends_friend->getId(),'square'),'height'=>'38'));?>
</div>
<div class="home_content">
<span>
<span class="home_title" onclick="location.href='<?=base_url()?>user/profile/<?=$friends_friend->getId()?>'" class=msg_subtitle><?= anchor('user/profile/'.$friends_friend->getId(), $friends_friend->getUsername()) ?> (<?=$friends_friend->getCourse()->getNameNoBrackets();?>) is now connected with <?=$connected?></span>
</span>
</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment