Campustream 1.0
A social network MQP for WPI
application/views/user/friendlist.php
Go to the documentation of this file.
00001 <?
00002 $friends = null;
00003 if ($type == 'followers') {
00004         $friends = $user->followers;
00005 } else {
00006         $friends = $user->follows;
00007 }
00008 ?>
00009 <div id="user-profile">
00010 
00011         <div id="content-left">
00012                 <? if($type == 'follows'): ?>
00013                 <h1>Users <?=$user->name?> follows</h1>
00014                 <? else: ?>
00015                 <h1>Users that follow <?=$user->name?></h1>
00016                 <? endif; ?>
00017                 
00018                 <? foreach($friends as $friend): ?>
00019                 <div class="user-list-wrap">
00020                         <div class="user-list-photo">
00021                                 <img src="<?=$friend->avatar?>" />
00022                         </div>
00023                         <div class="user-list-info">
00024                                 <h1><a href="/user/<?=$friend->username?>"><?=$friend->name?></a> <span><a href="mailto:<?=$friend->username?>@wpi.edu"><?=$friend->username?></a></span></h1>
00025                                 <p><?=$friend->bio?></p>
00026                                 
00027                                 <? if(sess::is_logged_in() && !sess::isActiveUser($friend)): ?>
00028                                 <div id="follow_<?=$friend->username?>" class="follow-button">
00029                                         <? if(sess::getUser()->is_following($friend->id)): ?>
00030                                         <a href="#" class="following">Following</a>
00031                                         <? else: ?>
00032                                         <a href="#" class="follow">Follow</a>
00033                                         <? endif; ?>
00034                                 </div>
00035                                 <? endif; ?>
00036                         </div>
00037                         
00038                         <div style="clear:both"></div>
00039                 </div>
00040                 <? endforeach; ?>
00041         </div>
00042         
00043         <div id="content-right">
00044                 <?=View::factory('template/_sidebar')->set('user', $user)->render()?>
00045         </div>
00046 
00047         <div style="clear:both;"></div>
00048 </div>