diff --git a/class2.php b/class2.php index dd291034c..856fac47d 100644 --- a/class2.php +++ b/class2.php @@ -11,8 +11,8 @@ | GNU General Public License (http://gnu.org). | | $Source: /cvs_backup/e107_0.8/class2.php,v $ -| $Revision: 1.47 $ -| $Date: 2008-01-27 01:57:23 $ +| $Revision: 1.48 $ +| $Date: 2008-01-27 11:02:33 $ | $Author: e107coders $ +----------------------------------------------------------------------------+ */ @@ -591,7 +591,6 @@ if (isset($pref['modules']) && $pref['modules']) { $js_body_onload = array(); // Initialise this array in case a module wants to add to it - // Load e_modules after all the constants, but before the themes, so they can be put to use. if(isset($pref['e_module_list']) && $pref['e_module_list']){ foreach ($pref['e_module_list'] as $mod){ @@ -804,9 +803,9 @@ if(!isset($_E107['no_menus'])) { while ($row = $sql->db_Fetch()) { - $eMenuList[$row['menu_location']][]=$row; + $eMenuList[$row['menu_location']][] =$row; $eMenuArea[$row['menu_location']][$row['menu_name']] =1; - $eMenuActive[]=$row['menu_name']; + $eMenuActive[$row['menu_name']] = $row['menu_name']; } } $menu_data['menu_area'] = $eMenuArea; @@ -818,8 +817,8 @@ if(!isset($_E107['no_menus'])) } else { - $eMenuArea = $menu_data['menu_area']; - $eMenuList = $menu_data['menu_list']; + $eMenuArea = $menu_data['menu_area']; + $eMenuList = $menu_data['menu_list']; $eMenuActive = $menu_data['menu_active']; unset($menu_data); } @@ -1670,4 +1669,32 @@ function e107_ini_set($var, $value){ } } +function echo_gzipped_page() { + + if( headers_sent() ){ + $encoding = false; + }elseif( strpos($_SERVER["HTTP_ACCEPT_ENCODING"], 'x-gzip') !== false ){ + $encoding = 'x-gzip'; + }elseif( strpos($_SERVER["HTTP_ACCEPT_ENCODING"],'gzip') !== false ){ + $encoding = 'gzip'; + }else{ + $encoding = false; + } + + if( $encoding ){ + $contents = ob_get_contents(); + ob_end_clean(); + header('Content-Encoding: '.$encoding); + print("\x1f\x8b\x08\x00\x00\x00\x00\x00"); + $size = strlen($contents); + $contents = gzcompress($contents, 9); + $contents = substr($contents, 0, $size); + print($contents); + exit(); + }else{ + ob_end_flush(); + exit(); + } +} + ?> \ No newline at end of file diff --git a/e107_files/e_ajax.php b/e107_files/e_ajax.php index 496cd4080..74b64498e 100644 --- a/e107_files/e_ajax.php +++ b/e107_files/e_ajax.php @@ -11,13 +11,15 @@ | GNU General Public License (http://gnu.org). | | $Source: /cvs_backup/e107_0.8/e107_files/e_ajax.php,v $ -| $Revision: 1.2 $ -| $Date: 2008-01-16 22:45:55 $ +| $Revision: 1.3 $ +| $Date: 2008-01-27 11:02:34 $ | $Author: e107coders $ +----------------------------------------------------------------------------+ */ $_E107['minimal'] = TRUE; require_once("../class2.php"); +ob_start(); +ob_implicit_flush(0); // ----------------------------------------------------------------------------- // Ajax Short-code-Replacer Routine. @@ -38,14 +40,15 @@ require_once("../class2.php"); } // ----------------------------------------------------------------------------- +header("last-modified: " . gmdate("D, d M Y H:i:s",mktime(0,0,0,15,2,2004)) . " GMT"); header('Content-type: text/javascript', TRUE); -echo " +$text = " function replaceSC(sc,obj,id,scfile) { if(!id){ var id = sc; } - var handler = '".SITEURL.$FILES_DIRECTORY."/e_ajax.php'; + var handler = '".e_FILE_ABS."e_ajax.php'; var parm = ($(obj).serialize() + '&ajax_sc=' + sc + '&ajax_scfile=' + scfile + '&ajax_used=1'); new Ajax.Updater(id, handler, { parameters: parm } ); } @@ -57,6 +60,9 @@ echo " } "; +header ('ETag: "' . md5($text).'"' ); +echo $text; + ?> /* Prototype JavaScript framework, version 1.6.0 @@ -4245,3 +4251,6 @@ Object.extend(Element.ClassNames.prototype, Enumerable); Element.addMethods(); + \ No newline at end of file diff --git a/e107_files/e_js.php b/e107_files/e_js.php index 938b72791..6cb5b3f73 100644 --- a/e107_files/e_js.php +++ b/e107_files/e_js.php @@ -4,8 +4,8 @@ | e107 website system - Javascript File. | | $Source: /cvs_backup/e107_0.8/e107_files/e_js.php,v $ -| $Revision: 1.3 $ -| $Date: 2008-01-16 22:45:56 $ +| $Revision: 1.4 $ +| $Date: 2008-01-27 11:02:34 $ | $Author: e107coders $ +----------------------------------------------------------------------------+ */ @@ -24,9 +24,14 @@ */ $_E107['minimal'] = TRUE; require_once("../class2.php"); +ob_start(); +ob_implicit_flush(0); +header("last-modified: " . gmdate("D, d M Y H:i:s",mktime(0,0,0,15,2,2004)) . " GMT"); header('Content-type: text/javascript', TRUE); +//header("Expires: 0"); +//header("Cache-Control: max-age=30" ); -echo ""; - +header ('ETag: "' . md5($text).'"' ); +echo $js; +echo_gzipped_page(); ?> \ No newline at end of file diff --git a/e107_handlers/plugin_class.php b/e107_handlers/plugin_class.php index 97c3a5137..5d51d1511 100644 --- a/e107_handlers/plugin_class.php +++ b/e107_handlers/plugin_class.php @@ -11,9 +11,9 @@ | GNU General Public License (http://gnu.org). | | $Source: /cvs_backup/e107_0.8/e107_handlers/plugin_class.php,v $ -| $Revision: 1.19 $ -| $Date: 2008-01-27 05:16:03 $ -| $Author: mcfly_e107 $ +| $Revision: 1.20 $ +| $Date: 2008-01-27 11:02:34 $ +| $Author: e107coders $ +----------------------------------------------------------------------------+ */ @@ -21,7 +21,7 @@ if (!defined('e107_INIT')) { exit; } class e107plugin { - var $plugin_addons = array("e_rss", "e_notify", "e_linkgen", "e_list", "e_bb", "e_meta", "e_emailprint", "e_frontpage", "e_latest", "e_status", "e_search", "e_sc", "e_module", "e_comment", "e_sql", "e_userprofile"); + var $plugin_addons = array("e_rss", "e_notify", "e_linkgen", "e_list", "e_bb", "e_meta", "e_emailprint", "e_frontpage", "e_latest", "e_status", "e_search", "e_sc", "e_module", "e_comment", "e_sql", "e_userprofile","e_header"); // List of all plugin variables which need to be checked - install required if one or more set and non-empty var $all_eplug_install_variables = array( diff --git a/e107_plugins/chatbox_menu/chatbox_menu.php b/e107_plugins/chatbox_menu/chatbox_menu.php index fc96ec812..e021f4827 100644 --- a/e107_plugins/chatbox_menu/chatbox_menu.php +++ b/e107_plugins/chatbox_menu/chatbox_menu.php @@ -11,8 +11,8 @@ | GNU General Public License (http://gnu.org). | | $Source: /cvs_backup/e107_0.8/e107_plugins/chatbox_menu/chatbox_menu.php,v $ -| $Revision: 1.10 $ -| $Date: 2008-01-16 11:00:21 $ +| $Revision: 1.11 $ +| $Date: 2008-01-27 11:02:34 $ | $Author: e107coders $ +----------------------------------------------------------------------------+ */ @@ -30,7 +30,7 @@ if(($pref['cb_layer']==2) || isset($_POST['chatbox_ajax'])) @include_lan(e_PLUGIN."chatbox_menu/languages/".e_LANGUAGE."/".e_LANGUAGE.".php"); @include_lan(e_PLUGIN."chatbox_menu/languages/English/English.php"); } - $footer_js[] = e_FILE_ABS.'e_ajax.php'; + // $footer_js[] = e_FILE_ABS.'e_ajax.php'; } diff --git a/e107_plugins/chatbox_menu/e_header.php b/e107_plugins/chatbox_menu/e_header.php new file mode 100644 index 000000000..f56fc1cae --- /dev/null +++ b/e107_plugins/chatbox_menu/e_header.php @@ -0,0 +1,11 @@ + \ No newline at end of file diff --git a/e107_themes/templates/header_default.php b/e107_themes/templates/header_default.php index d74f9c528..4e34680a1 100644 --- a/e107_themes/templates/header_default.php +++ b/e107_themes/templates/header_default.php @@ -6,8 +6,8 @@ | Released under the terms and conditions of the GNU General Public License (http://gnu.org). | | $Source: /cvs_backup/e107_0.8/e107_themes/templates/header_default.php,v $ -| $Revision: 1.18 $ -| $Date: 2008-01-16 10:47:06 $ +| $Revision: 1.19 $ +| $Date: 2008-01-27 11:02:34 $ | $Author: e107coders $ +-----------------------------------------------------------------------------------------------+ */ @@ -98,13 +98,24 @@ if (varset($pref['wysiwyg'],FALSE) && check_class($pref['post_html']) && varset( }else{ define("e_WYSIWYG",FALSE); } +// Load Plugin Header Files +if (is_array($pref['e_header_list'])) +{ + foreach($pref['e_header_list'] as $val) + { + if(is_readable(e_PLUGIN.$val."/e_header.php")) + { + require_once(e_PLUGIN.$val."/e_header.php"); + } + } +} if (isset($theme_js_php) && $theme_js_php) { echo ""; } else { - if (!isset($no_core_js) || !$no_core_js) { + if (!isset($no_core_js) || !$no_core_js) + { echo "\n"; - echo "\n"; } if (file_exists(THEME.'theme.js')) { echo "\n"; } if (is_readable(e_FILE.'user.js') && filesize(e_FILE.'user.js')) { echo "\n"; } @@ -117,9 +128,10 @@ if (isset($eplug_js) && $eplug_js) { echo "\n\n"; if(is_array($eplug_js)) { - foreach($eplug_js as $kjs) + $eplug_js_unique = array_unique($eplug_js); + foreach($eplug_js_unique as $kjs) { - echo "\n"; + echo ($kjs[0] == "<") ? $kjs : "\n"; } } else @@ -139,13 +151,15 @@ if (function_exists('headerjs')){echo headerjs(); } // E: Send CSS // -if (isset($eplug_css) && $eplug_css) { +if (isset($eplug_css) && $eplug_css) +{ if(is_array($eplug_css)) { - foreach($eplug_css as $kcss) - { // Allow inline style definition - but only if $eplug_css is an array (maybe require an array later) - if ('\n"; - } + $eplug_css_unique = array_unique($eplug_css); + foreach($eplug_css_unique as $kcss) + { + echo ($kcss[0] == "<") ? $kcss : "\n"; + } } else { @@ -300,7 +314,7 @@ if (isset($script_text) && $script_text) { // I: Calculate JS onload() functions for the BODY tag // // Fader menu -global $eMenuActive; +global $eMenuActive, $eMenuArea; if(in_array('fader_menu', $eMenuActive)) $js_body_onload[] = 'changecontent(); '; // External links handling