Are there any real benefits to this add-on? It seems difficult to install
Are there any real benefits to this add-on? It seems difficult to install
It speeds up your website by minifying .js and .css.
I use it and i'm quite happy with it.
It seems to be required for some add-ons, but when I enable the loader my site won't load properly.
When disabled everything load fine, including the mods that require the loader.
So what the benefit is ??? I do not know
Zen cart installation / maintenance / customisation / hosting
Supported Modules: Dutch language pack, Multi site, Dynamic Price Updater and more.
Sounds Great. I just can't grasp how to install it.. are there any instructions that are easily absorbed? I think one of the issues I'm having is merging it with my html_header file it's merged with several other add-ons as well...
thanks!
Reading the install instructions should be enough. You should try seeing if the css and js are being loaded (in the source code) when it's enabled. Could be any number of things went wrong.
Paste your html_header's content here and I will try to come up with a merge solution. The instructions from rubikintegration's website are reasonable.
Thanks!!!<?php
/**
* Common Template
*
* outputs the html header. i,e, everything that comes before the \</head\> tag <br />
*
* @package templateSystem
* @copyright Copyright 2003-2010 Zen Cart Development Team
* @copyright Portions Copyright 2003 osCommerce
* @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
* @version $Id: html_header.php 15761 2010-03-31 19:31:27Z drbyte $
*/
/**
* load the module for generating page meta-tags
*/
require(DIR_WS_MODULES . zen_get_module_directory('meta_tags.php'));
/**
* output main page HEAD tag and related headers/meta-tags, etc
*/
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" <?php echo HTML_PARAMS; ?>>
<head>
<title><?php echo META_TAG_TITLE; ?></title>
<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>" />
<meta name="keywords" content="<?php echo META_TAG_KEYWORDS; ?>" />
<meta name="description" content="<?php echo META_TAG_DESCRIPTION; ?>" />
<meta http-equiv="imagetoolbar" content="no" />
<meta name="author" content="The Zen Cart™ Team and others" />
<meta name="generator" content="shopping cart program by Zen Cart™, http://www.zen-cart.com eCommerce" />
<?php if (defined('ROBOTS_PAGES_TO_SKIP') && in_array($current_page_base,explode(",",constant('ROBOTS_PAGES_TO_SKIP'))) || $current_page_base=='down_for_maintenance' || $robotsNoIndex === true) { ?>
<meta name="robots" content="noindex, nofollow" />
<?php } ?>
<?php if (defined('FAVICON')) { ?>
<link rel="icon" href="<?php echo FAVICON; ?>" type="image/x-icon" />
<link rel="shortcut icon" href="<?php echo FAVICON; ?>" type="image/x-icon" />
<?php } //endif FAVICON ?>
<base href="<?php echo (($request_type == 'SSL') ? HTTPS_SERVER . DIR_WS_HTTPS_CATALOG : HTTP_SERVER . DIR_WS_CATALOG ); ?>" />
<?php if (isset($canonicalLink) && $canonicalLink != '') { ?>
<link rel="canonical" href="<?php echo $canonicalLink; ?>" />
<?php } ?>
<?php
$jscript_files_to_load = $css_files_to_load = array();
/**
* load all template-specific stylesheets, named like "style*.css", alphabetically
*/
$directory_array = $template->get_template_part($template->get_template_dir('.css',DIR_WS_TEMPLATE, $current_page_base,'css'), '/^style/', '.css');
$load_order = -300;
while(list ($key, $value) = each($directory_array)) {
echo '<link rel="stylesheet" type="text/css" href="' . $template->get_template_dir('.css',DIR_WS_TEMPLATE, $current_page_base,'css') . '/' . $value . '" />'."\n";
}
/**
* load all template-specific stylesheets, named like "ie_*.css", alphabetically
* for stylesheets targeted at all versions of IE
*/
$directory_array = $template->get_template_part($template->get_template_dir('.css',DIR_WS_TEMPLATE, $current_page_base,'css'), '/^ie_/', '.css');
while(list ($key, $value) = each($directory_array)) {
echo '<!--[if IE]>' . "\n";
echo '<link rel="stylesheet" type="text/css" href="' . $template->get_template_dir('.css',DIR_WS_TEMPLATE, $current_page_base,'css') . '/' . $value . '" />' . "\n";
echo '<![endif]-->' . "\n";
}
/**
* load all template-specific stylesheets, named like "ie7*.css", alphabetically
* for stylesheets targeted at specific versions of IE
*/
$directory_array = $template->get_template_part($template->get_template_dir('.css',DIR_WS_TEMPLATE, $current_page_base,'css'), '/^ie[5-9]_/', '.css');
while(list ($key, $value) = each($directory_array)) {
$ver = substr ($value, 2, 1);
echo '<!--[if IE' . $ver . ']>' . "\n";
echo '<link rel="stylesheet" type="text/css" href="' . $template->get_template_dir('.css',DIR_WS_TEMPLATE, $current_page_base,'css') . '/' . $value . '" />' . "\n";
echo '<![endif]-->' . "\n";
}
$css_files_to_load[$value] = $load_order++;
/**
* load stylesheets on a per-page/per-language/per-product/per-manufacturer/per-category basis. Concept by Juxi Zoza.
*/
$manufacturers_id = (isset($_GET['manufacturers_id'])) ? $_GET['manufacturers_id'] : '';
$tmp_products_id = (isset($_GET['products_id'])) ? (int)$_GET['products_id'] : '';
$tmp_pagename = ($this_is_home_page) ? 'index_home' : $current_page_base;
if ($current_page_base == 'page' && isset($ezpage_id)) $tmp_pagename = $current_page_base . (int)$ezpage_id;
$sheets_array = array('/' . $_SESSION['language'] . '_stylesheet',
'/' . $tmp_pagename,
'/' . $_SESSION['language'] . '_' . $tmp_pagename,
'/c_' . $cPath,
'/' . $_SESSION['language'] . '_c_' . $cPath,
'/m_' . $manufacturers_id,
'/' . $_SESSION['language'] . '_m_' . (int)$manufacturers_id,
'/p_' . $tmp_products_id,
'/' . $_SESSION['language'] . '_p_' . $tmp_products_id
);
$load_order = -200;
while(list ($key, $value) = each($sheets_array)) {
//echo "<!--looking for: $value-->\n";
$perpagefile = $template->get_template_dir('.css', DIR_WS_TEMPLATE, $current_page_base, 'css') . $value . '.css';
if (file_exists($perpagefile)) $css_files_to_load[trim($value, '/').'.css'] = $load_order++;
}
/**
* load printer-friendly stylesheets -- named like "print*.css", alphabetically
*/
$directory_array = $template->get_template_part($template->get_template_dir('.css',DIR_WS_TEMPLATE, $current_page_base,'css'), '/^print/', '.css');
sort($directory_array);
while(list ($key, $value) = each($directory_array)) {
echo '<link rel="stylesheet" type="text/css" media="print" href="' . $template->get_template_dir('.css',DIR_WS_TEMPLATE, $current_page_base,'css') . '/' . $value . '" />'."\n";
}
if (file_exists(DIR_WS_CLASSES . 'browser.php')) {
include(DIR_WS_CLASSES . 'browser.php');
$browser = new _Browser();
$browser_name = preg_replace("/[^a-zA-Z0-9s]/", "-", strtolower($browser->getBrowser()));
$browser_version = floor($browser->getVersion());
// this is to make it compatible with the other ie css hack
if ($browser->getBrowser() == $browser->BROWSER_IE) {
$browser_name = 'ie';
}
// get the browser specific files
$directory_array = $template->get_template_part($template->get_template_dir('.css',DIR_WS_TEMPLATE, $current_page_base,'css'), "/^{$browser_name}-/", '.css');
$js_directory_array = $template->get_template_part($template->get_template_dir('.js',DIR_WS_TEMPLATE, $current_page_base,'js'), "/^{$browser_name}-/", '.js');
$load_order = -100;
while(list ($key, $value) = each($directory_array )) {
$css_files_to_load[$value] = $load_order++;
}
$load_order = -500;
while(list ($key, $value) = each($js_directory_array )) {
$jscript_files_to_load[$value] = $load_order++;
}
// get the version specific files
$directory_array = $template->get_template_part($template->get_template_dir('.css',DIR_WS_TEMPLATE, $current_page_base,'css'), "/^{$browser_name}{$browser_version}-/", '.css');
$js_directory_array = $template->get_template_part($template->get_template_dir('.js',DIR_WS_TEMPLATE, $current_page_base,'js'), "/^{$browser_name}{$browser_version}-/", '.js');
$load_order = -100;
while(list ($key, $value) = each($directory_array )) {
$css_files_to_load[$value] = $load_order++;
}
$load_order = -500;
while(list ($key, $value) = each($js_directory_array )) {
$jscript_files_to_load[$value] = $load_order++;
}
}
/**
* load all site-wide jscript_*.js files from includes/templates/YOURTEMPLATE/jscript, alphabetically
*/
$directory_array = $template->get_template_part($template->get_template_dir('.js',DIR_WS_TEMPLATE, $current_page_base,'jscript'), '/^jscript_/', '.js');
$load_order = -400;
while(list ($key, $value) = each($directory_array)) {
$jscript_files_to_load[$value] = $load_order++;
}
/**
* load all page-specific jscript_*.js files from includes/modules/pages/PAGENAME, alphabetically
*/
$directory_array = $template->get_template_part($page_directory, '/^jscript_/', '.js');
$load_order = -300;
while(list ($key, $value) = each($directory_array)) {
$jscript_files_to_load["$page_directory/$value"] = $load_order++;
}
/**
* load all site-wide jscript_*.php files from includes/templates/YOURTEMPLATE/jscript, alphabetically
*/
$directory_array = $template->get_template_part($template->get_template_dir('.php',DIR_WS_TEMPLATE, $current_page_base,'jscript'), '/^jscript_/', '.php');
$load_order = -200;
while(list ($key, $value) = each($directory_array)) {
/**
* include content from all site-wide jscript_*.php files from includes/templates/YOURTEMPLATE/jscript, alphabetically.
* These .PHP files can be manipulated by PHP when they're called, and are copied in-full to the browser page
*/
$jscript_files_to_load[$value] = $load_order++;
}
/**
* include content from all page-specific jscript_*.php files from includes/modules/pages/PAGENAME, alphabetically.
*/
$directory_array = $template->get_template_part($page_directory, '/^jscript_/');
$load_order = -100;
while(list ($key, $value) = each($directory_array)) {
/**
* include content from all page-specific jscript_*.php files from includes/modules/pages/PAGENAME, alphabetically.
* These .PHP files can be manipulated by PHP when they're called, and are copied in-full to the browser page
*/
$jscript_files_to_load["$page_directory/$value"] = $load_order++;
}
$files = loadCssJsFiles($css_files_to_load, $jscript_files_to_load);
foreach($files['css'] as $file)
if($file['include']) include($file['string']);
else echo $file['string'];
foreach($files['js'] as $file)
if($file['include']) include($file['string']);
else echo $file['string'];
//DEBUG: echo '<!-- I SEE cat: ' . $current_category_id . ' || vs cpath: ' . $cPath . ' || page: ' . $current_page . ' || template: ' . $current_template . ' || main = ' . ($this_is_home_page ? 'YES' : 'NO') . ' -->';
?>
</head>
<!-- b of carousel add-on -->
<script src="js/jquery-1.4.4.min.js" type="text/javascript" charset="utf-8"></script>
<script src="js/jquery.tools.min.js" type="text/javascript" charset="utf-8"></script>
<!-- e of carousel add-on -->
<?php // NOTE: Blank line following is intended: ?>
<?php
/**
* IE Conditional Comments
* Load all template-specific stylesheets for IE in alphabetical order, but AFTER
* the main stylesheets have been called, thus overriding them in the cascade.
* Naming convention for stylesheet files is as follows:
* "ie_stylesheet.css" targets all versions of IE
* "ie7_stylesheet.css" only targets IE 7
* "ie6_stylesheet.css" will only affect IE 6
* "ie5.5_stylesheet.css" will only affect IE 5.5
*/
$directory_array = $template->get_template_part($template->get_template_dir('.css',DIR_WS_TEMPLATE, $current_page_base,'css'), '/^ie[5-9]_/', '.css');
while(list ($key, $value) = each($directory_array)) {
$ver = substr ($value, 2, 1);
echo '<!--[if IE ' . $ver . ']>' . "\n";
echo '<link rel="stylesheet" type="text/css" href="' . $template->get_template_dir('.css',DIR_WS_TEMPLATE, $current_page_base,'css') . '/' . $value . '" />' . "\n";
echo '<![endif]-->' . "\n";
}
?>
Believe me I tried everything The minify css is loaded, but apparently corrupt in some way. I gave up since all the mods worked fine, and even the read-me on rubkis said to disable minify is errors keep occuring
http://wiki.rubikintegration.com/zen...t_loader/about
PHP Minify requires PHP5.2+ to work correctly, if you are using and older version you should disable CJ Loader. Since many modules come with CJ Loader by default, in case your server uses an older version of PHP you will see the css files on your site not loaded correctky (and leave you with a broken layout). Please go to Admin→Configuration→CJ Loader to disable it.
Zen cart installation / maintenance / customisation / hosting
Supported Modules: Dutch language pack, Multi site, Dynamic Price Updater and more.
Try replacing:
With:PHP Code:
<?php
$jscript_files_to_load = $css_files_to_load = array();
/**
* load all template-specific stylesheets, named like "style*.css", alphabetically
*/
$directory_array = $template->get_template_part($template->get_template_dir('.css',DIR_WS_TEMPLATE, $current_page_base,'css'), '/^style/', '.css');
$load_order = -300;
while(list ($key, $value) = each($directory_array)) {
echo '<link rel="stylesheet" type="text/css" href="' . $template->get_template_dir('.css',DIR_WS_TEMPLATE, $current_page_base,'css') . '/' . $value . '" />'."\n";
}
/**
* load all template-specific stylesheets, named like "ie_*.css", alphabetically
* for stylesheets targeted at all versions of IE
*/
$directory_array = $template->get_template_part($template->get_template_dir('.css',DIR_WS_TEMPLATE, $current_page_base,'css'), '/^ie_/', '.css');
while(list ($key, $value) = each($directory_array)) {
echo '<!--[if IE]>' . "\n";
echo '<link rel="stylesheet" type="text/css" href="' . $template->get_template_dir('.css',DIR_WS_TEMPLATE, $current_page_base,'css') . '/' . $value . '" />' . "\n";
echo '<![endif]-->' . "\n";
}
/**
* load all template-specific stylesheets, named like "ie7*.css", alphabetically
* for stylesheets targeted at specific versions of IE
*/
$directory_array = $template->get_template_part($template->get_template_dir('.css',DIR_WS_TEMPLATE, $current_page_base,'css'), '/^ie[5-9]_/', '.css');
while(list ($key, $value) = each($directory_array)) {
$ver = substr ($value, 2, 1);
echo '<!--[if IE' . $ver . ']>' . "\n";
echo '<link rel="stylesheet" type="text/css" href="' . $template->get_template_dir('.css',DIR_WS_TEMPLATE, $current_page_base,'css') . '/' . $value . '" />' . "\n";
echo '<![endif]-->' . "\n";
}
$css_files_to_load[$value] = $load_order++;
/**
* load stylesheets on a per-page/per-language/per-product/per-manufacturer/per-category basis. Concept by Juxi Zoza.
*/
$manufacturers_id = (isset($_GET['manufacturers_id'])) ? $_GET['manufacturers_id'] : '';
$tmp_products_id = (isset($_GET['products_id'])) ? (int)$_GET['products_id'] : '';
$tmp_pagename = ($this_is_home_page) ? 'index_home' : $current_page_base;
if ($current_page_base == 'page' && isset($ezpage_id)) $tmp_pagename = $current_page_base . (int)$ezpage_id;
$sheets_array = array('/' . $_SESSION['language'] . '_stylesheet',
'/' . $tmp_pagename,
'/' . $_SESSION['language'] . '_' . $tmp_pagename,
'/c_' . $cPath,
'/' . $_SESSION['language'] . '_c_' . $cPath,
'/m_' . $manufacturers_id,
'/' . $_SESSION['language'] . '_m_' . (int)$manufacturers_id,
'/p_' . $tmp_products_id,
'/' . $_SESSION['language'] . '_p_' . $tmp_products_id
);
$load_order = -200;
while(list ($key, $value) = each($sheets_array)) {
//echo "<!--looking for: $value-->\n";
$perpagefile = $template->get_template_dir('.css', DIR_WS_TEMPLATE, $current_page_base, 'css') . $value . '.css';
if (file_exists($perpagefile)) $css_files_to_load[trim($value, '/').'.css'] = $load_order++;
}
/**
* load printer-friendly stylesheets -- named like "print*.css", alphabetically
*/
$directory_array = $template->get_template_part($template->get_template_dir('.css',DIR_WS_TEMPLATE, $current_page_base,'css'), '/^print/', '.css');
sort($directory_array);
while(list ($key, $value) = each($directory_array)) {
echo '<link rel="stylesheet" type="text/css" media="print" href="' . $template->get_template_dir('.css',DIR_WS_TEMPLATE, $current_page_base,'css') . '/' . $value . '" />'."\n";
}
if (file_exists(DIR_WS_CLASSES . 'browser.php')) {
include(DIR_WS_CLASSES . 'browser.php');
$browser = new _Browser();
$browser_name = preg_replace("/[^a-zA-Z0-9s]/", "-", strtolower($browser->getBrowser()));
$browser_version = floor($browser->getVersion());
// this is to make it compatible with the other ie css hack
if ($browser->getBrowser() == $browser->BROWSER_IE) {
$browser_name = 'ie';
}
// get the browser specific files
$directory_array = $template->get_template_part($template->get_template_dir('.css',DIR_WS_TEMPLATE, $current_page_base,'css'), "/^{$browser_name}-/", '.css');
$js_directory_array = $template->get_template_part($template->get_template_dir('.js',DIR_WS_TEMPLATE, $current_page_base,'js'), "/^{$browser_name}-/", '.js');
$load_order = -100;
while(list ($key, $value) = each($directory_array )) {
$css_files_to_load[$value] = $load_order++;
}
$load_order = -500;
while(list ($key, $value) = each($js_directory_array )) {
$jscript_files_to_load[$value] = $load_order++;
}
// get the version specific files
$directory_array = $template->get_template_part($template->get_template_dir('.css',DIR_WS_TEMPLATE, $current_page_base,'css'), "/^{$browser_name}{$browser_version}-/", '.css');
$js_directory_array = $template->get_template_part($template->get_template_dir('.js',DIR_WS_TEMPLATE, $current_page_base,'js'), "/^{$browser_name}{$browser_version}-/", '.js');
$load_order = -100;
while(list ($key, $value) = each($directory_array )) {
$css_files_to_load[$value] = $load_order++;
}
$load_order = -500;
while(list ($key, $value) = each($js_directory_array )) {
$jscript_files_to_load[$value] = $load_order++;
}
}
/**
* load all site-wide jscript_*.js files from includes/templates/YOURTEMPLATE/jscript, alphabetically
*/
$directory_array = $template->get_template_part($template->get_template_dir('.js',DIR_WS_TEMPLATE, $current_page_base,'jscript'), '/^jscript_/', '.js');
$load_order = -400;
while(list ($key, $value) = each($directory_array)) {
$jscript_files_to_load[$value] = $load_order++;
}
/**
* load all page-specific jscript_*.js files from includes/modules/pages/PAGENAME, alphabetically
*/
$directory_array = $template->get_template_part($page_directory, '/^jscript_/', '.js');
$load_order = -300;
while(list ($key, $value) = each($directory_array)) {
$jscript_files_to_load["$page_directory/$value"] = $load_order++;
}
/**
* load all site-wide jscript_*.php files from includes/templates/YOURTEMPLATE/jscript, alphabetically
*/
$directory_array = $template->get_template_part($template->get_template_dir('.php',DIR_WS_TEMPLATE, $current_page_base,'jscript'), '/^jscript_/', '.php');
$load_order = -200;
while(list ($key, $value) = each($directory_array)) {
/**
* include content from all site-wide jscript_*.php files from includes/templates/YOURTEMPLATE/jscript, alphabetically.
* These .PHP files can be manipulated by PHP when they're called, and are copied in-full to the browser page
*/
$jscript_files_to_load[$value] = $load_order++;
}
/**
* include content from all page-specific jscript_*.php files from includes/modules/pages/PAGENAME, alphabetically.
*/
$directory_array = $template->get_template_part($page_directory, '/^jscript_/');
$load_order = -100;
while(list ($key, $value) = each($directory_array)) {
/**
* include content from all page-specific jscript_*.php files from includes/modules/pages/PAGENAME, alphabetically.
* These .PHP files can be manipulated by PHP when they're called, and are copied in-full to the browser page
*/
$jscript_files_to_load["$page_directory/$value"] = $load_order++;
}
$files = loadCssJsFiles($css_files_to_load, $jscript_files_to_load);
foreach($files['css'] as $file)
if($file['include']) include($file['string']);
else echo $file['string'];
foreach($files['js'] as $file)
if($file['include']) include($file['string']);
else echo $file['string'];
//DEBUG: echo '<!-- I SEE cat: ' . $current_category_id . ' || vs cpath: ' . $cPath . ' || page: ' . $current_page . ' || template: ' . $current_template . ' || main = ' . ($this_is_home_page ? 'YES' : 'NO') . ' -->';
?>
I can see you're loading some .js files here:PHP Code:
<?php
/**
* load the loader files
*/
if($RI_CJLoader->get('status')){
$directory_array = $template->get_template_part(DIR_WS_TEMPLATE.'auto_loaders', '/^loader_/', '.php');
$loaders_check = $RI_CJLoader->get('loaders');
if($loaders_check == '*' || count($loaders_check) > 0){
while(list ($key, $value) = each($directory_array)) {
/**
* include content from all site-wide loader_*.php files from includes/templates/YOURTEMPLATE/jscript/auto_loaders, alphabetically.
*/
if($loaders_check == '*' || in_array($value, $loaders_check))
require(DIR_WS_TEMPLATE.'auto_loaders'. '/' . $value);
}
}
$RI_CJLoader->loadCssJsFiles();
$files = $RI_CJLoader->processCssJsFiles();
foreach($files['css'] as $file)
if($file['include']) include($file['string']);
else echo $file['string'];
foreach($files['js'] as $file)
if($file['include']) include($file['string']);
else echo $file['string'];
}
//DEBUG: echo '<!-- I SEE cat: ' . $current_category_id . ' || vs cpath: ' . $cPath . ' || page: ' . $current_page . ' || template: ' . $current_template . ' || main = ' . ($this_is_home_page ? 'YES' : 'NO') . ' -->';
?>
These can be loaded with this add-on as well by editing loader_sample.php.sample in the autoloaders folder, better explained here:PHP Code:
<script src="js/jquery-1.4.4.min.js" type="text/javascript" charset="utf-8"></script>
<script src="js/jquery.tools.min.js" type="text/javascript" charset="utf-8"></script>
http://wiki.rubikintegration.com/zen...t_loader/usage
Zen cart installation / maintenance / customisation / hosting
Supported Modules: Dutch language pack, Multi site, Dynamic Price Updater and more.
Bookmarks