/*************************************************************************** * Dolphin Smart Community Builder * ----------------- * begin : Mon Mar 23 2006 * copyright : (C) 2006 BoonEx Group * website : http://www.boonex.com/ * This file is part of Dolphin - Smart Community Builder * * Dolphin is free software. This work is licensed under a Creative Commons Attribution 3.0 License. * http://creativecommons.org/licenses/by/3.0/ * * Dolphin is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * See the Creative Commons Attribution 3.0 License for more details. * You should have received a copy of the Creative Commons Attribution 3.0 License along with Dolphin, * see license.txt file; if not, write to marketing@boonex.com ***************************************************************************/ 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_INC . 'admin_design.inc.php' ); require_once( BX_DIRECTORY_PATH_INC . 'utils.inc.php' ); if (getParam("enable_aff") != 'on') { $sCode = MsgBox( _t( '_affiliate_system_was_disabled' ) ); $_page['name_index'] = 0; $_page_cont[0]['page_main_code'] = $sCode; PageCode(); exit(); } $logged['aff'] = member_auth( 2 ); $AFF = (int)$_COOKIE['affID']; // - GET variables -------------- $page = (int)$_GET['page']; $p_per_page = (int)$_GET['p_per_page']; $profiles = $_GET['profiles']; $sex = $_GET['sex']; if ( !$page ) $page = 1; if ( !$p_per_page ) $p_per_page = 30; switch( $profiles ) { case 'Unconfirmed': case 'Approval': case 'Active': case 'Rejected': case 'Suspended': $prof_part = "AND Status = '$profiles'"; break; default: $prof_part = ''; } if ( strlen($sex) ) $sex_part = "AND Sex = '" . process_db_input($sex, 1) . "'"; else $sex_part = ''; // ------------------------------ $p_num = db_arr( "SELECT COUNT(*) FROM `Profiles` INNER JOIN `aff_members` ON (`idProfile` = `ID`) WHERE `idAff` = $AFF $prof_part $sex_part" ); $p_num = $p_num[0]; $pages_num = ceil( $p_num / $p_per_page ); $real_first_p = (int)($page - 1) * $p_per_page; $page_first_p = $real_first_p + 1; $result = db_res( "SELECT `Profiles`.* FROM `Profiles` INNER JOIN `aff_members` ON (`idProfile` = `ID`) WHERE `idAff` = $AFF $prof_part $sex_part ORDER BY `DateLastEdit` DESC LIMIT $real_first_p, $p_per_page;" ); $page_p_num = mysql_num_rows( $result ); $_page['header'] = "Members' Profiles"; $_page['header_text'] = "Members profiles sorted by modification date"; $_page['js'] = 1; TopCodeAdmin(); ContentBlockHead("Profiles"); ?>