BoonEx Home Trac
 
 

root/trunk/browse.php

Revision 8060, 3.0 kB (checked in by sas, 3 weeks ago)

--

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_ROOT . "templates/tmpl_{$tmpl}/scripts/BxTemplBrowse.php" );
24
25 $_page['name_index'] = 7;
26 $_page['header'] = _t("_Browse Profiles", $site['title']);
27 $_page['header_text'] = _t("_Browse Profiles");
28 $_page['css_name'] = 'browse.css';
29 $_page['js_name']  = 'browse.js';
30
31 check_logged();
32
33 $_ni = $_page['name_index'];
34
35 // init some needed `GET` parameters ;
36
37 $sSex     = ( isset($_GET['sex']) )        ? clear_xss($_GET['sex'])     : null;
38 $sAge     = ( isset($_GET['age']) )        ? clear_xss($_GET['age'])     : null;
39 $sCountry = ( isset($_GET['country']) ) ? clear_xss($_GET['country']) : null;
40 $sSort    = ( isset($_GET['sort']) )    ? clear_xss($_GET['sort'])      : null;
41
42 $sPhotos  = ( isset($_GET['photos_only']) )    ? $_GET['photos_only']    : null;
43 $sOnline  = ( isset($_GET['online_only']) )    ? $_GET['online_only']    : null;   
44         
45 $sInfoMode = ( isset($_GET['mode']) and $_GET['mode'] == 'extended' ) ? 'extended' : null;
46
47 $iPage    = ( isset($_GET['page']) )    ? (int) $_GET['page'] : 1;
48 if ( $iPage    <= 0 )
49 {
50     $iPage = 1;
51 }
52
53 if ( isset($_GET['per_page']) )
54 {
55     $iPerPage = (int) $_GET['per_page'];
56 }
57 else
58 {
59     if ( $sInfoMode == 'extended' )
60         $iPerPage = 5;
61     else
62         $iPerPage = 32;
63 }       
64
65 if ( $iPerPage    <= 0 )
66 {
67     $iPerPage = 32;
68 }
69
70 if ( $iPerPage > 100 )
71 {
72     $iPerPage = 100;
73 }
74
75 // fill array with get parameters ;
76 $aFilteredSettings = array
77 (
78     'sex'             => $sSex,
79     'age'             => $sAge,
80     'country'         => $sCountry,
81     'photos_only'    => $sPhotos,
82     'online_only'    => $sOnline,
83 );
84
85 // fill array with some browse settings ;
86 $aDisplaySettings = array(
87     'page'             => $iPage,
88     'per_page'         => $iPerPage,
89     'sort'            => $sSort,
90     'mode'            => $sInfoMode,
91 );
92
93 $oBrowsePage = &new BxTemplBrowse( $aFilteredSettings, $aDisplaySettings, 'browse_page' );
94 $sOutputHtml  = $oBrowsePage -> getCode();
95
96 $_page_cont[$_ni]['page_main_code'] = $sOutputHtml;
97
98 PageCode();
99
100 ?>
Note: See TracBrowser for help on using the browser.