|
From: Florin C B. <ory...@us...> - 2013-04-08 22:07:52
|
Update of /cvsroot/mxbb/core/includes/sessions/phpbb3 In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv18241/sessions/phpbb3 Modified Files: session.php Log Message: styles Index: session.php =================================================================== RCS file: /cvsroot/mxbb/core/includes/sessions/phpbb3/session.php,v retrieving revision 1.46 retrieving revision 1.47 diff -C2 -d -r1.46 -r1.47 *** session.php 12 Sep 2012 22:10:20 -0000 1.46 --- session.php 8 Apr 2013 22:07:50 -0000 1.47 *************** *** 1338,1343 **** { global $SID, $_EXTRA_URL; - $style = phpBB3::request_var('style', 0); $SID .= '&style=' . $style; $_EXTRA_URL = array('style=' . $style); --- 1338,1344 ---- { global $SID, $_EXTRA_URL; $style = phpBB3::request_var('style', 0); + // BEGIN Styles_Demo MOD for phpBB Block + $style_value = ''; $SID .= '&style=' . $style; $_EXTRA_URL = array('style=' . $style); *************** *** 1346,1350 **** { $style = $this->style; // From main style init. Should be correct and valid. ! /* */ if(!$board_config['override_user_style'] && ($this->data['user_id'] != ANONYMOUS)) --- 1347,1352 ---- { $style = $this->style; // From main style init. Should be correct and valid. ! // BEGIN Styles_Demo MOD for phpBB Block ! $style_value = ''; /* */ if(!$board_config['override_user_style'] && ($this->data['user_id'] != ANONYMOUS)) *************** *** 1368,1371 **** --- 1370,1374 ---- { $style = $row['style_id']; //User style + $style_value = $row['style_name']; //User style name } else *************** *** 1375,1385 **** } /* */ - // Set up style Temp code should be removed after bugtraking //$style = ($style) ? $style : ((!$board_config['override_user_style'] && $this->data['user_id'] != ANONYMOUS) ? $this->data['user_style'] : $this->phpbb_style['style_id']); } - - // BEGIN Styles_Demo MOD for phpBB Block - $style_value = ''; if (isset($_GET['demostyle'])) { --- 1378,1384 ---- *************** *** 1424,1435 **** { $style_value = $_COOKIE[$config['cookie_name'] . '_change_style']; ! } ! //Change the value before query if (!empty($style_value)) { $style = $style_value; ! } ! //We should never get this, temp fix for GoogleBot-2.1 crawler //Remove this Deguging Code after solved --- 1423,1432 ---- { $style_value = $_COOKIE[$config['cookie_name'] . '_change_style']; ! } //Change the value before query if (!empty($style_value)) { $style = $style_value; ! } //We should never get this, temp fix for GoogleBot-2.1 crawler //Remove this Deguging Code after solved *************** *** 1437,1481 **** { $style_value = 'prosilver'; ! } ! // END Styles_Demo MOD if (intval($style) == 0) { //Query phpBB style_name ! $sql = "SELECT s.style_id, t.template_storedb, t.template_path, t.template_id, t.bbcode_bitfield, c.theme_path, c.theme_name, c.theme_storedb, c.theme_id, i.imageset_path, i.imageset_id, i.imageset_name FROM " . STYLES_TABLE . " AS s, " . STYLES_TEMPLATE_TABLE . " AS t, " . STYLES_THEME_TABLE . " AS c, " . STYLES_IMAGESET_TABLE . " i WHERE s.style_active = 1 AND s.style_name = '$style_value' AND t.template_id = s.template_id AND c.theme_id = s.theme_id ! AND i.imageset_id = s.imageset_id"; ! if(($result = $db->sql_query($sql)) && ($row = $db->sql_fetchrow($result))) { $style = $row['style_id']; } else { mx_message_die(CRITICAL_ERROR, "Could not query database for imageset_id info style_name [$style]", "", __LINE__, __FILE__, $sql); ! } } ! else ! { ! //Query phpBB style_id ! $sql = "SELECT s.style_id, t.template_storedb, t.template_path, t.template_id, t.bbcode_bitfield, c.theme_path, c.theme_name, c.theme_storedb, c.theme_id, i.imageset_path, i.imageset_id, i.imageset_name ! FROM " . STYLES_TABLE . " AS s, " . STYLES_TEMPLATE_TABLE . " AS t, " . STYLES_THEME_TABLE . " AS c, " . STYLES_IMAGESET_TABLE . " i ! WHERE s.style_id = " . (int) $style . " AND t.template_id = s.template_id AND c.theme_id = s.theme_id ! AND i.imageset_id = s.imageset_id"; ! ! if (!$result = $db->sql_query_limit($sql, 1)) { ! mx_message_die(CRITICAL_ERROR, "Could not query database for imageset_id info style_id [$style]", "", __LINE__, __FILE__, $sql); } } ! ! $this->theme = $db->sql_fetchrow($result); $db->sql_freeresult($result); - // User has wrong style if (!$this->theme && $style == $this->data['user_style']) --- 1434,1482 ---- { $style_value = 'prosilver'; ! } ! $mx_style = $style; ! $mx_style_value = $style_value; // END Styles_Demo MOD if (intval($style) == 0) { //Query phpBB style_name ! $sql = "SELECT s.style_id, s.style_name, t.template_storedb, t.template_path, t.template_id, t.bbcode_bitfield, c.theme_path, c.theme_name, c.theme_storedb, c.theme_id, i.imageset_path, i.imageset_id, i.imageset_name FROM " . STYLES_TABLE . " AS s, " . STYLES_TEMPLATE_TABLE . " AS t, " . STYLES_THEME_TABLE . " AS c, " . STYLES_IMAGESET_TABLE . " i WHERE s.style_active = 1 AND s.style_name = '$style_value' AND t.template_id = s.template_id AND c.theme_id = s.theme_id ! AND i.imageset_id = s.imageset_id"; if(($result = $db->sql_query($sql)) && ($row = $db->sql_fetchrow($result))) { $style = $row['style_id']; + $style_value = $row['style_name']; } else { mx_message_die(CRITICAL_ERROR, "Could not query database for imageset_id info style_name [$style]", "", __LINE__, __FILE__, $sql); ! } } ! else ! { ! //Query phpBB style_id corepondent to mxp themes_id ! $sql = "SELECT s.style_id, s.style_name, t.template_storedb, t.template_path, t.template_id, t.bbcode_bitfield, c.theme_path, c.theme_name, c.theme_storedb, c.theme_id, i.imageset_path, i.imageset_id, i.imageset_name ! FROM " . MX_THEMES_TABLE . " AS m, " . STYLES_TABLE . " AS s, " . STYLES_TEMPLATE_TABLE . " AS t, " . STYLES_THEME_TABLE . " AS c, " . STYLES_IMAGESET_TABLE . " i ! WHERE m.themes_id = " . (int) $style . " ! AND s.style_name = m.style_name AND t.template_id = s.template_id AND c.theme_id = s.theme_id ! AND i.imageset_id = s.imageset_id"; ! if(($result = $db->sql_query($sql)) && ($row = $db->sql_fetchrow($result))) { ! $style = $row['style_id']; ! $style_value = $row['style_name']; ! } ! else ! { ! mx_message_die(CRITICAL_ERROR, "Could not query database for imageset_id info style_name [$style]", "", __LINE__, __FILE__, $sql); } } ! $this->theme = $row; $db->sql_freeresult($result); // User has wrong style if (!$this->theme && $style == $this->data['user_style']) *************** *** 1488,1492 **** $db->sql_query($sql); ! $sql = 'SELECT s.style_id, t.template_storedb, t.template_path, t.template_id, t.bbcode_bitfield, c.theme_path, c.theme_name, c.theme_storedb, c.theme_id, i.imageset_path, i.imageset_id, i.imageset_name FROM ' . STYLES_TABLE . ' s, ' . STYLES_TEMPLATE_TABLE . ' t, ' . STYLES_THEME_TABLE . ' c, ' . STYLES_IMAGESET_TABLE . " i WHERE s.style_id = $style --- 1489,1493 ---- $db->sql_query($sql); ! $sql = 'SELECT s.style_id, s.style_name, t.template_storedb, t.template_path, t.template_id, t.bbcode_bitfield, c.theme_path, c.theme_name, c.theme_storedb, c.theme_id, i.imageset_path, i.imageset_id, i.imageset_name FROM ' . STYLES_TABLE . ' s, ' . STYLES_TEMPLATE_TABLE . ' t, ' . STYLES_THEME_TABLE . ' c, ' . STYLES_IMAGESET_TABLE . " i WHERE s.style_id = $style *************** *** 1497,1500 **** --- 1498,1503 ---- $this->theme = $db->sql_fetchrow($result); $db->sql_freeresult($result); + $style = $this->theme['style_id']; + $style_value = $this->theme['style_name']; } *************** *** 1537,1541 **** $matches = array(); preg_match_all('/@import url\(["\'](.*)["\']\);/i', $stylesheet, $matches); ! if (sizeof($matches)) { --- 1540,1544 ---- $matches = array(); preg_match_all('/@import url\(["\'](.*)["\']\);/i', $stylesheet, $matches); ! if (sizeof($matches)) { *************** *** 1574,1578 **** $template->set_template(); ! $this->img_lang = (file_exists($phpbb_root_path . 'styles/' . $this->theme['imageset_path'] . '/imageset/' . $this->lang_name)) ? $this->lang_name : $board_config['default_lang']; $sql = 'SELECT image_name, image_filename, image_lang, image_height, image_width --- 1577,1581 ---- $template->set_template(); ! $this->img_lang = (file_exists($phpbb_root_path . 'styles/' . $this->theme['imageset_path'] . '/imageset/' . $this->lang_name)) ? $this->lang_name : $this->encode_lang($board_config['default_lang']); $sql = 'SELECT image_name, image_filename, image_lang, image_height, image_width *************** *** 1594,1598 **** } $db->sql_freeresult($result); - // there were no localised images, try to refresh the localised imageset for the user's language if (!$localised_images) --- 1597,1600 ---- |