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