source: trunk/viewFriends.php

Last change on this file was 2, checked in by george, 14 years ago
  • Přidáno: Trunk revize 13719.
File size: 3.5 KB
Line 
1<?php
2
3 /***************************************************************************
4 * Dolphin Smart Community Builder
5 * -----------------
6 * begin : Mon Mar 23 2006
7 * copyright : (C) 2006 BoonEx Group
8 * website : http://www.boonex.com/
9 * This file is part of Dolphin - Smart Community Builder
10 *
11 * Dolphin is free software. This work is licensed under a Creative Commons Attribution 3.0 License.
12 * http://creativecommons.org/licenses/by/3.0/
13 *
14 * Dolphin is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
15 * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
16 * See the Creative Commons Attribution 3.0 License for more details.
17 * You should have received a copy of the Creative Commons Attribution 3.0 License along with Dolphin,
18 * see license.txt file; if not, write to marketing@boonex.com
19 ***************************************************************************/
20
21 require_once( 'inc/header.inc.php' );
22 require_once( BX_DIRECTORY_PATH_INC . 'design.inc.php' );
23 require_once( BX_DIRECTORY_PATH_INC . 'profiles.inc.php' );
24 require_once( BX_DIRECTORY_PATH_CLASSES . 'BxDolPageView.php' );
25
26 require_once( BX_DIRECTORY_PATH_CLASSES . 'BxDolFriendsPageView.php');
27 require_once( BX_DIRECTORY_PATH_CLASSES . 'BxDolPaginate.php');
28
29 bx_import('BxTemplProfileView');
30 bx_import('BxTemplSearchProfile');
31
32 $_page['name_index'] = 7;
33 $_page['css_name'] = array('browse.css');
34 $_page['js_name'] = 'browse_members.js';
35
36 $iProfileId = isset($_GET['iUser']) ? (int) $_GET['iUser'] : getLoggedId();
37
38 if (!$iProfileId)
39 {
40 $_page['header'] = _t('_View friends');
41 $_page['header_text'] = _t('_View friends');
42 $_page['name_index'] = 0;
43 $_page_cont[0]['page_main_code'] = MsgBox( _t("_Profile NA") );
44 PageCode();
45 exit;
46 }
47
48 $sPageCaption = _t( '_Friends of', getNickName($iProfileId) );
49
50 $_page['header'] = $sPageCaption;
51 $_page['header_text'] = $sPageCaption;
52 $_ni = $_page['name_index'];
53
54
55
56 // generate page
57
58 // init some needed varibales ;
59
60 if ( isset($_GET['per_page']) )
61 {
62 $iPerPage = (int) $_GET['per_page'];
63 }
64 else
65 {
66 $iPerPage = ( isset($_GET['mode']) and $_GET['mode'] == 'extended' )
67 ? $iPerPage = 5
68 : $iPerPage = 32;
69 }
70
71 if ( $iPerPage <= 0 )
72 $iPerPage = 32;
73
74 if ( $iPerPage > 100 )
75 $iPerPage = 100;
76
77 $iPage = ( isset($_GET['page']) )
78 ? (int) $_GET['page']
79 : 1;
80
81 if ( $iPage <= 0 )
82 $iPage = 1;
83
84 $aDisplayParameters = array
85 (
86 'per_page' => $iPerPage,
87 'page' => $iPage,
88 'mode' => isset($_GET['mode']) ? $_GET['mode'] : null,
89 'photos' => isset($_GET['photos_only']) ? true : false,
90 'online' => isset($_GET['online_only']) ? true : false,
91 'sort' => isset($_GET['sort']) ? $_GET['sort'] : null,
92 );
93
94 $sPageName = ($logged['member'] and (int)$_COOKIE['memberID'] == $iProfileId) ? 'my_friends' : 'friends';
95
96
97 $oFriendsPage = new BxDolFriendsPageView( $sPageName, $aDisplayParameters, $iProfileId);
98 $sOutputHtml = $oFriendsPage -> getCode();
99
100 $_page_cont[$_ni]['page_main_code'] = $sOutputHtml;
101
102 PageCode();
103
104?>
Note: See TracBrowser for help on using the repository browser.