forked from buckyroberts/Social-Network
-
Notifications
You must be signed in to change notification settings - Fork 0
/
get_activities.php
32 lines (27 loc) · 1.04 KB
/
get_activities.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
<?php
require(dirname(__FILE__) . '/includes/bootstrap.php');
if(!($userID = buckys_is_logged_in())){
exit();
}
if($_POST['action'] == 'activity-notification'){
$acount = isset($_POST['acount']) ? intval($_POST['acount']) : 15;
$rows = BuckysActivity::getActivities($userID, $acount);
$activities = '';
foreach($rows as $row){
$activities .= BuckysActivity::getActivityHTML($row, $userID);
}
if(count($rows) == $acount){
$activities .= "<div class='clear'></div><a href='#' class='view-more'>view more</a>";
}
$ncount = isset($_POST['ncount']) ? intval($_POST['ncount']) : 15;
$rows = BuckysActivity::getNotifications($userID, $ncount);
$notifications = '';
foreach($rows as $row){
$notifications .= BuckysActivity::getActivityHTML($row, $userID);
}
if(count($rows) == $ncount){
$notifications .= "<div class='clear'></div><a href='#' class='view-more'>view more</a>";
}
render_result_xml(['notifications' => $notifications, 'activities' => $activities]);
exit();
}