|
From: FlorinCB <ory...@us...> - 2008-08-27 09:48:14
|
Update of /cvsroot/mxbb/core/includes In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv2734 Modified Files: mx_functions_style.php Log Message: well, well Index: mx_functions_style.php =================================================================== RCS file: /cvsroot/mxbb/core/includes/mx_functions_style.php,v retrieving revision 1.85 retrieving revision 1.86 diff -C2 -d -r1.85 -r1.86 *** mx_functions_style.php 27 Aug 2008 08:00:08 -0000 1.85 --- mx_functions_style.php 27 Aug 2008 09:48:07 -0000 1.86 *************** *** 663,681 **** WHERE portal_backend = '" . PORTAL_BACKEND . "' AND themes_id = " . (int) $style; ! break; case 'phpbb2': $sql = "SELECT bbt.* FROM " . MX_THEMES_TABLE . " mxt, " . THEMES_TABLE . " bbt ! WHERE mxt.style_name = bbt.style_name AND mxt.portal_backend = '" . PORTAL_BACKEND . "' ! AND bbt.themes_id = " . (int) $style; ! break; case 'phpbb3': ! $sql = "SELECT bbt.* ! FROM " . MX_THEMES_TABLE . " mxt, " . STYLES_TABLE . " bbt ! WHERE mxt.style_name = bbt.style_name ! AND mxt.portal_backend = '" . PORTAL_BACKEND . "' ! AND bbt.style_id = " . (int) $style; ! break; } --- 663,682 ---- WHERE portal_backend = '" . PORTAL_BACKEND . "' AND themes_id = " . (int) $style; ! break; case 'phpbb2': $sql = "SELECT bbt.* FROM " . MX_THEMES_TABLE . " mxt, " . THEMES_TABLE . " bbt ! WHERE mxt.template_name = bbt.template_name 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; } *************** *** 690,697 **** if ( !($row = $db->sql_fetchrow($result)) ) { - //mx_message_die(CRITICAL_ERROR, "Could not query database for theme info", '', __LINE__, __FILE__, $sql); - - $style = $portal_config['default_style']; - switch (PORTAL_BACKEND) { --- 691,694 ---- *************** *** 701,747 **** WHERE portal_backend = '" . PORTAL_BACKEND . "' AND themes_id = " . (int) $style; ! break; case 'phpbb2': $sql = "SELECT bbt.* FROM " . MX_THEMES_TABLE . " mxt, " . THEMES_TABLE . " bbt ! WHERE mxt.style_name = bbt.style_name AND mxt.portal_backend = '" . PORTAL_BACKEND . "' ! AND mxt.themes_id = " . (int) $style; ! break; case 'phpbb3': ! $sql = "SELECT bbt.* ! FROM " . MX_THEMES_TABLE . " mxt, " . STYLES_TABLE . " bbt ! WHERE mxt.style_name = bbt.style_name ! AND mxt.portal_backend = '" . PORTAL_BACKEND . "' ! AND mxt.themes_id = " . (int) $style; ! break; } if ( !($result = $db->sql_query($sql, 120)) ) { ! mx_message_die(CRITICAL_ERROR, 'Could not query database for theme info'); } - // - // Last desperate try... - // if ( !($row = $db->sql_fetchrow($result)) ) ! { switch (PORTAL_BACKEND) { case 'internal': ! $sql = 'SELECT * ! FROM ' . MX_THEMES_TABLE . ' ! LIMIT 1'; break; case 'phpbb2': ! $sql = 'SELECT * ! FROM ' . THEMES_TABLE . ' ! LIMIT 1'; break; case 'phpbb3': ! $sql = 'SELECT * ! FROM ' . STYLES_TABLE . ' ! LIMIT 1'; break; } --- 698,750 ---- WHERE portal_backend = '" . PORTAL_BACKEND . "' AND themes_id = " . (int) $style; ! break; case 'phpbb2': $sql = "SELECT bbt.* FROM " . MX_THEMES_TABLE . " mxt, " . THEMES_TABLE . " bbt ! WHERE mxt.style_name = bbt.template_name AND mxt.portal_backend = '" . PORTAL_BACKEND . "' ! AND bbt.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 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); } if ( !($row = $db->sql_fetchrow($result)) ) ! { ! $style = $portal_config['default_style']; ! switch (PORTAL_BACKEND) { case 'internal': ! $sql = "SELECT * ! FROM " . MX_THEMES_TABLE . " ! WHERE portal_backend = '" . PORTAL_BACKEND . "' ! AND themes_id = " . (int) $style; break; case 'phpbb2': ! $sql = "SELECT bbt.* ! FROM " . MX_THEMES_TABLE . " mxt, " . THEMES_TABLE . " bbt ! WHERE mxt.style_name = bbt.style_name ! 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; } *************** *** 752,760 **** } if ( !($row = $db->sql_fetchrow($result)) ) { ! mx_message_die(CRITICAL_ERROR, "Could not get MX-Publisher style data for themes_id [$style]"); } ! } } --- 755,791 ---- } + // + // Last desperate try... + // if ( !($row = $db->sql_fetchrow($result)) ) { ! switch (PORTAL_BACKEND) ! { ! case 'internal': ! $sql = 'SELECT * ! FROM ' . MX_THEMES_TABLE; ! break; ! case 'phpbb2': ! $sql = 'SELECT * ! FROM ' . THEMES_TABLE; ! break; ! case 'phpbb3': ! $sql = 'SELECT bbt.*, stt.* ! FROM ' . STYLES_TABLE . ' bbt, ' . STYLES_TEMPLATE_TABLE . ' stt ! WERE bbt.style_id = stt.template_id'; ! break; ! } ! ! if ( !($result = $db->sql_query_limit($sql, 1)) ) ! { ! mx_message_die(CRITICAL_ERROR, 'Could not query database for theme info'); ! } ! ! if ( !($row = $db->sql_fetchrow($result)) ) ! { ! mx_message_die(CRITICAL_ERROR, "Could not get MX-Publisher style data for themes_id [$style]"); ! } } ! } } *************** *** 772,776 **** break; case 'phpbb3': ! $this->template_name = $row['style_name']; $style = $row['style_id']; break; --- 803,807 ---- break; case 'phpbb3': ! $this->template_name = $row['template_path']; $style = $row['style_id']; break; *************** *** 855,860 **** // Load MX-Publisher Template configuration data // ! @include($mx_root_path . $this->current_template_path . '/' . $this->template_name . '.cfg'); /* Removed since in 3.0.x+ our default template is no style if ( !$mx_template_config ) --- 886,892 ---- // Load MX-Publisher Template configuration data // ! @include($mx_root_path . $this->current_template_path . '/' . $this->template_name . '.cfg'); + /* Removed since in 3.0.x+ our default template is no style if ( !$mx_template_config ) |