Page 1 of 2 12 LastLast
Results 1 to 10 of 11
  1. #1
    Join Date
    Oct 2006
    Location
    Westland, New Zealand
    Posts
    7
    Plugin Contributions
    0

    Default Parse error: syntax error, unexpected T_STRING

    A proverbial newbie here. I have successfullymanaged to get my Zen Cart functioning, but have a problem I have searched everywhere for,(Forums and Wiki) and I can't find out where I have gone wrong.
    The error message is as follows: Parse error: syntax error, unexpected T_STRING in /home/librsco/public_html/zen-cart-full/includes/languages/english/index.php on line 33

    The file is as follows:<?php
    /**
    * @package languageDefines
    * @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: index.php 3027 2006-02-13 17:15:51Z drbyte $
    */

    define('TEXT_MAIN','This is the main define statement for the page for english when no template defined file exists. It is located in: <strong>/includes/languages/english/index.php</strong>');

    // Showcase vs Store
    if (STORE_STATUS == '0') {
    define('TEXT_GREETING_GUEST', 'Welcome <span class="greetUser">Guest!</span> Would you like to <a href="%s">log yourself in</a>?');
    } else {
    define('TEXT_GREETING_GUEST', 'Welcome, please enjoy our online showcase.');
    }

    define('TEXT_GREETING_PERSONAL', 'Hello <span class="greetUser">%s</span>! Would you like to see our <a href="%s">newest additions</a>?');

    define('TEXT_INFORMATION', '<p><u>BOOK CONDITION</u></u>

    I attempt to describe all my books accurately and err on the safe side so you will be pleasantly surprised rather than disappointed when you receive your purchase.<br> If you require further description, or a digital image, please email me with your request.

    <br> Below is a list of the descriptors I use and their meaning:

    <br><ul><u>Fine</u></ul> - In the same condition as when it came off the presses. Very rarely used.

    <br><ul><u>Very Good</u></ul> - May have light reading wear, such as slight bumps to the corners of the cover, but looks almost like new.

    <br><ul><u>Good</u></ul> - Standard used book that has clearly been read. May have creasing to the spine, pages that have been bent at the corners, or reading creases to the cover. Major flaws such as book store stamps will be described. Always tightly bound and with clean text.

    <br><ul><u>Fair</u></ul> - Fair books are well-used copies which are structurally sound and legible, but not necessarily attractive. Books may have foxing and age spotting, where the pages are browning with age. Store stamps and previous owner's details on front end pages are common flaws. If there are major flaws they will be described, otherwise the book is likely to be well-read and aged.

    <br><ul><u>Poor</u></ul> - These books are on their last legs. All pages are present and legible, but binding may be loose, end pages may have tears, or there may be water stains.');

    //moved to english
    //define('TABLE_HEADING_FEATURED_PRODUCTS','Featured Products');

    //define('TABLE_HEADING_NEW_PRODUCTS', 'New Products For %s');
    //define('TABLE_HEADING_UPCOMING_PRODUCTS', 'Upcoming Products');
    //define('TABLE_HEADING_DATE_EXPECTED', 'Date Expected');

    if ( ($category_depth == 'products') || (zen_check_url_get_terms()) ) {
    // This section deals with product-listing page contents
    define('HEADING_TITLE', 'Available Products');
    define('TABLE_HEADING_IMAGE', 'Product Image');
    define('TABLE_HEADING_MODEL', 'Model');
    define('TABLE_HEADING_PRODUCTS', 'Product Name');
    define('TABLE_HEADING_MANUFACTURER', 'Manufacturer');
    define('TABLE_HEADING_QUANTITY', 'Quantity');
    define('TABLE_HEADING_PRICE', 'Price');
    define('TABLE_HEADING_WEIGHT', 'Weight');
    define('TABLE_HEADING_BUY_NOW', 'Buy Now');
    define('TEXT_NO_PRODUCTS', 'There are no products to list in this category.');
    define('TEXT_NO_PRODUCTS2', 'There is no product available from this manufacturer.');
    define('TEXT_NUMBER_OF_PRODUCTS', 'Number of Products: ');
    define('TEXT_SHOW', 'Filter Results by:');
    define('TEXT_BUY', 'Buy 1 \'');
    define('TEXT_NOW', '\' now');
    define('TEXT_ALL_CATEGORIES', 'All Categories');
    define('TEXT_ALL_MANUFACTURERS', 'All Manufacturers');
    } elseif ($category_depth == 'top') {
    // This section deals with the "home" page at the top level with no options/products selected
    /*Replace this text with the headline you would like for your shop. For example: 'Welcome to My SHOP!'*/
    define('HEADING_TITLE', 'Welcome to Libris Books.');
    } elseif ($category_depth == 'nested') {
    // This section deals with displaying a subcategory
    /*Replace this line with the headline you would like for your shop. For example: 'Welcome to My SHOP!'*/
    define('HEADING_TITLE', '; We have a great range of secondhand books, music & collectibles.');
    }
    ?>


    I have a very basic understanding of what I am doing, I thought I had followed all the rules exactly, but I can't for the life of me, solve this one. Is there anyone who can help?
    Many thanks in anticipation.
    SSB

  2. #2
    Join Date
    Aug 2006
    Location
    Canada
    Posts
    1,029
    Plugin Contributions
    5

    Default Re: Parse error: syntax error, unexpected T_STRING

    Looks like this line may be causing woe... define('TEXT_BUY', 'Buy 1 \'');

    There is an extra quote mark( ' ...highlighted in red) .


    Also, this line is suspect... define('HEADING_TITLE', '; We have a great range of secondhand books, music & collectibles.');

    The part hightlighted in red is another error in the making.
    Last edited by Sketchy; 12 Oct 2006 at 03:04 AM.

  3. #3
    Join Date
    Oct 2006
    Location
    Westland, New Zealand
    Posts
    7
    Plugin Contributions
    0

    Default Re: Parse error: syntax error, unexpected T_STRING

    Thanks Sketchy,
    I have fixed both your suggestions, but I am still getting the same response. I have doubled checked for any other errors like that and can't see any.
    Thanks for your reply.
    SSB

  4. #4
    Join Date
    Aug 2006
    Location
    Canada
    Posts
    1,029
    Plugin Contributions
    5

    Default Re: Parse error: syntax error, unexpected T_STRING

    Okay, I've downloaded yours and I'm using WinMerge....

    So, far... I'm wrong with the line... define('TEXT_BUY', 'Buy 1 \'');
    It's supposed to be that way apparently, sorry.

    Oh... as for the second one, it should be... define('HEADING_TITLE', 'We have a great range of secondhand books, music & collectibles.');

    `Only that extra semi-colon needs omitting. Sorry not to be clear on that.

    I'll see what else I can come up with.
    Last edited by Sketchy; 12 Oct 2006 at 03:27 AM.

  5. #5
    Join Date
    Oct 2006
    Location
    Westland, New Zealand
    Posts
    7
    Plugin Contributions
    0

    Default Re: Parse error: syntax error, unexpected T_STRING

    OK Sketchy, I have fixed both of those. Still no joy, the exact same message is coming up.
    The file now reads:
    <?php
    /**
    * @package languageDefines
    * @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: index.php 3027 2006-02-13 17:15:51Z drbyte $
    */

    define('TEXT_MAIN','This is the main define statement for the page for english when no template defined file exists. It is located in: <strong>/includes/languages/english/index.php</strong>');

    // Showcase vs Store
    if (STORE_STATUS == '0') {
    define('TEXT_GREETING_GUEST', 'Welcome <span class="greetUser">Guest!</span> Would you like to <a href="%s">log yourself in</a>?');
    } else {
    define('TEXT_GREETING_GUEST', 'Welcome, please enjoy our online showcase.');
    }

    define('TEXT_GREETING_PERSONAL', 'Hello <span class="greetUser">%s</span>! Would you like to see our <a href="%s">newest additions</a>?');

    define('TEXT_INFORMATION', '<p><u>BOOK CONDITION</u></u>

    I attempt to describe all my books accurately and err on the safe side so you will be pleasantly surprised rather than disappointed when you receive your purchase.<br> If you require further description, or a digital image, please email me with your request.

    <br> Below is a list of the descriptors I use and their meaning:

    <br><ul><u>Fine</u></ul> - In the same condition as when it came off the presses. Very rarely used.

    <br><ul><u>Very Good</u></ul> - May have light reading wear, such as slight bumps to the corners of the cover, but looks almost like new.

    <br><ul><u>Good</u></ul> - Standard used book that has clearly been read. May have creasing to the spine, pages that have been bent at the corners, or reading creases to the cover. Major flaws such as book store stamps will be described. Always tightly bound and with clean text.

    <br><ul><u>Fair</u></ul> - Fair books are well-used copies which are structurally sound and legible, but not necessarily attractive. Books may have foxing and age spotting, where the pages are browning with age. Store stamps and previous owner's details on front end pages are common flaws. If there are major flaws they will be described, otherwise the book is likely to be well-read and aged.

    <br><ul><u>Poor</u></ul> - These books are on their last legs. All pages are present and legible, but binding may be loose, end pages may have tears, or there may be water stains.');

    //moved to english
    //define('TABLE_HEADING_FEATURED_PRODUCTS','Featured Products');

    //define('TABLE_HEADING_NEW_PRODUCTS', 'New Products For %s');
    //define('TABLE_HEADING_UPCOMING_PRODUCTS', 'Upcoming Products');
    //define('TABLE_HEADING_DATE_EXPECTED', 'Date Expected');

    if ( ($category_depth == 'products') || (zen_check_url_get_terms()) ) {
    // This section deals with product-listing page contents
    define('HEADING_TITLE', 'Available Products');
    define('TABLE_HEADING_IMAGE', 'Product Image');
    define('TABLE_HEADING_MODEL', 'Model');
    define('TABLE_HEADING_PRODUCTS', 'Product Name');
    define('TABLE_HEADING_MANUFACTURER', 'Manufacturer');
    define('TABLE_HEADING_QUANTITY', 'Quantity');
    define('TABLE_HEADING_PRICE', 'Price');
    define('TABLE_HEADING_WEIGHT', 'Weight');
    define('TABLE_HEADING_BUY_NOW', 'Buy Now');
    define('TEXT_NO_PRODUCTS', 'There are no products to list in this category.');
    define('TEXT_NO_PRODUCTS2', 'There is no product available from this manufacturer.');
    define('TEXT_NUMBER_OF_PRODUCTS', 'Number of Products:');
    define('TEXT_SHOW', 'Filter Results by:');
    define('TEXT_BUY', 'Buy 1 \'');
    define('TEXT_NOW', '\' now');
    define('TEXT_ALL_CATEGORIES', 'All Categories');
    define('TEXT_ALL_MANUFACTURERS', 'All Manufacturers');
    } elseif ($category_depth == 'top') {
    // This section deals with the "home" page at the top level with no options/products selected
    /*Replace this text with the headline you would like for your shop. For example: 'Welcome to My SHOP!'*/
    define('HEADING_TITLE', 'Welcome to Libris Books.');
    } elseif ($category_depth == 'nested') {
    // This section deals with displaying a subcategory
    /*Replace this line with the headline you would like for your shop. For example: 'Welcome to My SHOP!'*/
    define('HEADING_TITLE', 'We have a great range of secondhand books, music & collectibles.');
    }
    ?>


    I appreciate your time.
    SSB

  6. #6
    Join Date
    Aug 2006
    Location
    Canada
    Posts
    1,029
    Plugin Contributions
    5

    Default Re: Parse error: syntax error, unexpected T_STRING

    If all else fails, back up the file and omit your custom front page text... I'm not sure of the nature of the CSS tags in there, I've never attempted anything like that into the index.php . But, I'm suspicious that those may be the main root of the error.

  7. #7
    Join Date
    Oct 2006
    Location
    Westland, New Zealand
    Posts
    7
    Plugin Contributions
    0

    Default Re: Parse error: syntax error, unexpected T_STRING

    Will do, Sketchy, many thanks for your help. I will post back when I discover the problem. Many thanks for your time.
    SSB

  8. #8
    Join Date
    Oct 2006
    Location
    Westland, New Zealand
    Posts
    7
    Plugin Contributions
    0

    Default Re: Parse error: syntax error, unexpected T_STRING

    OK Sketchy, I took all of my added text out and now it works fine. Obviously something wrong with my text editing!!
    I will know in the future to go back and do exactly as you said. Many, many thanks for your help.
    See you later.
    SSB

  9. #9
    Join Date
    Jan 2004
    Posts
    66,373
    Blog Entries
    7
    Plugin Contributions
    274

    Default Re: Parse error: syntax error, unexpected T_STRING

    Code:
    Store stamps and previous owner's details
    The ' in owner's should be ESCaped with a \ like this: owner\'s
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  10. #10
    Join Date
    Aug 2006
    Location
    Canada
    Posts
    1,029
    Plugin Contributions
    5

    Default Re: Parse error: syntax error, unexpected T_STRING

    You're welcome.

    I've been wasting your time though. Sheesh... I'm so dense sometimes. All you have to do is remove the possessive form of "owner's" in your custom text. Sorry, about the wild goose chase. PHP doesn't like those and I should know better, but now you know as well.

    ..."previous owner details on front" That will work.

    Edit: Yeah, what Dr. Byte said.

 

 
Page 1 of 2 12 LastLast

Similar Threads

  1. PHP Parse error: syntax error, unexpected T_STRING
    By derek53 in forum Templates, Stylesheets, Page Layout
    Replies: 3
    Last Post: 11 Apr 2011, 08:09 PM
  2. Replies: 20
    Last Post: 21 Nov 2010, 02:48 AM
  3. Replies: 9
    Last Post: 5 Feb 2010, 01:12 AM
  4. Replies: 8
    Last Post: 5 Mar 2009, 06:40 PM
  5. Replies: 6
    Last Post: 21 Sep 2008, 04:48 AM

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