Jump to content

HowdyMedia

Members
  • Content count

    1
  • Joined

  • Last visited

Everything posted by HowdyMedia

  1. HowdyMedia

    [Addon} Theme Switcher

    Hi, First, I appreciate all the hard work I've seen in installing two other of your contributions. Everything is laid out well and the documentation prepared was a showing of sincerity. Regardless, I manually install everything as I can not blindly trust copying over core files. I did find some inconsistencies in the other two (Modular SEO Header Tags and Modular Front Page) where the versions included would have overwritten some of the 2.3.3 changes, as such, I know the manual method is the only way for me to go. Now, I did noticed a few problems in the included version of: /includes/template_top.php First, per your instructions, the default links to the redmond css and the jQuery libraries are to be removed (3 lines in total). This ignores the possibility that if the header_tag is set to be inactive, and then there wouldn't be any jQuery libraries loaded. In essence, there should be a if block in which the standard 3 lines should be used. I suppose while at it, it probably would be good to have a fail safe condition to check for - whether the jQuery libraries are accessible via this contribution or not. Pseudo-code! Don't Use this. if (theme_switcher_active === false || theme_switcher_found_jquery_libraries === false) { ?> <link rel="stylesheet" type="text/css" href="ext/jquery/ui/redmond/jquery-ui-1.8.22.css" /> <script type="text/javascript" src="ext/jquery/jquery-1.8.0.min.js"></script> <script type="text/javascript" src="ext/jquery/ui/jquery-ui-1.8.22.min.js"></script> <?php } Second, there is a potential JS error ($ is not defined) since the jQuery libraries are not loaded prior to the 'JQUERY_DATEPICKER_I18N_CODE' conditional block. If JQUERY_DATEPICKER_I18N_CODE is not null, then something would break. Here is the revised version of /includes/template_top.php that I used. I haven't done any code searches to figure out what would need to be checked for the conditional block for default/fail-safe jQuery above, so I'm trusting at this stage that it won't be an issue. <?php /* $Id$ $Mod: Theme Switcher 1.4.1 20120828 Kymation $ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com Copyright (c) 2012 osCommerce Released under the GNU General Public License */ $oscTemplate->buildBlocks(); if (!$oscTemplate->hasBlocks('boxes_column_left')) { $oscTemplate->setGridContentWidth($oscTemplate->getGridContentWidth() + $oscTemplate->getGridColumnWidth()); } if (!$oscTemplate->hasBlocks('boxes_column_right')) { $oscTemplate->setGridContentWidth($oscTemplate->getGridContentWidth() + $oscTemplate->getGridColumnWidth()); } ?> <!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 tep_output_string_protected($oscTemplate->getTitle()); ?></title> <base href="<?php echo (($request_type == 'SSL') ? HTTPS_SERVER : HTTP_SERVER) . DIR_WS_CATALOG; ?>" /> <?php if (some_yet_to_be_determined_condition === false) { ?> <link rel="stylesheet" type="text/css" href="ext/jquery/ui/redmond/jquery-ui-1.8.6.css" /> <script type="text/javascript" src="ext/jquery/jquery-1.4.2.min.js"></script> <script type="text/javascript" src="ext/jquery/ui/jquery-ui-1.8.6.min.js"></script> <?php } ?> <link rel="stylesheet" type="text/css" href="ext/960gs/<?php echo ((stripos(HTML_PARAMS, 'dir="rtl"') !== false) ? 'rtl_' : ''); ?>960_24_col.css" /> <link rel="stylesheet" type="text/css" href="stylesheet.css" /> <?php echo $oscTemplate->getBlocks('header_tags'); ?> <script type="text/javascript"> // fix jQuery 1.8.0 and jQuery UI 1.8.22 bug with dialog buttons; http://bugs.jqueryui.com/ticket/8484 if ( $.attrFn ) { $.attrFn.text = true; } </script> <?php if (tep_not_null(JQUERY_DATEPICKER_I18N_CODE)) { ?> <script type="text/javascript" src="ext/jquery/ui/i18n/jquery.ui.datepicker-<?php echo JQUERY_DATEPICKER_I18N_CODE; ?>.js"></script> <script type="text/javascript"> $.datepicker.setDefaults($.datepicker.regional['<?php echo JQUERY_DATEPICKER_I18N_CODE; ?>']); </script> <?php } ?> <script type="text/javascript" src="ext/jquery/bxGallery/jquery.bxGallery.1.1.min.js"></script> <link rel="stylesheet" type="text/css" href="ext/jquery/fancybox/jquery.fancybox-1.3.4.css" /> <script type="text/javascript" src="ext/jquery/fancybox/jquery.fancybox-1.3.4.pack.js"></script> </head> <body> <div id="bodyWrapper" class="container_<?php echo $oscTemplate->getGridContainerWidth(); ?>"> <?php require(DIR_WS_INCLUDES . 'header.php'); ?> <div id="bodyContent" class="grid_<?php echo $oscTemplate->getGridContentWidth(); ?> <?php echo ($oscTemplate->hasBlocks('boxes_column_left') ? 'push_' . $oscTemplate->getGridColumnWidth() : ''); ?>">
×