zc v157b php 7.3
I have Middleboxes working on the site without any apparent issues other than the following myDebug error and I am not sure how to fix it - any assistance will be appreciated.
HTML Code:
[18-Jun-2023 13:10:05 Australia/Sydney] Request URI: /, IP address: 66.249.68.51
#1 constant() called at [/home/name/cliponearrings.net.au/includes/templates/responsive_classic_1/templates/tpl_middleboxes.php:40]
#2 require(/home/name/cliponearrings.net.au/includes/templates/responsive_classic_1/templates/tpl_middleboxes.php) called at [/home/name/cliponearrings.net.au/includes/templates/responsive_classic_1/templates/tpl_index_default.php:91]
#3 require(/home/name/cliponearrings.net.au/includes/templates/responsive_classic_1/templates/tpl_index_default.php) called at [/home/name/cliponearrings.net.au/includes/modules/pages/index/main_template_vars.php:232]
#4 require(/home/name/cliponearrings.net.au/includes/modules/pages/index/main_template_vars.php) called at [/home/name/cliponearrings.net.au/includes/templates/responsive_classic_1/common/tpl_main_page.php:178]
#5 require(/home/name/cliponearrings.net.au/includes/templates/responsive_classic_1/common/tpl_main_page.php) called at [/home/name/cliponearrings.net.au/index.php:94]
--> PHP Warning: constant(): Couldn't find constant BOX_HEADING_MIDDLEBOX in /home/name/cliponearrings.net.au/includes/templates/responsive_classic_1/templates/tpl_middleboxes.php on line 40.
problematic line didn't hihglight as I expected below inside the php.
line is ?> <h3><?php echo constant('BOX_HEADING_MIDDLEBOX' . $box_no); ?></h3>
- (as an aside - the heading tag H3 does not work in middle boxes (never has as far as I'm aware) - resolves as just 'white space' - have to use h4 instead)
PHP Code:
<?php
/**
* Page Template
*
* Centerboxes are called as necessary
*
* @package templateSystem
* @copyright Copyright 2012 Glenn Herbert
* @copyright Portions 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
* /includes/templates/your_template/templates/tpl_middleboxes.php gjh42 2012-10-15
* Editable Centerboxes by C. Jones, Glenn Herbert
*/
if ($this_is_home_page or (defined('MIDDLEBOX_HOME') && !MIDDLEBOX_HOME) or $box_loc >= 8) {
$column_box_default = 'tpl_box_default_center.php';
$middleboxes_group = array();
for ($i=1; $i<=9; $i++) {
if (defined('MIDDLEBOX_NUMBER_' . $i) && constant('MIDDLEBOX_NUMBER_' . $i) == (int)$box_loc) $middleboxes_group[] = $i;
}
if (!empty($middleboxes_group)) {
echo "\n\n";
?><!-- BOF Middlebox Group <?php echo $box_loc; ?> -->
<div id="navColumnMiddleWrapper<?php echo $box_loc; ?>" class="navColumnMiddleWrapper"><?php
for($ix=0, $iy = count($middleboxes_group); $ix<$iy; $ix++) {
$box_no = $middleboxes_group[$ix];
?> <div class="middleboxContainer" id="middlebox_<?php echo $box_no; ?>"><?php
$middlebox_name = constant('FILENAME_DEFINE_MIDDLEBOX_' . $box_no);
$sidebox_name = constant('SIDEBOX_MIDDLEBOX_' . $box_no);
$sidebox_filename = $sidebox_name . '.php';
if ($sidebox_name and (file_exists(DIR_WS_MODULES . 'sideboxes/' . $sidebox_filename) or file_exists(DIR_WS_MODULES . 'sideboxes/' . $template_dir . '/' . $sidebox_filename))) {
$box_id = zen_get_box_id($sidebox_filename); //sidebox handling
if ( file_exists(DIR_WS_MODULES . 'sideboxes/' . $template_dir . '/' . $sidebox_filename) ) {
require(DIR_WS_MODULES . 'sideboxes/' . $template_dir . '/' . $sidebox_filename);
} else {
require(DIR_WS_MODULES . 'sideboxes/' . $sidebox_filename);
}
} else { //defined middlebox output
?> <h3><?php echo constant('BOX_HEADING_MIDDLEBOX' . $box_no); ?></h3>
<div class="middleboxContent"><?php
require zen_get_file_directory(DIR_WS_LANGUAGES . $_SESSION['language'] . '/html_includes/', $middlebox_name, 'false');
?> </div>
<?php
}
?> </div>
<?php
}
?></div>
<br class="clearBoth" />
<!-- EOF Middlebox Group <?php echo $box_loc; ?> -->
<?php
}
}
//eof
Bookmarks