$p = 1; } if (isset($_POST['cpp'])) { $cpp = $_POST['cpp']; } elseif (isset($_GET['cpp'])) { $cpp = $_GET['cpp']; } else { $cpp = 1; } // GET GROUP ALBUM INFO $groupalbum_info = $database->database_fetch_assoc($database->database_query("SELECT groupalbum_id FROM se_groupalbums WHERE groupalbum_group_id='{$group->group_info['group_id']}' LIMIT 1")); // GET TOTAL FILES $total_files = $group->group_media_total($groupalbum_info['groupalbum_id']); // MAKE FILE PAGES AND GET FILE ARRAY $page_vars = make_page($total_files, $cpp, $p); $group_files = $group->group_media_list($page_vars[0], $cpp, $sort_by = "groupmedia_date DESC", $where = ""); // CONSTRUCT JSON RESPONSE $file_output = array('total_files' => (int) $total_files, 'maxpage' => (int) $page_vars[2], 'p_start' => (int) ($page_vars[0] + 1), 'p_end' => (int) ($page_vars[0] + count($group_files)), 'p' => (int) $page_vars[1], 'files' => $group_files); echo json_encode($file_output); exit; } // GET PRIVACY LEVEL $privacy_max = $group->group_privacy_max($user); $allowed_to_view = (bool) ($privacy_max & $group->group_info['group_privacy']); $is_group_private = !$allowed_to_view; // CHECK IF USER IS ALLOWED TO COMMENT $allowed_to_comment = (bool) ($privacy_max & $group->group_info['group_comments']); // CHECK IF USER IS ALLOWED TO POST IN DISCUSSION $allowed_to_discuss = (bool) ($privacy_max & $group->group_info['group_discussion']); // CHECK IF USER IS ALLOWED TO UPLOAD PHOTOS $allowed_to_upload = (bool) ($privacy_max & $group->group_info['group_upload']);