Thread: Missing Code

Results 1 to 4 of 4
  1. #1
    Join Date
    Mar 2007
    Location
    Cornwall - uk
    Posts
    464
    Plugin Contributions
    0

    Default Missing Code

    Some how I have managed to delete a bit of a line of code in tpl_index_categories.php im getting this error message when I try to go into category pages. Parse error: syntax error, unexpected T_STRING in /home/bodykits/public_html/shop/includes/templates/template_default/templates/tpl_index_categories.php on line 35

    I believe this is line 35 <div id="indexCategoriesMainContent" class="content"><?php>

    Can anyone see an obvious bit of missing code.

    Thanks
    Last edited by ben harry; 21 Jul 2007 at 04:07 PM.

  2. #2
    Join Date
    Mar 2007
    Location
    Cornwall - uk
    Posts
    464
    Plugin Contributions
    0

    Default Re: Missing Code

    Ive spent ages trying to find the error, this is my complete file.

    <?php
    /**
    * Page Template
    *
    * Loaded by main_page=index<br />
    * Displays category/sub-category listing<br />
    * Uses tpl_index_category_row.php to render individual items
    *
    * @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_index_categories.php 4329 2006-08-31 17:01:11Z ajeh $
    */
    ?>
    <div class="centerColumn" id="indexCategories">
    <?php if ($show_welcome == true) { ?>
    id="indexCategoriesHeading"><?php echo HEADING_TITLE; ?>
    <?php if (SHOW_CUSTOMER_GREETING == 1) { ?>
    <h2 class="greeting"><?php echo zen_customer_greeting(); ?></h2>
    <?php } ?>
    <!-- deprecated - to use - uncomment
    <?php if (TEXT_MAIN) { ?>
    <div id="" class="content"><?php echo TEXT_MAIN; ?></div>
    <?php } ?>-->
    <!-- deprecated - to use - uncomment
    <?php if (TEXT_INFORMATION) { ?>
    <div id="" class="content"><?php echo TEXT_INFORMATION; ?></div>
    <?php } ?>-->
    <?php if (DEFINE_MAIN_PAGE_STATUS >= 1 and DEFINE_MAIN_PAGE_STATUS
    <div id="indexCategoriesMainContent" class="content"><?php
    <= 2) { ?>
    /**
    * require the html_define for the index/categories page
    */
    include($define_page);
    ?></div>
    <?php } ?>
    <?php } else { ?>
    <h1 id="indexCategoriesHeading"><?php echo $breadcrumb->last(); ?></h1>
    <?php } ?>
    <?php
    if (PRODUCT_LIST_CATEGORIES_IMAGE_STATUS_TOP == 'true') {
    // categories_image
    if ($categories_image = zen_get_categories_image($current_category_id)) {
    ?>
    <div id="categoryImgListing" class="categoryImg"><?php echo zen_image(DIR_WS_IMAGES . $categories_image); ?></div>
    <?php
    }
    } // categories_image
    ?>
    <?php
    // categories_description
    if ($current_categories_description != '') {
    ?>
    <div id="categoryDescription" class="catDescContent"><?php echo $current_categories_description; ?></div>
    <?php } // categories_description ?>
    <!-- BOF: Display grid of available sub-categories, if any -->
    <?php
    /**
    * require the code to display the sub-categories-grid, if any exist
    */
    require($template->get_template_dir('tpl_modules_category_row.php',DIR_WS_TEMPLATE, $current_page_base,'templates'). '/tpl_modules_category_row.php');
    ?>
    <!-- EOF: Display grid of available sub-categories -->
    <?php
    $show_display_category = $db->Execute(SQL_SHOW_PRODUCT_INFO_CATEGORY);
    while (!$show_display_category->EOF) {
    // // echo 'I found ' . zen_get_module_directory(FILENAME_UPCOMING_PRODUCTS);
    ?>
    <?php if ($show_display_category->fields['configuration_key'] == 'SHOW_PRODUCT_INFO_CATEGORY_FEATURED_PRODUCTS') { ?>
    <?php
    /**
    * display the Featured Products Center Box
    */
    ?>
    <?php require($template->get_template_dir('tpl_modules_featured_products.php',DIR_WS_TEMPLATE, $current_page_base,'templates'). '/tpl_modules_featured_products.php'); ?>
    <?php } ?>
    <?php if ($show_display_category->fields['configuration_key'] == 'SHOW_PRODUCT_INFO_CATEGORY_SPECIALS_PRODUCTS') { ?>
    <?php
    /**
    * display the Special Products Center Box
    */
    ?>
    <?php require($template->get_template_dir('tpl_modules_specials_default.php',DIR_WS_TEMPLATE, $current_page_base,'templates'). '/tpl_modules_specials_default.php'); ?>
    <?php } ?>
    <?php if ($show_display_category->fields['configuration_key'] == 'SHOW_PRODUCT_INFO_CATEGORY_NEW_PRODUCTS') { ?>
    <?php
    /**
    * display the New Products Center Box
    */
    ?>
    <?php require($template->get_template_dir('tpl_modules_whats_new.php',DIR_WS_TEMPLATE, $current_page_base,'templates'). '/tpl_modules_whats_new.php'); ?>
    <?php } ?>
    <?php if ($show_display_category->fields['configuration_key'] == 'SHOW_PRODUCT_INFO_CATEGORY_UPCOMING') { ?>
    <?php include(DIR_WS_MODULES . zen_get_module_directory(FILENAME_UPCOMING_PRODUCTS)); ?><?php } ?>
    <?php
    $show_display_category->MoveNext();
    } // !EOF
    ?>
    </div>

    Hopefully someone can spot the error.

    Thanks

    ben

  3. #3
    Join Date
    Jul 2005
    Location
    Upstate NY
    Posts
    22,010
    Plugin Contributions
    25

    Default Re: Missing Code

    Frequently when you see an error referencing a line number, the problem is on the previous line, and the referenced line is what finds the error.
    PHP Code:
    <?php if (DEFINE_MAIN_PAGE_STATUS >= and DEFINE_MAIN_PAGE_STATUS
    <div id="indexCategoriesMainContent" class="content"><?php
    <= 2) { ?>
    /**
    * require the html_define for the index/categories page
    */
    A stock copy looks like this:
    PHP Code:
    <?php if (DEFINE_MAIN_PAGE_STATUS >= and DEFINE_MAIN_PAGE_STATUS <= 2) { ?>
    <div id="indexCategoriesMainContent" class="content"><?php
    /**
     * require the html_define for the index/categories page
     */
    This is a good example of why you should never touch files while they are in /template_default/, but copy them to /your_template/ for editing. You would still have your own backup handy.
    Last edited by gjh42; 21 Jul 2007 at 06:04 PM.

  4. #4
    Join Date
    Mar 2007
    Location
    Cornwall - uk
    Posts
    464
    Plugin Contributions
    0

    Default Re: Missing Code

    Thanks for replying, and spending the time to put the stock file in for me. I made the changes and all is working fine now.

    Thank you

    Ben
    Last edited by ben harry; 21 Jul 2007 at 06:45 PM.

 

 

Similar Threads

  1. source code PHP missing
    By Carla in forum General Questions
    Replies: 2
    Last Post: 5 Jan 2009, 05:09 AM
  2. (Not a bug) Maybe missing a code?
    By travel124 in forum Bug Reports
    Replies: 1
    Last Post: 26 Apr 2008, 06:24 PM
  3. Missing code in Home page
    By VGP in forum Installing on a Mac Server
    Replies: 4
    Last Post: 9 Feb 2007, 05:14 PM

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