|
From: Jon O. <jon...@us...> - 2008-07-15 22:04:06
|
Update of /cvsroot/mxbb/core/includes/sessions/phpbb2 In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv23076/phpbb2 Modified Files: core.php Added Files: functions.php Log Message: More...of the same --- NEW FILE: functions.php --- <?php /** * * @package Auth * @version $Id: functions.php,v 1.1 2008/07/15 22:03:30 jonohlsson Exp $ * @copyright (c) 2002-2008 MX-Publisher Project Team * @license http://opensource.org/licenses/gpl-license.php GNU General Public License v2 * @link http://www.mx-publisher.com * */ if ( !defined( 'IN_PORTAL' ) ) { die( "Hacking attempt" ); } /** * Get 'Poll Select' html select list. * * Quick and handy function to generate a dropdown select list for current phpbb polls * * @param string $default_poll select idfield = id * @param string $select_name select name * @return string (html) */ function poll_select($default_poll, $select_name = 'Poll_Topic_id') { global $db; $style_select = '<select name="' . $select_name . '">'; $selected = ( $default_poll == 0 ) ? ' selected="selected"' : ''; $style_select .= '<option value="0"' . $selected . '>' . 'The most recent' . "</option>\n"; $sql = "SELECT topic_id, vote_text FROM " . VOTE_DESC_TABLE . " ORDER BY vote_text, topic_id"; if( !($result = $db->sql_query($sql)) ) { mx_message_die(GENERAL_ERROR, "Couldn't query polls table", '', __LINE__, __FILE__, $sql); } while( $row = $db->sql_fetchrow($result) ) { $selected = ( $row['topic_id'] == $default_poll ) ? ' selected="selected"' : ''; $style_select .= '<option value="' . $row['topic_id'] . '"' . $selected . '>' . $row['vote_text'] . "</option>\n"; } $style_select .= '</select>'; unset($row); $db->sql_freeresult($result); return $style_select; } ?> Index: core.php =================================================================== RCS file: /cvsroot/mxbb/core/includes/sessions/phpbb2/core.php,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** core.php 13 Jul 2008 21:29:12 -0000 1.10 --- core.php 15 Jul 2008 22:03:29 -0000 1.11 *************** *** 22,29 **** include_once($mx_root_path . 'includes/shared/phpbb3/includes/functions.' . $phpEx); ! include_once($mx_root_path . 'includes/sessions/phpbb2/auth.' . $phpEx); ! include_once($mx_root_path . 'includes/mx_functions_bbcode.' . $phpEx); // BBCode associated functions /** * Permission/Auth class --- 22,40 ---- include_once($mx_root_path . 'includes/shared/phpbb3/includes/functions.' . $phpEx); ! // ! // Now load some bbcodes, to be extended for this backend (see below) ! // include_once($mx_root_path . 'includes/mx_functions_bbcode.' . $phpEx); // BBCode associated functions + // + // Finally, load some backend specific functions + // + include_once($mx_root_path . 'includes/sessions/phpbb2/functions.' . $phpEx); + + // + // phpBB Permissions + // + include_once($mx_root_path . 'includes/sessions/phpbb2/auth.' . $phpEx); + /** * Permission/Auth class *************** *** 244,248 **** --- 255,270 ---- $this->sync_configs(); + // + // Dummy include, to make all original phpBB functions available + // include_once($phpbb_root_path . 'includes/functions.' . $phpEx); // In case we need old functions... + + // + // Is phpBB File Attachment MOD present? + // + if( file_exists($phpbb_root_path . 'attach_mod') ) + { + include_once($phpbb_root_path . 'attach_mod/attachment_mod.' . $phpEx); + } } *************** *** 900,940 **** } } - - /** - * Get 'Poll Select' html select list. - * - * Quick and handy function to generate a dropdown select list for current phpbb polls - * - * @param string $default_poll select idfield = id - * @param string $select_name select name - * @return string (html) - */ - function poll_select($default_poll, $select_name = 'Poll_Topic_id') - { - global $db; - - $style_select = '<select name="' . $select_name . '">'; - $selected = ( $default_poll == 0 ) ? ' selected="selected"' : ''; - $style_select .= '<option value="0"' . $selected . '>' . 'The most recent' . "</option>\n"; - - $sql = "SELECT topic_id, vote_text - FROM " . VOTE_DESC_TABLE . " - ORDER BY vote_text, topic_id"; - - if( !($result = $db->sql_query($sql)) ) - { - mx_message_die(GENERAL_ERROR, "Couldn't query polls table", '', __LINE__, __FILE__, $sql); - } - - while( $row = $db->sql_fetchrow($result) ) - { - $selected = ( $row['topic_id'] == $default_poll ) ? ' selected="selected"' : ''; - $style_select .= '<option value="' . $row['topic_id'] . '"' . $selected . '>' . $row['vote_text'] . "</option>\n"; - } - $style_select .= '</select>'; - - unset($row); - $db->sql_freeresult($result); - return $style_select; - } ?> \ No newline at end of file --- 922,924 ---- |