Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function activityType($activity_type){
- switch ($activity_type) {
- case 0:
- echo "ERROR";
- break;
- case 1:
- return "are now following user ID ";
- break;
- case 2:
- return " have uploaded an photo, the photo ID is ";
- break;
- }
- }
- function activityFeed($CurrentUser){
- $query = mysql_query("SELECT * FROM `follow` WHERE `user_id` = '$CurrentUser'") or trigger_error(mysql_error().$query);
- while($row = mysql_fetch_array($query)){
- @$following[] .= $row['follow_id']; // grabs a array of who current user is following e.g user_ids 3,8,34,75.
- }
- foreach($following as $k => $value){
- $query = mysql_query("SELECT * FROM `activity` WHERE `user_id` = '$value'") or trigger_error(mysql_error().$query); // grabs all activitys from each user i am following
- while($row = mysql_fetch_array($query)){// for every activty per user display the activty.
- @$activitys['id'][] = $row['id'];
- @$activitys['user_id'][] = $row['user_id'];
- @$activitys['source_id'][] = $row['source_id'];
- //$activity_type = activityType($row['activity_type']);
- //echo "I am following user $value . They ".$activity_type."".$row['source_id']."<br />";
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement