|
From: Jon O. <jon...@us...> - 2008-02-15 22:14:27
|
Update of /cvsroot/mxbb/mx_pafiledb/pafiledb In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv23057/pafiledb Modified Files: pafiledb_common.php Log Message: Updated, sync with phpBB2 standalone usage Trailing newlines Bad globals Index: pafiledb_common.php =================================================================== RCS file: /cvsroot/mxbb/mx_pafiledb/pafiledb/pafiledb_common.php,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** pafiledb_common.php 9 Sep 2007 20:15:47 -0000 1.20 --- pafiledb_common.php 15 Feb 2008 22:14:23 -0000 1.21 *************** *** 75,79 **** // - Class mx_text_formatting // ! include_once( $mx_root_path . 'includes/mx_functions_tools.' . $phpEx ); include_once( $module_root_path . 'pafiledb/includes/functions.' . $phpEx ); --- 75,188 ---- // - Class mx_text_formatting // ! if ( !MXBB_MODULE ) ! { ! include_once( $mx_mod_path . 'includes/functions_tools.' . $phpEx ); ! } ! else ! { ! include_once( $mx_root_path . 'includes/mx_functions_tools.' . $phpEx ); ! } ! ! // ********************************************************************** ! // If phpBB mod read language definition ! // ********************************************************************** ! ! if ( !MXBB_MODULE ) ! { ! if ( !file_exists( $module_root_path . 'pafiledb/language/lang_' . $board_config['default_lang'] . '/lang_main.' . $phpEx ) ) ! { ! include( $module_root_path . 'pafiledb/language/lang_english/lang_main.' . $phpEx ); ! } ! else ! { ! include( $module_root_path . 'pafiledb/language/lang_' . $board_config['default_lang'] . '/lang_main.' . $phpEx ); ! } ! } ! ! // ********************************************************************** ! // If phpBB mod read theme definition and language in theme definition ! // ********************************************************************** ! if ( !MXBB_MODULE ) ! { ! $sql = 'SELECT * ! FROM ' . THEMES_TABLE . ' ! WHERE themes_id = ' . (int) $userdata['user_style']; ! if ( !($result = $db->sql_query($sql)) ) ! { ! message_die(CRITICAL_ERROR, 'Could not query database for theme info'); ! } ! ! if ( $row = $db->sql_fetchrow($result) ) ! { ! $db->sql_freeresult($result); ! $template_name = $row['template_name'] ; ! } ! else ! { ! // We are trying to setup a style which does not exist in the database ! // Try to fallback to the board default (if the user had a custom style) ! // and then any users using this style to the default if it succeeds ! if ( $userdata['user_style'] != $board_config['default_style']) ! { ! $sql = 'SELECT * ! FROM ' . THEMES_TABLE . ' ! WHERE themes_id = ' . (int) $board_config['default_style']; ! if ( !($result = $db->sql_query($sql)) ) ! { ! message_die(CRITICAL_ERROR, 'Could not query database for theme info'); ! } ! if ( $row = $db->sql_fetchrow($result) ) ! { ! $db->sql_freeresult($result); ! $template_name = $row['template_name'] ; ! } ! else ! { ! message_die(CRITICAL_ERROR, "Could not get theme data for themes_id [$style]"); ! } ! } ! else ! { ! message_die(CRITICAL_ERROR, "Could not get theme data for themes_id [$style]"); ! } ! } ! ! $template_path = 'templates/' ; ! ! if ( $template ) ! { ! $current_template_path = $template_path . $template_name; ! } ! else ! { ! $current_template_path = $template_path . 'subSilver'; ! } ! ! // ------------------------------------------------------------------------- ! // Prefix with PORTAL_URL ! // ------------------------------------------------------------------------- ! $current_template_images = PORTAL_URL . $current_template_path . "/images"; ! ! @include($phpbb_root_path . $template_path . $template_name . '/' . 'pafiledb.cfg'); ! ! $img_lang = ( file_exists($mx_root_path . $current_template_path . '/images/lang_' . $board_config['default_lang']) ) ? $board_config['default_lang'] : 'english'; ! ! while( list($key, $value) = @each($mx_images) ) ! { ! if (is_array($value)) ! { ! foreach( $value as $key2 => $val2 ) ! { ! $images[$key][$key2] = $val2; ! $mx_images[$key][$key2] = $val2; ! } ! } ! else ! { ! $images[$key] = str_replace('{LANG}', 'lang_' . $img_lang, $value); ! $mx_images[$key] = str_replace('{LANG}', 'lang_' . $img_lang, $value); ! } ! } ! } include_once( $module_root_path . 'pafiledb/includes/functions.' . $phpEx ); *************** *** 81,86 **** //include_once( $module_root_path . 'pafiledb/includes/functions_mx.' . $phpEx ); include_once( $module_root_path . 'pafiledb/includes/functions_pafiledb.' . $phpEx ); ! //include_once( $module_root_path . 'pafiledb/includes/template.' . $phpEx ); ! // Removed old template class, display->pparse, ... // =================================================== --- 190,202 ---- //include_once( $module_root_path . 'pafiledb/includes/functions_mx.' . $phpEx ); include_once( $module_root_path . 'pafiledb/includes/functions_pafiledb.' . $phpEx ); ! ! // ! // We need XS templates, also when ran as a phpBB2 MOD ! // ! if ( !MXBB_MODULE ) ! { ! include_once( $module_root_path . 'pafiledb/includes/template.' . $phpEx ); // Include XS template ! $template = new Template($module_root_path . 'templates/'. $theme['template_name']); ! } // =================================================== *************** *** 100,106 **** } - //$pafiledb_template = new pafiledb_template(); - //$pafiledb_template->set_template( $theme['template_name'] ); - $pafiledb_user = new mx_user_info(); --- 216,219 ---- |