No problem, I ended up chasing down the issue after posting the things I thought could lead to the problem... (One of those talk it through with oneself situations).
There are a few different ways to address this that I see.
One is to "fix" the includes/templates/responsive_classic/common/main_template_vars.php file so that it ensures to load and assign the $detect variable the same way that it is done in includes/templates/responsive_classic/common/html_header.php because each of these files can be overridden and the mobile detect code really is only loaded when a template is considered responsive and can support the mobile detection actions.
Another fix was to update the provided html_header.php file that is incorporated to the system when installing sitemapxml, copy that file to the applicable responsive template and yet another fix is to add a main_template_vars.php file to either of those two solutions so that no matter what the common/main_template_vars.php file would not be loaded.
Each of those solutions has its "problems". I haven't investigated what main_template_vars would be needed to ensure continued operation to just display the sitemapxml page, but I'm thinking that probably is the best/easiest way to go.
Anyways, if I may suggest, copy the file header_php.php
from: includes/templates/template_default/sitemapxml
to: includes/templates/responsive_tow/sitemapxml/header_php.php
Then modify the file and towards the end add:
Code:
// ZCAdditions.com, ZCA Responsive Template Default (BOF-addition 1 of 2)
if (!class_exists('Mobile_Detect')) {
include_once(DIR_WS_CLASSES . 'Mobile_Detect.php');
}
$detect = new Mobile_Detect;
$isMobile = $detect->isMobile();
$isTablet = $detect->isTablet();
if (!isset($layoutType)) $layoutType = ($isMobile ? ($isTablet ? 'tablet' : 'mobile') : 'default');
// ZCAdditions.com, ZCA Responsive Template Default (BOF-addition 1 of 2)
So that the file would look something like:
Code:
<?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 $
*/
?>
<!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 HEADING_TITLE; ?></title>
<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>" />
<meta http-equiv="imagetoolbar" content="no" />
<?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 ); ?>" />
</head>
<?php
// ZCAdditions.com, ZCA Responsive Template Default (BOF-addition 1 of 2)
if (!class_exists('Mobile_Detect')) {
include_once(DIR_WS_CLASSES . 'Mobile_Detect.php');
}
$detect = new Mobile_Detect;
$isMobile = $detect->isMobile();
$isTablet = $detect->isTablet();
if (!isset($layoutType)) $layoutType = ($isMobile ? ($isTablet ? 'tablet' : 'mobile') : 'default');
// ZCAdditions.com, ZCA Responsive Template Default (BOF-addition 1 of 2)
// NOTE: Blank line following is intended: ?>
Another thing that could be done is to incorporate the above ZCAdditions.com code into the includes/templates/responsive_tow/common/main_template_vars.php file just before the attempted use of $detect.
That's just two ways considered to resolve the issue.
Thank you though for the search of $detect. Like said above, because I listed all the "ifs" and then actually dug into the core ZC code and what is typically included in sitemapxml, I was able to identify the above as potential solutions.
Bookmarks