|
From: FlorinCB <ory...@us...> - 2008-10-04 21:15:56
|
Update of /cvsroot/mxbb/core/includes In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv31848 Modified Files: mx_functions_style.php Log Message: queries for phpBB3 backend upgraded and fixed. there is still issue with portal_url in phpBB3 graphic Index: mx_functions_style.php =================================================================== RCS file: /cvsroot/mxbb/core/includes/mx_functions_style.php,v retrieving revision 1.96 retrieving revision 1.97 diff -C2 -d -r1.96 -r1.97 *** mx_functions_style.php 4 Oct 2008 18:16:26 -0000 1.96 --- mx_functions_style.php 4 Oct 2008 21:13:14 -0000 1.97 *************** *** 737,741 **** global $template, $lang, $phpEx, $phpbb_root_path, $mx_root_path, $db; global $mx_page, $mx_request_vars; ! // // Build Portal style --- 737,741 ---- global $template, $lang, $phpEx, $phpbb_root_path, $mx_root_path, $db; global $mx_page, $mx_request_vars; ! // // Build Portal style *************** *** 797,801 **** $style = $mx_request_vars->post('default_style', MX_TYPE_INT, $init_style); $theme = $this->_setup_style($style); ! return; } --- 797,801 ---- $style = $mx_request_vars->post('default_style', MX_TYPE_INT, $init_style); $theme = $this->_setup_style($style); ! return; } *************** *** 811,815 **** { global $db, $board_config, $portal_config, $template, $phpbb_root_path, $mx_root_path, $theme; ! // // Get Style data. --- 811,815 ---- { global $db, $board_config, $portal_config, $template, $phpbb_root_path, $mx_root_path, $theme; ! // // Get Style data. *************** *** 859,863 **** break; case 'phpbb2': ! $sql = "SELECT bbt.* FROM " . MX_THEMES_TABLE . " mxt, " . THEMES_TABLE . " bbt WHERE mxt.style_name = bbt.template_name --- 859,863 ---- break; case 'phpbb2': ! $sql = "SELECT mxt.*, bbt.* FROM " . MX_THEMES_TABLE . " mxt, " . THEMES_TABLE . " bbt WHERE mxt.style_name = bbt.template_name *************** *** 866,879 **** break; case 'phpbb3': ! $sql = "SELECT bbt.*, stt.* ! FROM " . MX_THEMES_TABLE . " mxt, " . STYLES_TABLE . " bbt, " . STYLES_TEMPLATE_TABLE . " stt ! WHERE mxt.template_name = stt.template_path ! AND bbt.style_id = stt.template_id ! AND mxt.portal_backend = '" . PORTAL_BACKEND . "' ! AND stt.template_path = " . (int) $style; break; } ! if ( !($result = $db->sql_query($sql, 120)) ) { mx_message_die(CRITICAL_ERROR, "Could not query database for theme info", '', __LINE__, __FILE__, $sql); --- 866,890 ---- break; case 'phpbb3': ! //Try standard style name ! $sql = "SELECT mxt . *, stt . * , bbt . * ! FROM " . MX_THEMES_TABLE . " AS mxt, " . STYLES_TEMPLATE_TABLE . " AS stt, " . STYLES_TABLE . " AS bbt ! WHERE mxt.themes_id = " . (int) $style . " ! AND mxt.portal_backend = '" . PORTAL_BACKEND . "' ! AND stt.template_id = bbt.template_id ! AND bbt.style_name = mxt.template_name"; ! //If not standard style name or with spaces try someting else ! if ( !$db->sql_fetchrow($db->sql_query($sql) ) ) ! { ! $sql = "SELECT mxt . *, stt . * , bbt . * ! FROM " . MX_THEMES_TABLE . " AS mxt, " . STYLES_TEMPLATE_TABLE . " AS stt, " . STYLES_TABLE . " AS bbt ! WHERE mxt.themes_id = " . (int) $style . " ! AND mxt.portal_backend = '" . PORTAL_BACKEND . "' ! AND stt.template_id = bbt.template_id ! AND stt.template_path = mxt.template_name"; ! } break; } ! if ( !($result = $db->sql_query($sql)) ) { mx_message_die(CRITICAL_ERROR, "Could not query database for theme info", '', __LINE__, __FILE__, $sql); *************** *** 881,887 **** if ( !($row = $db->sql_fetchrow($result)) ) ! { $style = $portal_config['default_style']; ! switch (PORTAL_BACKEND) { --- 892,898 ---- if ( !($row = $db->sql_fetchrow($result)) ) ! { $style = $portal_config['default_style']; ! switch (PORTAL_BACKEND) { *************** *** 891,895 **** WHERE portal_backend = '" . PORTAL_BACKEND . "' AND themes_id = " . (int) $style; ! break; case 'phpbb2': $sql = "SELECT bbt.* --- 902,906 ---- WHERE portal_backend = '" . PORTAL_BACKEND . "' AND themes_id = " . (int) $style; ! break; case 'phpbb2': $sql = "SELECT bbt.* *************** *** 898,910 **** AND mxt.portal_backend = '" . PORTAL_BACKEND . "' AND mxt.themes_id = " . (int) $style; ! break; case 'phpbb3': ! $sql = "SELECT bbt.*, stt.* ! FROM " . MX_THEMES_TABLE . " mxt, " . STYLES_TABLE . " bbt, " . STYLES_TEMPLATE_TABLE . " stt ! WHERE mxt.template_name = stt.template_path ! AND bbt.style_id = stt.template_id ! AND mxt.portal_backend = '" . PORTAL_BACKEND . "' ! AND mxt.themes_id = " . (int) $style; ! break; } --- 909,932 ---- AND mxt.portal_backend = '" . PORTAL_BACKEND . "' AND mxt.themes_id = " . (int) $style; ! break; case 'phpbb3': ! //Try standard style name ! $sql = "SELECT mxt . *, stt . * , bbt . * ! FROM " . MX_THEMES_TABLE . " AS mxt, " . STYLES_TEMPLATE_TABLE . " AS stt, " . STYLES_TABLE . " AS bbt ! WHERE mxt.themes_id = " . (int) $style . " ! AND mxt.portal_backend = '" . PORTAL_BACKEND . "' ! AND stt.template_id = bbt.template_id ! AND bbt.style_name = mxt.template_name"; ! //If not standard style name or with spaces try someting else ! if ( !$db->sql_fetchrow($db->sql_query($sql) ) ) ! { ! $sql = "SELECT mxt . *, stt . * , bbt . * ! FROM " . MX_THEMES_TABLE . " AS mxt, " . STYLES_TEMPLATE_TABLE . " AS stt, " . STYLES_TABLE . " AS bbt ! WHERE mxt.themes_id = " . (int) $style . " ! AND mxt.portal_backend = '" . PORTAL_BACKEND . "' ! AND stt.template_id = bbt.template_id ! AND stt.template_path = mxt.template_name"; ! } ! break; } *************** *** 930,934 **** break; case 'phpbb3': ! $sql = "SELECT bbt.*, stt.* FROM " . MX_THEMES_TABLE . " mxt, " . STYLES_TABLE . " bbt, " . STYLES_TEMPLATE_TABLE . " stt WHERE mxt.template_name = stt.template_path"; --- 952,956 ---- break; case 'phpbb3': ! $sql = "SELECT mxt.*, bbt.*, stt.* FROM " . MX_THEMES_TABLE . " mxt, " . STYLES_TABLE . " bbt, " . STYLES_TEMPLATE_TABLE . " stt WHERE mxt.template_name = stt.template_path"; |