forked from boonex/dolphin.pro
-
Notifications
You must be signed in to change notification settings - Fork 0
/
viewFriends.php
78 lines (62 loc) · 2.22 KB
/
viewFriends.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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
<?php
/**
* Copyright (c) BoonEx Pty Limited - http://www.boonex.com/
* CC-BY License - http://creativecommons.org/licenses/by/3.0/
*/
require_once('inc/header.inc.php');
require_once(BX_DIRECTORY_PATH_INC . 'design.inc.php');
require_once(BX_DIRECTORY_PATH_INC . 'profiles.inc.php');
require_once(BX_DIRECTORY_PATH_CLASSES . 'BxDolPageView.php');
require_once(BX_DIRECTORY_PATH_CLASSES . 'BxDolFriendsPageView.php');
require_once(BX_DIRECTORY_PATH_CLASSES . 'BxDolPaginate.php');
bx_import('BxTemplProfileView');
bx_import('BxTemplSearchProfile');
$_page['name_index'] = 7;
$_page['css_name'] = array('browse.css');
$_page['js_name'] = 'browse_members.js';
$iProfileId = isset($_GET['iUser']) ? (int)$_GET['iUser'] : getLoggedId();
if (!$iProfileId) {
$_page['header'] = _t('_View friends');
$_page['header_text'] = _t('_View friends');
$_page['name_index'] = 0;
$_page_cont[0]['page_main_code'] = MsgBox(_t('_Profile NA'));
PageCode();
exit;
}
$sPageCaption = _t('_Friends of', getNickName($iProfileId));
$_page['header'] = $sPageCaption;
$_page['header_text'] = $sPageCaption;
$_ni = $_page['name_index'];
// check profile membership, status, privacy and if it is exists
bx_check_profile_visibility($iProfileId, getLoggedId());
// generate page
if (isset($_GET['per_page'])) {
$iPerPage = (int)$_GET['per_page'];
} else {
if (isset($_GET['mode']) && $_GET['mode'] == 'extended') {
$iPerPage = 5;
} else {
$iPerPage = 32;
}
}
if ($iPerPage <= 0) {
$iPerPage = 32;
}
if ($iPerPage > 100) {
$iPerPage = 100;
}
$iPage = isset($_GET['page']) ? (int)$_GET['page'] : 1;
if ($iPage <= 0) {
$iPage = 1;
}
$aDisplayParameters = array(
'per_page' => $iPerPage,
'page' => $iPage,
'mode' => isset($_GET['mode']) ? $_GET['mode'] : null,
'photos' => isset($_GET['photos_only']) ? true : false,
'online' => isset($_GET['online_only']) ? true : false,
'sort' => isset($_GET['sort']) ? $_GET['sort'] : null,
);
$oFriendsPage = new BxDolFriendsPageView('friends', $aDisplayParameters, $iProfileId);
$_page_cont[$_ni]['page_main_code'] = $oFriendsPage->getCode();
PageCode();