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 1 to 20 of 111
24 May 2010, 11:22 PM
#1
tony_sar avatar

tony_sar

Totally Zenned

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

css javascript loader addon problems

Hello.
on my zc 139c , I have installed following .. TTP , jqlightbox.
I also installed slider that will slide images on my index page. this slider needs jquery as well as 3 other jq plugins. my problem is with jqlightbox auto loader . as per author of this plugin , i can modify autoloader to load css jscript pages without duplication . but documents for this script is not written well, so im stuck as how to configure auto loader to load jquery and related script for that slider only on my index page.
will appreciate anyone that can explain this in painless way ..

ps : i have not installed CSS Javascript loader , but only jqlightbox and TTP which seems both use this loader anyway.

26 May 2010, 1:24 PM
#2
andreitero avatar

andreitero

Zen Follower

Join Date:
Dec 2009
Posts:
207
Plugin Contributions:
0

Re: css javascript loader addon problems

I have the same problem, so far i tried modifying the loader.php sample to load some .js files on my home page, but it's not working as expected :no:

<?php

         $loaders[] = array('conditions' => array('pages' => array('index_home')),
                                         'jscript_files'             => array(
                                                                   
                                                                      'jquery/jquery-1.4.2.min.js'  => 10,  
                                                                      'fadeslideshow.js'                 => 11                                                                       
                                         ));
26 May 2010, 9:00 PM
#3
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

what error(s) are you getting. ?replace 'index_home' with 'index' and try to see if that helps.

27 May 2010, 4:18 AM
#4
andreitero avatar

andreitero

Zen Follower

Join Date:
Dec 2009
Posts:
207
Plugin Contributions:
0

Re: css javascript loader addon problems

Thanks for that, it worked now to load the jquery library 1.4.2 and the fadeslideshow.js , but the slideshow stopped working. This thread gives explicit directions for the slideshow installation. When i'm trying to use the loader_slideshow.php, i am placing the fadeslideshow.js in my jscript folder, where i also copy the images folder.
I'm also having doubts about loading the 1.4.2 jquery library because the one from googleapis is 1.3.2 and already minified and has a smaller size than mine loaded with C/J loader, but it's from a different domain. What do you think would be best for load time? keep the smaller size one from googleapis or the bigger one from my own domain? (well that's in case i get the slideshow working :laugh: )

27 May 2010, 8:18 PM
#5
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

cj loader will minify your jquery file and will cache them on clients computer. i checked one of your site , and slide show seems to be working correctly :blink:

28 May 2010, 4:47 AM
#6
andreitero avatar

andreitero

Zen Follower

Join Date:
Dec 2009
Posts:
207
Plugin Contributions:
0

Re: css javascript loader addon problems

Yes it is already working on lemy.co.uk but it's loaded directly from the html_header and is not minified because the files are not loaded from loader_slideshow.php, but instead from pages/index/fadeslideshow.js, exactly like in the thread i gave the link in the previous post. The loader works, it's minifying the 1.4.2 jquery library and the fadeslideshow.js(i can see them in page source), but then it is not displaying it. I suspect is from the Pictures folder needed for this slider, but i'll need to fiddle more with it because i can understand it's hard for someone to give a verdict and help me when they can't see it in action, but the site is live.

4 Jun 2010, 4:15 PM
#8
blessisaacola avatar

blessisaacola

Totally Zenned

Join Date:
Feb 2004
Location:
Georgia, USA
Posts:
1,875
Plugin Contributions:
1

Re: css javascript loader addon problems

I really need help troubleshooting how the CJ Loader actually works. Since upgrading our JQuery Lightbox to version 1.7 which uses the CJ Loader, our site is acting strange.

Stylesheets and scripts are being loader twice. Here is an example from view source:

<link rel="stylesheet" type="text/css" href="includes/templates/cs_main/css/stylesheet.css" />
<link rel="stylesheet" type="text/css" href="includes/templates/cs_main/css/index_home.css" />
<link rel="stylesheet" type="text/css" media="print" href="includes/templates/cs_main/css/print_stylesheet.css" />

<script type="text/javascript" src="includes/templates/cs_main/jscript/jscript_imagehover.js"></script>
<script type="text/javascript" src="includes/templates/cs_main/jscript/jscript_utils.js"></script>
<link rel="stylesheet" type="text/css" media="print" href="includes/templates/cs_main/css/print_stylesheet.css" />
<link rel="stylesheet" type="text/css" href="min/?f=/includes/templates/cs_main/css/stylesheet.css,/includes/templates/cs_main/css/index_home.css&1275511773" />
<script type="text/javascript" src="min/?f=/includes/templates/cs_main/jscript/jscript_imagehover.js,/includes/templates/cs_main/jscript/jscript_utils.js&1275511773"></script>

Can someone please direct me to where to start to even troubleshoot this?

Thanks!

4 Jun 2010, 9:34 PM
#9
blessisaacola avatar

blessisaacola

Totally Zenned

Join Date:
Feb 2004
Location:
Georgia, USA
Posts:
1,875
Plugin Contributions:
1

Re: css javascript loader addon problems

Okay, if I change my html_header.php from:

<?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="Clevershoppers.com" />
<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 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');
  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 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
                        );
  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)) echo '<link rel="stylesheet" type="text/css" href="' . $perpagefile .'" />'."\n";
  }

/**
 * 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";
  }

/**
 * 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');
  while(list ($key, $value) = each($directory_array)) {
    echo '<script type="text/javascript" src="' .  $template->get_template_dir('.js',DIR_WS_TEMPLATE, $current_page_base,'jscript') . '/' . $value . '"></script>'."\n";
  }

/**
 * load all page-specific jscript_*.js files from includes/modules/pages/PAGENAME, alphabetically
 */
  $directory_array = $template->get_template_part($page_directory, '/^jscript_/', '.js');
  while(list ($key, $value) = each($directory_array)) {
    echo '<script type="text/javascript" src="' . $page_directory . '/' . $value . '"></script>' . "\n";
  }

/**
 * 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');
  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
 */
    require($template->get_template_dir('.php',DIR_WS_TEMPLATE, $current_page_base,'jscript') . '/' . $value); echo "\n";
  }
/**
 * include content from all page-specific jscript_*.php files from includes/modules/pages/PAGENAME, alphabetically.
 */
  $directory_array = $template->get_template_part($page_directory, '/^jscript_/');
  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
 */
    require($page_directory . '/' . $value); echo "\n";
  }

/**
* 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: ?>

to this:

<?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="Clevershoppers.com" />
<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: ?>

Then the duplicate is gone. Is this the right way to go about this?

17 Jun 2010, 4:46 AM
#11
saplanet avatar

saplanet

New Zenner

Join Date:
Jun 2008
Location:
Singapore, Australia, America
Posts:
97
Plugin Contributions:
0

Re: css javascript loader addon problems

<?php
/**
 * Common Template - tpl_header.php
 *
 * this file can be copied to /templates/your_template_dir/pagename<br />
 * example: to override the privacy page<br />
 * make a directory /templates/my_template/privacy<br />
 * copy /templates/templates_defaults/common/tpl_footer.php to /templates/my_template/privacy/tpl_header.php<br />
 * to override the global settings and turn off the footer un-comment the following line:<br />
 * <br />
 * $flag_disable_header = true;<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: tpl_header.php 3392 2006-04-08 15:17:37Z birdbrain $
 */
?>
<!--bof-header logo and navigation display-->
<?php
if (!isset($flag_disable_header) || !$flag_disable_header) {
?>
<div id="headerWrapper" class="clearfix">
  <?php
  if (SHOW_BANNERS_GROUP_SET1 != '' && $banner = zen_banner_exists('dynamic', SHOW_BANNERS_GROUP_SET1)) {
    if ($banner->RecordCount() > 0) {
?>
<div id="bannerOne" class="banners"><?php echo zen_display_banner('static', $banner); ?></div>
<?php
    }
  }
?>
  <div id="headerWrappera">
    <div id="headerWrapperb">
      <div id="headerWrapperc">
        <!--bof-navigation display-->
        <div id="navMainWrapper" class="clearfix">
          <div id="navMain">
            <div id="navMainLinks">
              <ul class="back">
                <li><?php echo '<a href="' . HTTP_SERVER . DIR_WS_CATALOG . '">'; ?><?php echo HEADER_TITLE_CATALOG; ?></a></li>
                <?php if ($_SESSION['customer_id']) { ?>
                <li><a href="<?php echo zen_href_link(FILENAME_LOGOFF, '', 'SSL'); ?>"><?php echo HEADER_TITLE_LOGOFF; ?></a></li>
                <li><a href="<?php echo zen_href_link(FILENAME_ACCOUNT, '', 'SSL'); ?>"><?php echo HEADER_TITLE_MY_ACCOUNT; ?></a></li>
                <?php
      } else {
        if (STORE_STATUS == '0') {
?>
                <li><a href="<?php echo zen_href_link(FILENAME_LOGIN, '', 'SSL'); ?>"><?php echo HEADER_TITLE_LOGIN; ?></a></li>
                <?php } } ?>
                <?php if ($_SESSION['cart']->count_contents() != 0) { ?>
                <li><a href="<?php echo zen_href_link(FILENAME_SHOPPING_CART, '', 'NONSSL'); ?>"><?php echo HEADER_TITLE_CART_CONTENTS; ?></a></li>
                <li><a href="<?php echo zen_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL'); ?>"><?php echo HEADER_TITLE_CHECKOUT; ?></a></li>
                <?php }?>
              </ul>
            </div>
            <div id="navMainSearch">
              <?php require(DIR_WS_MODULES . 'sideboxes/search_header.php'); ?>
            </div>
          </div>
        </div>
        <!--eof-navigation display-->
        <!--bof-branding display-->
        <div id="logoWrapperOuter">
          <div id="logoWrapper">
            <div id="logo"><?php echo '<a href="' . HTTP_SERVER . DIR_WS_CATALOG . '">' . zen_image($template->get_template_dir(HEADER_LOGO_IMAGE, DIR_WS_TEMPLATE, $current_page_base,'images'). '/' . HEADER_LOGO_IMAGE, HEADER_ALT_TEXT, HEADER_LOGO_WIDTH, HEADER_LOGO_HEIGHT) . '</a>'; ?></div>
            <?php if (HEADER_SALES_TEXT != '' || (SHOW_BANNERS_GROUP_SET2 != '' && $banner = zen_banner_exists('dynamic', SHOW_BANNERS_GROUP_SET2))) { ?>
            <div id="taglineWrapper">
              <?php
              if (HEADER_SALES_TEXT != '') {
?>
              <div id="tagline"><?php echo HEADER_SALES_TEXT;?></div>
              <?php
              }
?>
              <?php
              if (SHOW_BANNERS_GROUP_SET2 != '' && $banner = zen_banner_exists('dynamic', SHOW_BANNERS_GROUP_SET2)) {
                if ($banner->RecordCount() > 0) {
?>
              <br class="clearBoth" /><div id="bannerTwo" class="banners"><?php echo zen_display_banner('static', $banner);?></div>
              <?php
                }
              }
?>
            </div>
            <?php } // no HEADER_SALES_TEXT or SHOW_BANNERS_GROUP_SET2 ?>
          </div>
        </div>
        <!--eof-branding display-->
        <!--eof-header logo and navigation display-->
        <!--bof-header ezpage links-->
        <?php if (EZPAGES_STATUS_HEADER == '1' or (EZPAGES_STATUS_HEADER == '2' and (strstr(EXCLUDE_ADMIN_IP_FOR_MAINTENANCE, $_SERVER['REMOTE_ADDR'])))) { ?>
        <div id="navEZPagesTopWrapper">
          <?php require($template->get_template_dir('tpl_ezpages_bar_header.php',DIR_WS_TEMPLATE, $current_page_base,'templates'). '/tpl_ezpages_bar_header.php'); ?>
        </div>
        <?php } ?>
        <!--eof-header ezpage links-->
        <!--bof-optional categories tabs navigation display-->
        <?php require($template->get_template_dir('tpl_modules_categories_tabs.php',DIR_WS_TEMPLATE, $current_page_base,'templates'). '/tpl_modules_categories_tabs.php'); ?>
        <!--eof-optional categories tabs navigation display-->
      </div>
    </div>
  </div>
</div>
<?php } ?>

I am using 1.39d, and using custom template. I tried to merge the existing html_header.php (shown here is from my template), but couldn't seem to be doing the right thing, my page turns out blank.

Appreciate anyone who might know where what and where to change?

17 Jun 2010, 4:52 AM
#12
blessisaacola avatar

blessisaacola

Totally Zenned

Join Date:
Feb 2004
Location:
Georgia, USA
Posts:
1,875
Plugin Contributions:
1

Re: css javascript loader addon problems

saplanet:

<?php /** * Common Template - tpl_header.php * * this file can be copied to /templates/your_template_dir/pagename<br /> * example: to override the privacy page<br /> * make a directory /templates/my_template/privacy<br /> * copy /templates/templates_defaults/common/tpl_footer.php to /templates/my_template/privacy/tpl_header.php<br /> * to override the global settings and turn off the footer un-comment the following line:<br /> * <br /> * $flag_disable_header = true;<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: tpl_header.php 3392 2006-04-08 15:17:37Z birdbrain $ */ ?> <!--bof-header logo and navigation display--> <?php if (!isset($flag_disable_header) || !$flag_disable_header) { ?> <div id="headerWrapper" class="clearfix"> <?php if (SHOW_BANNERS_GROUP_SET1 != '' && $banner = zen_banner_exists('dynamic', SHOW_BANNERS_GROUP_SET1)) { if ($banner->RecordCount() > 0) { ?> <div id="bannerOne" class="banners"><?php echo zen_display_banner('static', $banner); ?></div> <?php } } ?> <div id="headerWrappera"> <div id="headerWrapperb"> <div id="headerWrapperc"> <!--bof-navigation display--> <div id="navMainWrapper" class="clearfix"> <div id="navMain"> <div id="navMainLinks"> <ul class="back"> <li><?php echo '<a href="' . HTTP_SERVER . DIR_WS_CATALOG . '">'; ?><?php echo HEADER_TITLE_CATALOG; ?></a></li> <?php if ($_SESSION['customer_id']) { ?> <li><a href="<?php echo zen_href_link(FILENAME_LOGOFF, '', 'SSL'); ?>"><?php echo HEADER_TITLE_LOGOFF; ?></a></li> <li><a href="<?php echo zen_href_link(FILENAME_ACCOUNT, '', 'SSL'); ?>"><?php echo HEADER_TITLE_MY_ACCOUNT; ?></a></li> <?php } else { if (STORE_STATUS == '0') { ?> <li><a href="<?php echo zen_href_link(FILENAME_LOGIN, '', 'SSL'); ?>"><?php echo HEADER_TITLE_LOGIN; ?></a></li> <?php } } ?> <?php if ($_SESSION['cart']->count_contents() != 0) { ?> <li><a href="<?php echo zen_href_link(FILENAME_SHOPPING_CART, '', 'NONSSL'); ?>"><?php echo HEADER_TITLE_CART_CONTENTS; ?></a></li> <li><a href="<?php echo zen_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL'); ?>"><?php echo HEADER_TITLE_CHECKOUT; ?></a></li> <?php }?> </ul> </div> <div id="navMainSearch"> <?php require(DIR_WS_MODULES . 'sideboxes/search_header.php'); ?> </div> </div> </div> <!--eof-navigation display--> <!--bof-branding display--> <div id="logoWrapperOuter"> <div id="logoWrapper"> <div id="logo"><?php echo '<a href="' . HTTP_SERVER . DIR_WS_CATALOG . '">' . zen_image($template->get_template_dir(HEADER_LOGO_IMAGE, DIR_WS_TEMPLATE, $current_page_base,'images'). '/' . HEADER_LOGO_IMAGE, HEADER_ALT_TEXT, HEADER_LOGO_WIDTH, HEADER_LOGO_HEIGHT) . '</a>'; ?></div> <?php if (HEADER_SALES_TEXT != '' || (SHOW_BANNERS_GROUP_SET2 != '' && $banner = zen_banner_exists('dynamic', SHOW_BANNERS_GROUP_SET2))) { ?> <div id="taglineWrapper"> <?php if (HEADER_SALES_TEXT != '') { ?> <div id="tagline"><?php echo HEADER_SALES_TEXT;?></div> <?php } ?> <?php if (SHOW_BANNERS_GROUP_SET2 != '' && $banner = zen_banner_exists('dynamic', SHOW_BANNERS_GROUP_SET2)) { if ($banner->RecordCount() > 0) { ?> <br class="clearBoth" /><div id="bannerTwo" class="banners"><?php echo zen_display_banner('static', $banner);?></div> <?php } } ?> </div> <?php } // no HEADER_SALES_TEXT or SHOW_BANNERS_GROUP_SET2 ?> </div> </div> <!--eof-branding display--> <!--eof-header logo and navigation display--> <!--bof-header ezpage links--> <?php if (EZPAGES_STATUS_HEADER == '1' or (EZPAGES_STATUS_HEADER == '2' and (strstr(EXCLUDE_ADMIN_IP_FOR_MAINTENANCE, $_SERVER['REMOTE_ADDR'])))) { ?> <div id="navEZPagesTopWrapper"> <?php require($template->get_template_dir('tpl_ezpages_bar_header.php',DIR_WS_TEMPLATE, $current_page_base,'templates'). '/tpl_ezpages_bar_header.php'); ?> </div> <?php } ?> <!--eof-header ezpage links--> <!--bof-optional categories tabs navigation display--> <?php require($template->get_template_dir('tpl_modules_categories_tabs.php',DIR_WS_TEMPLATE, $current_page_base,'templates'). '/tpl_modules_categories_tabs.php'); ?> <!--eof-optional categories tabs navigation display--> </div> </div> </div> </div> <?php } ?> ``` > > I am using 1.39d, and using custom template. I tried to merge the existing html_header.php (shown here is from my template), but couldn't seem to be doing the right thing, my page turns out blank. > > Appreciate anyone who might know where what and where to change?

well, for a start, this is the wrong file. you want html_header.php NOT tpl_header.php

17 Jun 2010, 4:59 AM
#13
saplanet avatar

saplanet

New Zenner

Join Date:
Jun 2008
Location:
Singapore, Australia, America
Posts:
97
Plugin Contributions:
0

Re: css javascript loader addon problems

BlessIsaacola:

well, for a start, this is the wrong file. you want html_header.php NOT tpl_header.php

:oops: thank you for pointing that out.. :blush: Will go try the correct file now.

17 Jun 2010, 5:08 AM
#14
saplanet avatar

saplanet

New Zenner

Join Date:
Jun 2008
Location:
Singapore, Australia, America
Posts:
97
Plugin Contributions:
0

Re: css javascript loader addon problems

<?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="saplanet originals by lis chaong" />
<meta name="generator" content="saplanet originals - handcrafted amigurumi and wedding favors" />
<?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 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');
  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 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
                        );
  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)) echo '<link rel="stylesheet" type="text/css" href="' . $perpagefile .'" />'."\n";
  }

/**
 * 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";
  }

/**
 * 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');
  while(list ($key, $value) = each($directory_array)) {
    echo '<script type="text/javascript" src="' .  $template->get_template_dir('.js',DIR_WS_TEMPLATE, $current_page_base,'jscript') . '/' . $value . '"></script>'."\n";
  }

/**
 * load all page-specific jscript_*.js files from includes/modules/pages/PAGENAME, alphabetically
 */
  $directory_array = $template->get_template_part($page_directory, '/^jscript_/', '.js');
  while(list ($key, $value) = each($directory_array)) {
    echo '<script type="text/javascript" src="' . $page_directory . '/' . $value . '"></script>' . "\n";
  }

/**
 * 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');
  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
 */
    require($template->get_template_dir('.php',DIR_WS_TEMPLATE, $current_page_base,'jscript') . '/' . $value); echo "\n";
  }
/**
 * include content from all page-specific jscript_*.php files from includes/modules/pages/PAGENAME, alphabetically.
 */
  $directory_array = $template->get_template_part($page_directory, '/^jscript_/');
  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
 */
    require($page_directory . '/' . $value); echo "\n";
  }

// 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: ?>

:cry: Still no joy.

17 Jun 2010, 5:59 AM
#15
blessisaacola avatar

blessisaacola

Totally Zenned

Join Date:
Feb 2004
Location:
Georgia, USA
Posts:
1,875
Plugin Contributions:
1

Re: css javascript loader addon problems

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: ?>
17 Jun 2010, 6:26 AM
#16
saplanet avatar

saplanet

New Zenner

Join Date:
Jun 2008
Location:
Singapore, Australia, America
Posts:
97
Plugin Contributions:
0

Re: css javascript loader addon problems

Thank you for offering the help.

Most of the codes are needed to load my site. I still can't figure out where to insert the cj loader code. I used a merge application to check against my file, and when replaced with the CJ code, it won't load for me.

Anyone else used this mod on the customized html_header.php file?

17 Jun 2010, 12:25 PM
#17
andreitero avatar

andreitero

Zen Follower

Join Date:
Dec 2009
Posts:
207
Plugin Contributions:
0

Re: css javascript loader addon problems

I am using it with no problems so far. Try this:

<?php
	require_once(DIR_WS_CLASSES . 'class.cj_loader.php');
	$ri_cj_loader = new RICJLoader();
	list($css_files_to_load, $jscript_files_to_load) = $ri_cj_loader->loadCssJsFiles();
  $files = $ri_cj_loader->processCssJsFiles($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') . ' -->';
?>

The above code should replace this part in you html_header.php:

<?php
/**
 * load all template-specific stylesheets, named like "style*.css", alphabetically
 */ 
....
....
....
// DEBUG: echo '<!-- I SEE cat: ' . $current_category_id . ' || vs cpath: ' . $cPath . ' || page: ' . $current_page . ' || template: ' . $current_template . ' || main = ' . ($this_is_home_page ? 'YES' : 'NO') . ' -->';


?>

Give it a try and post here if it was successful.

17 Jun 2010, 12:42 PM
#18
saplanet avatar

saplanet

New Zenner

Join Date:
Jun 2008
Location:
Singapore, Australia, America
Posts:
97
Plugin Contributions:
0

Re: css javascript loader addon problems

:clap: Thank you, andreitero!!!!! I did what you suggested, and I believe it works!! :bigups:

17 Jun 2010, 2:47 PM
#20
blessisaacola avatar

blessisaacola

Totally Zenned

Join Date:
Feb 2004
Location:
Georgia, USA
Posts:
1,875
Plugin Contributions:
1

Re: css javascript loader addon problems

saplanet:

:clap: Thank you, andreitero!!!!! I did what you suggested, and I believe it works!! :bigups:

Glad you got it to work...I was actually trying to show you the difference between my file and yours to let you know you have to remove the old code and replace it with CJ Loader code. Sorry about the confusion.