Forums / All Other Contributions/Addons / css javascript loader addon problems

css javascript loader addon problems

Started by tony_sar on 24 May 2010, 11:22 PM · Views: 61,262

Results 21 to 40 of 111
18 Jun 2010, 2:19 PM
#21
bigstar avatar

bigstar

New Zenner

Join Date:
Jun 2006
Posts:
6
Plugin Contributions:
0

css javascript loader addon problems

Could someone please confirm whether or not this addon will work with shared SSL.

If it does work with shared SSL, how do you fix the problem with relative links to images in stylesheets?

24 Jun 2010, 7:16 PM
#22
autoace avatar

autoace

Totally Zenned

Join Date:
Jun 2009
Posts:
618
Plugin Contributions:
0

Re: css javascript loader addon problems

Got this error when I was trying to install CJ Loader:

PHP Warning: in_array() [<a href='function.in-array'>function.in-array</a>]: Wrong datatype for second argument in /xxxxx/xxxxxx/xxxxxx/includes/classes/class.cj_loader.php on line 170
PHP Warning: in_array() [<a href='function.in-array'>function.in-array</a>]: Wrong datatype for second argument in /xxxxx/xxxxxx/xxxxxx/includes/classes/class.cj_loader.php on line 170
PHP Fatal error: Call to undefined function is_logged_in() in /xxxxx/xxxxxx/xxxxxx/includes/classes/class.cj_loader.php on line 184

and these are lines 165-190 for that file:

function processCssJsFiles($css_files, $js_files){
        global $loaders, $current_page_base, $minify_cache_time_latest, $Ajax;
        if(isset($loaders) && count($loaders) > 0){
            $_jscripts = $_css_files = array();
            foreach($loaders as $j){
                if(in_array('*', $j['conditions']['pages']) || in_array($current_page_base, $j['conditions']['pages'])){
                    if(isset($j['jscript_files']))
                        $_jscript_files[] = $j['jscript_files'];
                    if(isset($j['css_files']))
                        $_css_files[] = $j['css_files'];
                }
                else{
                    $load = false;   
                    if(isset($j['conditions']['call_backs']))
                    foreach($j['conditions']['call_backs'] as $function){
                        $f = explode(',',$function);
                        if(count($f) == 2){
                            $load = call_user_func(array($f[0], $f[1]));
                        }
                        else $load = $function();
                       
                        if($load){
                            if(isset($j['jscript_files']))
                                $_jscript_files[] = $j['jscript_files'];
                            if(isset($j['css_files']))
                                $_css_files[] = $j['css_files'];

Don't really know what to look for in this case, please help.

Thank you,
autoace

25 Jun 2010, 8:16 PM
#23
tony_sar avatar

tony_sar

Totally Zenned

Join Date:
Jul 2006
Location:
Montreal, Canada
Posts:
2,276
Plugin Contributions:
0

Re: css javascript loader addon problems

autoace:

Got this error when I was trying to install CJ Loader:

PHP Warning: in_array() [<a href='function.in-array'>function.in-array</a>]: Wrong datatype for second argument in /xxxxx/xxxxxx/xxxxxx/includes/classes/class.cj_loader.php on line 170
PHP Warning: in_array() [<a href='function.in-array'>function.in-array</a>]: Wrong datatype for second argument in /xxxxx/xxxxxx/xxxxxx/includes/classes/class.cj_loader.php on line 170
PHP Fatal error: Call to undefined function is_logged_in() in /xxxxx/xxxxxx/xxxxxx/includes/classes/class.cj_loader.php on line 184

and these are lines 165-190 for that file:

function processCssJsFiles($css_files, $js_files){
global $loaders, $current_page_base, $minify_cache_time_latest, $Ajax;
if(isset($loaders) && count($loaders) > 0){
$_jscripts = $_css_files = array();
foreach($loaders as $j){
if(in_array('*', $j['conditions']['pages']) || in_array($current_page_base, $j['conditions']['pages'])){
if(isset($j['jscript_files']))
$_jscript_files[] = $j['jscript_files'];
if(isset($j['css_files']))
$_css_files[] = $j['css_files'];
}
else{
$load = false;
if(isset($j['conditions']['call_backs']))
foreach($j['conditions']['call_backs'] as $function){
$f = explode(',',$function);
if(count($f) == 2){
$load = call_user_func(array($f[0], $f[1]));
}
else $load = $function();

                    if($load){
                        if(isset($j['jscript_files']))
                            $_jscript_files[] = $j['jscript_files'];
                        if(isset($j['css_files']))
                            $_css_files[] = $j['css_files'];
> 
> Don't really know what to look for in this case, please help.

is this error during install of CJ loader or during setup of autoloader file ? 
as far as i  remember , this error relates to wrong settings in autoloader file .
4 Jul 2010, 10:34 PM
#24
countrycharm avatar

countrycharm

Totally Zenned

Join Date:
Jul 2007
Posts:
2,179
Plugin Contributions:
2

Re: css javascript loader addon problems

BlessIsaacola:

I have pasted the latter portion of my code for you below which is where you're messing things. Please note that this is NOT the complete file. I just started from the meta generator. Also ```php

<?php echo rss_feed_link_alternate(); // RSS Feed ?>
> 
> ```php
<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
/**
* 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') . ' -->';


?>
<?php echo rss_feed_link_alternate(); // RSS Feed ?>
</head>
<?php // NOTE: Blank line following is intended: ?>

I need some help please. I use the css JavaScript loader too with jqlightbox. If I use the code you furnish I get a blank index page. If I leave the code like I have it, I get and error in my cache folder. Here is the code I'm using.

<?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="TheGoodShepherdStore.com; 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
/**
* 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') . ' -->';


?>
<script language="JavaScript" type="text/javascript">
<!-- hide from old browsers
//<![CDATA[
var Ovr2='';
if(typeof document.compatMode!='undefined'&&document.compatMode!='BackCompat')
{cot_t1_DOCtp="_top:expression(document.documentElement.scrollTop+document.documentElement.clientHeight-this.clientHeight);_left:expression(document.documentElement.scrollLeft + document.documentElement.clientWidth - offsetWidth);}";}
else
{cot_t1_DOCtp="_top:expression(document.body.scrollTop+document.body.clientHeight-this.clientHeight);_left:expression(document.body.scrollLeft + document.body.clientWidth - offsetWidth);}";}

if(typeof document.compatMode!='undefined'&&document.compatMode!='BackCompat')
{cot_t1_DOCtp2="_top:expression(document.documentElement.scrollTop-20+document.documentElement.clientHeight-this.clientHeight);}";}
else
{cot_t1_DOCtp2="_top:expression(document.body.scrollTop-20+document.body.clientHeight-this.clientHeight);}";}
var cot_tl_bodyCSS='* html {background: fixed;background-repeat: repeat;background-position: right bottom;}';
var cot_tl_fixedCSS='#cot_tl_fixed{position:fixed;';
var cot_tl_fixedCSS=cot_tl_fixedCSS+'_position:absolute;';
var cot_tl_fixedCSS=cot_tl_fixedCSS+'bottom:0px;';
var cot_tl_fixedCSS=cot_tl_fixedCSS+'right:0px;';
var cot_tl_fixedCSS=cot_tl_fixedCSS+'clip:rect(0 100 85 0);';
var cot_tl_fixedCSS=cot_tl_fixedCSS+cot_t1_DOCtp;
var cot_tl_popCSS='#cot_tl_pop {background-color: transparent;';
var cot_tl_popCSS=cot_tl_popCSS+'position:fixed;';
var cot_tl_popCSS=cot_tl_popCSS+'_position:absolute;';
var cot_tl_popCSS=cot_tl_popCSS+'height:194px;';
var cot_tl_popCSS=cot_tl_popCSS+'width: 244px;';
var cot_tl_popCSS=cot_tl_popCSS+'right: 120px;';
var cot_tl_popCSS=cot_tl_popCSS+'bottom: 20px;';
var cot_tl_popCSS=cot_tl_popCSS+'overflow: hidden;';
var cot_tl_popCSS=cot_tl_popCSS+'visibility: hidden;';
var cot_tl_popCSS=cot_tl_popCSS+'z-index: 100;';
var cot_tl_popCSS=cot_tl_popCSS+cot_t1_DOCtp2;
document.write('<style type="text/css">'+cot_tl_bodyCSS+cot_tl_fixedCSS+cot_tl_popCSS+'</style>');
function COT(cot_tl_theLogo,cot_tl_LogoType,LogoPosition,theAffiliate)
{document.write('<div id="cot_tl_fixed">');
// Change the following link to point to your SSL Privacy page
document.write('<a href="https://seal.godaddy.com/verifySeal?sealID=RvtSmNYSCkdno2et4CeGMX26A9goyR8mSuO2fpK5DEmOZWoYbPCRj" target="_blank"><img src='+cot_tl_theLogo+' alt="Secure Shopping" border="0"></a>');
document.write('</div>');}

//if(window.location.protocol == "http:")
COT("images/seal.png", "SC2", "none");
//-->
</script>
<?php echo rss_feed_link_alternate(); // RSS Feed ?>
</head>
<?php // NOTE: Blank line following is intended: ?>
```Here's the error I'm receiving. 
[04-Jul-2010 15:28:34] PHP Warning:  Invalid argument supplied for foreach() in /home/content/x/x/x/xxxxxxxx/html/includes/functions/extra_functions/jscript.php on line 71
Here's the file for that. Thanks in advance for your help.


> 67           function getMinifyfiles($files, $request_string, $folder){
> 68           global $request_type, $current_page_base, $template;
> 69           $relative_path = $request_type == 'NONSSL' ?         
>                DIR_WS_CATALOG : DIR_WS_HTTPS_CATALOG;
> 70           $files_paths = '';$result = array();
> 71            foreach($files as $file=>$order){

Is your site Upgraded to the current version 1.5.4 Yet?
zencart-upgrades-website-installation

7 Jul 2010, 3:22 AM
#25
countrycharm avatar

countrycharm

Totally Zenned

Join Date:
Jul 2007
Posts:
2,179
Plugin Contributions:
2

Re: css javascript loader addon problems

countrycharm:

I need some help please. I use the css JavaScript loader too with jqlightbox. If I use the code you furnish I get a blank index page. If I leave the code like I have it, I get and error in my cache folder. Here is the code I'm using.

<?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="TheGoodShepherdStore.com; 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 /** * 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') . ' -->'; ?> <script language="JavaScript" type="text/javascript"> <!-- hide from old browsers //<![CDATA[ var Ovr2=''; if(typeof document.compatMode!='undefined'&&document.compatMode!='BackCompat') {cot_t1_DOCtp="_top:expression(document.documentElement.scrollTop+document.documentElement.clientHeight-this.clientHeight);_left:expression(document.documentElement.scrollLeft + document.documentElement.clientWidth - offsetWidth);}";} else {cot_t1_DOCtp="_top:expression(document.body.scrollTop+document.body.clientHeight-this.clientHeight);_left:expression(document.body.scrollLeft + document.body.clientWidth - offsetWidth);}";} if(typeof document.compatMode!='undefined'&&document.compatMode!='BackCompat') {cot_t1_DOCtp2="_top:expression(document.documentElement.scrollTop-20+document.documentElement.clientHeight-this.clientHeight);}";} else {cot_t1_DOCtp2="_top:expression(document.body.scrollTop-20+document.body.clientHeight-this.clientHeight);}";} var cot_tl_bodyCSS='* html {background: fixed;background-repeat: repeat;background-position: right bottom;}'; var cot_tl_fixedCSS='#cot_tl_fixed{position:fixed;'; var cot_tl_fixedCSS=cot_tl_fixedCSS+'_position:absolute;'; var cot_tl_fixedCSS=cot_tl_fixedCSS+'bottom:0px;'; var cot_tl_fixedCSS=cot_tl_fixedCSS+'right:0px;'; var cot_tl_fixedCSS=cot_tl_fixedCSS+'clip:rect(0 100 85 0);'; var cot_tl_fixedCSS=cot_tl_fixedCSS+cot_t1_DOCtp; var cot_tl_popCSS='#cot_tl_pop {background-color: transparent;'; var cot_tl_popCSS=cot_tl_popCSS+'position:fixed;'; var cot_tl_popCSS=cot_tl_popCSS+'_position:absolute;'; var cot_tl_popCSS=cot_tl_popCSS+'height:194px;'; var cot_tl_popCSS=cot_tl_popCSS+'width: 244px;'; var cot_tl_popCSS=cot_tl_popCSS+'right: 120px;'; var cot_tl_popCSS=cot_tl_popCSS+'bottom: 20px;'; var cot_tl_popCSS=cot_tl_popCSS+'overflow: hidden;'; var cot_tl_popCSS=cot_tl_popCSS+'visibility: hidden;'; var cot_tl_popCSS=cot_tl_popCSS+'z-index: 100;'; var cot_tl_popCSS=cot_tl_popCSS+cot_t1_DOCtp2; document.write('<style type="text/css">'+cot_tl_bodyCSS+cot_tl_fixedCSS+cot_tl_popCSS+'</style>');

function COT(cot_tl_theLogo,cot_tl_LogoType,LogoPosition,theAffiliate)
{document.write('<div id="cot_tl_fixed">');
// Change the following link to point to your SSL Privacy page
document.write('<a href="https://seal.godaddy.com/verifySeal?sealID=RvtSmNYSCkdno2et4CeGMX26A9goyR8mSuO2fpK5DEmOZWoYbPCRj" target="_blank"><img src='+cot_tl_theLogo+' alt="Secure Shopping" border="0"></a>');
document.write('</div>');}

//if(window.location.protocol == "http:")
COT("images/seal.png", "SC2", "none");
//-->
</script>

<?php echo rss_feed_link_alternate(); // RSS Feed ?> </head> <?php // NOTE: Blank line following is intended: ?> ```Here's the error I'm receiving. > [04-Jul-2010 15:28:34] PHP Warning: Invalid argument supplied for foreach() in /home/content/x/x/x/xxxxxxxx/html/includes/functions/extra_functions/jscript.php on line 71 > Here's the file for that. Thanks in advance for your help.

Come to find out Mine was cause by having and older version of the css javascript loader. When I updated to the new version all errors went away. I didn't even know there was a newer version until yellow1912 told me what was going on and where to download it.

Is your site Upgraded to the current version 1.5.4 Yet?
zencart-upgrades-website-installation

1 Oct 2010, 8:14 PM
#26
smoke133 avatar

smoke133

Zen Follower

Join Date:
Jul 2007
Location:
Roseville, Michigan
Posts:
188
Plugin Contributions:
0

Re: css javascript loader addon problems

I have Css Javascript Loader loaded on my site. It looks like it is running correct. The problem that I'm into is with "column layout grid for product listing 1-3-8" module. When I have Css Javascript Loader turned off, everything looks correct. When I turn it on, the vertical line between the products on the product listing page gets really thick. It is suppose to be a thin vertical line.

Here is a link to the module.
http://www.zen-cart.com/index.php?main_page=product_contrib_info&products_id=77

Zencart 1.3.9f

Link to my site is in the signature.

https://www.jhelectronics.com
Using Zencart 1.3.9h

3 Oct 2010, 7:09 PM
#27
smoke133 avatar

smoke133

Zen Follower

Join Date:
Jul 2007
Location:
Roseville, Michigan
Posts:
188
Plugin Contributions:
0

Re: css javascript loader addon problems

Also I'm trying to get this to work with slimbox. What would my auto loader look like if I just want it to load on the product page. I think this module uses more than one js. Do you create an auto loader file for each js that it uses?

https://www.jhelectronics.com
Using Zencart 1.3.9h

4 Oct 2010, 4:03 PM
#28
smoke133 avatar

smoke133

Zen Follower

Join Date:
Jul 2007
Location:
Roseville, Michigan
Posts:
188
Plugin Contributions:
0

Re: css javascript loader addon problems

I still can't get this to work with slimbox.

I tried creating a php file in my template autoloader called loader_slimbox.php. Here is what I have in the file.

<?php
/**
* @package Pages
* @copyright Copyright 2008-2009 RubikIntegration.com
* @copyright Copyright 2003-2006 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: link.php 149 2009-03-04 05:23:35Z yellow1912 $
*/                                             
$loaders[] = array('conditions' => array('pages' => $pages),
                                        'jscript_files'             => array(
                    'slimbox/fual_slimbox.compressed.js'                 =>1,
                    'slimbox/mootools-release-1.11.slim.js'                 =>2,
                    'slimbox/slimbox_ex.compressed.js'                 =>3 ), 
                                                              'css_files' => array(
                        'stylesheet_slimbox_ex.css' => 1
                      )        
                                );

Now I'm get an error log saying PHP Warning: in_array(): Wrong datatype for second argument in /../includes/classes/class.cj_loader.php on line 68.

https://www.jhelectronics.com
Using Zencart 1.3.9h

9 Oct 2010, 4:35 AM
#29
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,129
Plugin Contributions:
56

Re: css javascript loader addon problems

@smoke133:

You want to add the statement:

$pages=explode('page1','page2');

before the $loaders array definition, where page1, page2, etc. are the pages where you want to load the slimbox, e.g.

$pages=explode('product_info','product_reviews','product_reviews_write');

Note: No spaces after the commas.

9 Oct 2010, 10:43 PM
#30
smoke133 avatar

smoke133

Zen Follower

Join Date:
Jul 2007
Location:
Roseville, Michigan
Posts:
188
Plugin Contributions:
0

Re: css javascript loader addon problems

Thank you for your help.

I'm no longer getting the error. Css javascript loader is creating a file, but it also still loading the original js files.

How do I get it to stop loading these files?

https://www.jhelectronics.com
Using Zencart 1.3.9h

25 Oct 2010, 7:13 PM
#31
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,129
Plugin Contributions:
56

Re: css javascript loader addon problems

countrycharm:

Come to find out Mine was cause by having and older version of the css javascript loader. When I updated to the new version all errors went away. I didn't even know there was a newer version until yellow1912 told me what was going on and where to download it.

For others looking for the most recent version, it's available from http://blog.rubikintegration.com/2009/08/08/zencart-css-javascript-loader-released/

25 Oct 2010, 11:36 PM
#33
countrycharm avatar

countrycharm

Totally Zenned

Join Date:
Jul 2007
Posts:
2,179
Plugin Contributions:
2

Re: css javascript loader addon problems

Actually 1.7 is the recent version and it will work for 1.3.9 versions of zen cart
You can download it from rubikintegration.com

Is your site Upgraded to the current version 1.5.4 Yet?
zencart-upgrades-website-installation

26 Oct 2010, 1:17 AM
#34
mprough avatar

mprough

Totally Zenned

Join Date:
Nov 2007
Location:
Woodbine, Georgia, United States
Posts:
4,324
Plugin Contributions:
40

Re: css javascript loader addon problems

lat9:

For others looking for the most recent version, it's available from http://blog.rubikintegration.com/2009/08/08/zencart-css-javascript-loader-released/

Sorry, but 1.7 is for 1.3.8 as the html_header (below) lacks the characteristic rel canonical function of 1.3.9

<?php
/**
 * Common Template
 *
 * outputs the html header. i,e, everything that comes before the \</head\> tag <br />
 * 
 * @package templateSystem
 * @copyright Copyright 2003-2006 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 6948 2007-09-02 23:30:49Z 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
/**
* 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') . ' -->';
?>
</head>
<?php // NOTE: Blank line following is intended: ?>
26 Oct 2010, 3:05 AM
#35
countrycharm avatar

countrycharm

Totally Zenned

Join Date:
Jul 2007
Posts:
2,179
Plugin Contributions:
2

Re: css javascript loader addon problems

mprough:

Sorry, but 1.7 is for 1.3.8 as the html_header (below) lacks the characteristic rel canonical function of 1.3.9

<?php /** * Common Template * * outputs the html header. i,e, everything that comes before the \</head\> tag <br /> * * @package templateSystem * @copyright Copyright 2003-2006 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 6948 2007-09-02 23:30:49Z 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 /** * 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') . ' -->'; ?> </head> <?php // NOTE: Blank line following is intended: ?> ```

Sorry mprough for misleading others, what I was trying to say it will work with 1.3.9, you have to compare and merge the files. Good catch

Is your site Upgraded to the current version 1.5.4 Yet?
zencart-upgrades-website-installation

26 Oct 2010, 7:19 AM
#36
finlander avatar

finlander

Zen Follower

Join Date:
Oct 2010
Location:
Idaho
Posts:
293
Plugin Contributions:
0

Re: css javascript loader addon problems

On a fresh version of CSS Loader, and assuming I did things correctly, what do I have to edit next? My site is totally broke (or just not displaying in the browser??) after a fresh install of CSS Loader.

I'll keep looking for the answer in the forums, but if I am just doing something really dumb, could someone tell me?

Thanks

26 Oct 2010, 7:28 AM
#37
finlander avatar

finlander

Zen Follower

Join Date:
Oct 2010
Location:
Idaho
Posts:
293
Plugin Contributions:
0

Re: css javascript loader addon problems

okay, I'm starting to fix it, but what is with the CSS Loader Usage instructions about duplicating and renaming the loader_sample file in the autoloader directory?

Does it need to be done?

If so, in what way?, because my best effort caused total breakage in the browser.

26 Oct 2010, 1:25 PM
#38
countrycharm avatar

countrycharm

Totally Zenned

Join Date:
Jul 2007
Posts:
2,179
Plugin Contributions:
2

Re: css javascript loader addon problems

finlander:

okay, I'm starting to fix it, but what is with the CSS Loader Usage instructions about duplicating and renaming the loader_sample file in the autoloader directory?

Does it need to be done?

If so, in what way?, because my best effort caused total breakage in the browser.
Take the includes/templates/your_template/common/html_header.php and copy the contents below and insert it in that file nothing else and see if that want solve your problem.

<?php
/**
 * Common Template
 *
 * outputs the html header. i,e, everything that comes before the \</head\> tag <br />
 * 
 * @package templateSystem
 * @copyright Copyright 2003-2006 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 6948 2007-09-02 23:30:49Z 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>
<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>" />
<title><?php echo META_TAG_TITLE; ?></title>

<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="<?php echo STORE_NAME .', ' . TEMPLATE_DESIGN_TEXT . ', shopping cart program by Zen Cart™, http://www.zen-cart.com eCommerce';?>" />
<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
/**
* 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') . ' -->';
?>
</head>
<?php // NOTE: Blank line following is intended: ?>

Is your site Upgraded to the current version 1.5.4 Yet?
zencart-upgrades-website-installation

26 Oct 2010, 2:48 PM
#39
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,129
Plugin Contributions:
56

Re: css javascript loader addon problems

mprough:

Sorry, but 1.7 is for 1.3.8 as the html_header (below) lacks the characteristic rel canonical function of 1.3.9

Here's v1.3.9f's /includes/templates/template_default/common/html_header.php merged with the v1.7 of the loader's changes. Place this into /includes/templates/YOUR_TEMPLATE/common/html_header.php (merging any previous changes you might have).

26 Oct 2010, 3:00 PM
#40
countrycharm avatar

countrycharm

Totally Zenned

Join Date:
Jul 2007
Posts:
2,179
Plugin Contributions:
2

Re: css javascript loader addon problems

lat9:

Here's v1.3.9f's /includes/templates/template_default/common/html_header.php merged with the v1.7 of the loader's changes. Place this into /includes/templates/YOUR_TEMPLATE/common/html_header.php (merging any previous changes you might have).
The same I suggested above. Maybe you will get it sorted out between both post. Thanks for providing the file lat9.

Is your site Upgraded to the current version 1.5.4 Yet?
zencart-upgrades-website-installation