Results 1 to 5 of 5
  1. #1
    Join Date
    Jan 2011
    Location
    Adelaide, Australia
    Posts
    1,670
    Plugin Contributions
    1

    Default Middleboxes myDebug error - help please

    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
    Name:  Admin-Configuration-Editable-Centerboxes.jpg
Views: 169
Size:  27.3 KB
    Last edited by shags38; 18 Jun 2023 at 05:18 AM.

  2. #2
    Join Date
    Feb 2006
    Location
    Tampa Bay, Florida
    Posts
    9,765
    Plugin Contributions
    124

    Default Re: Middleboxes myDebug error - help please

    These defines should be set in
    ./includes/languages/english/extra_definitions/your_template/middlebox_defines.php

    Because this path didn't use the token used elsewhere (YOUR_RESPONSIVE_TEMPLATE), perhaps you forgot to properly place it?
    i.e. this should have been installed as

    ./includes/languages/english/extra_definitions/responsive_classic_1/middlebox_defines.php

    since you are using template responsive_classic_1.
    That Software Guy. My Store: Zen Cart Support
    Available for hire - See my ad in Services
    Plugin Moderator, Documentation Curator, Chief Cook and Bottle-Washer.
    Do you benefit from Zen Cart? Then please support the project.

  3. #3
    Join Date
    Jan 2011
    Location
    Adelaide, Australia
    Posts
    1,670
    Plugin Contributions
    1

    Default Re: Middleboxes myDebug error - help please

    Many thanks for that Scott - I should have picked up on it - a bit confusing with the _1 version of the template.

    thanks again,
    Mike

  4. #4
    Join Date
    Feb 2006
    Location
    Tampa Bay, Florida
    Posts
    9,765
    Plugin Contributions
    124

    Default Re: Middleboxes myDebug error - help please

    Perhaps you'd like to adopt the plugin https://www.zen-cart.com/downloads.php?do=file&id=1069 and give it some love, fixing issues like this and whatever else you have found? It hasn't been touched in a long time.
    That Software Guy. My Store: Zen Cart Support
    Available for hire - See my ad in Services
    Plugin Moderator, Documentation Curator, Chief Cook and Bottle-Washer.
    Do you benefit from Zen Cart? Then please support the project.

  5. #5
    Join Date
    Jan 2011
    Location
    Adelaide, Australia
    Posts
    1,670
    Plugin Contributions
    1

    Default Re: Middleboxes myDebug error - help please

    Quote Originally Posted by swguy View Post
    Perhaps you'd like to adopt the plugin https://www.zen-cart.com/downloads.php?do=file&id=1069 and give it some love, fixing issues like this and whatever else you have found? It hasn't been touched in a long time.
    I do not have enough coding expertise to 'adopt' the plugin however I will add the thread to my list so that I get all posts and if I can answer the issue I will certainly do so and if I can't I will default to you or mc123456789

    cheers, Mike

 

 

Similar Threads

  1. v155 myDEBUG error after installing a plugin - help Please
    By shags38 in forum General Questions
    Replies: 3
    Last Post: 18 Apr 2021, 11:36 PM
  2. v155 error myDebug - Adavanced Search
    By shags38 in forum General Questions
    Replies: 2
    Last Post: 7 Dec 2019, 05:38 PM
  3. Replies: 6
    Last Post: 8 Oct 2019, 02:30 PM
  4. Replies: 4
    Last Post: 19 Jan 2013, 05:47 AM
  5. Deciphering MyDEBUG error
    By jgold723 in forum General Questions
    Replies: 2
    Last Post: 26 Mar 2012, 09:07 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR