/*************************************************************************** * 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' ); require_once( BX_DIRECTORY_PATH_INC . 'params.inc.php' ); $logged['admin'] = member_auth( 1, true, true ); $ADMIN = $logged[admin]; $_page['css_name'] = 'post_mod_polls.css'; // =================================================================== // =================================================================== if ( $_POST['confirm'] ) { $query = ''; foreach ( $_POST as $key => $value ) { if ( 'poll' == $value ) $query .= " `id_poll` = '$key' or "; } $query = "UPDATE ProfilesPolls SET `poll_approval` = 1 WHERE " . $query . " 1 = 0 "; db_res( $query ); } elseif ( $_POST['delete'] ) { $query = ''; foreach ( $_POST as $key => $value ) { if ( 'poll' == $value ) $query .= " id_poll = '$key' or "; } $query = "DELETE FROM ProfilesPolls WHERE " . $query . " 1 = 0 "; db_res( $query ); } // =================================================================== // - GET variables -------------- // =================================================================== $page = (int)$_GET[page]; $p_per_page = (int)$_GET[p_per_page]; //$real_first_p = (int)($page - 1) * $p_per_page; //$page_first_p = $real_first_p + 1; $max_photo_height = $max_photo_height + 2; $max_photo_width = $max_photo_width + 2; if ( !$page ) $page = 1; if ( !$p_per_page ) $p_per_page = 10; // ------------------------------ $sql = "SELECT COUNT(*) FROM ProfilesPolls WHERE `poll_approval` = '0'"; $p_num = db_arr( $sql ); $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 `id_profile`, `id_poll` FROM ProfilesPolls WHERE `poll_approval` = 0 LIMIT $real_first_p, $p_per_page;" ); $_page['header'] = "Polls PostModeration"; $_page['header_text'] = "Polls that need to be checked by admin"; $_page['js'] = 1; $_page['js_name'] = 'profile_poll.js'; TopCodeAdmin(); ContentBlockHead("Created (and not yet approved) profile polls:"); ?>