|
From: OryNider <ory...@us...> - 2008-01-28 03:08:28
|
Update of /cvsroot/mxbb/mx_linkdb/linkdb In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv21209/linkdb Modified Files: Tag: core28x linkdb_common.php Log Message: phpBB2 switches Index: linkdb_common.php =================================================================== RCS file: /cvsroot/mxbb/mx_linkdb/linkdb/linkdb_common.php,v retrieving revision 1.5 retrieving revision 1.5.2.1 diff -C2 -d -r1.5 -r1.5.2.1 *** linkdb_common.php 13 Aug 2006 19:43:51 -0000 1.5 --- linkdb_common.php 28 Jan 2008 03:08:25 -0000 1.5.2.1 *************** *** 75,79 **** // - Class mx_text_formatting // ! include_once( $mx_root_path . 'includes/mx_functions_tools.' . $phpEx ); include_once( $module_root_path . 'linkdb/includes/functions.' . $phpEx ); --- 75,194 ---- // - 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 . 'linkdb/language/lang_' . $board_config['default_lang'] . '/lang_main.' . $phpEx ) ) ! { ! include( $module_root_path . 'linkdb/language/lang_english/lang_main.' . $phpEx ); ! } ! else ! { ! include( $module_root_path . 'linkdb/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/' ; ! //$template_name = $row['template_name'] ; ! ! //$template = new Template($phpbb_root_path . $template_path . $template_name); ! ! if ( $template ) ! { ! $current_template_path = $template_path . $template_name; ! } ! else ! { ! $current_template_path = $template_path . 'subSilver'; ! } ! ! // ------------------------------------------------------------------------- ! // Prefix with PORTAL_URL ! // ------------------------------------------------------------------------- ! $current_template_images = $phpbb_root_path . $current_template_path . "/images"; ! ! @include($phpbb_root_path . $template_path . $template_name . '/' . 'linkdb.cfg'); ! ! $img_lang = ( file_exists($phpbb_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); ! //$mx_images[$key] = str_replace('admin/templates/','templates/',$mx_images[$key]); ! } ! ! } ! } include_once( $module_root_path . 'linkdb/includes/functions.' . $phpEx ); |