Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Altering index/first page text


sallypointer

Recommended Posts

After my disaterous attempts to load oscommerce last week I changed server, and hooray, I now have it all installed. I was just starting to set up the store, and I was trying to follow the instructions to change the text on the front page. I started by changing the permissions to 777 as that was the only thing that let me alter anything, then very tentatively changed just teh first few words that were indicated in green to 'welcome to my shop' , clicked save and got this message

Parse error: syntax error, unexpected T_STRING in /home/ymneovjf/public_html/shop/includes/languages/english/index.php on line 13

 

what have I done wrong, and how do I fix it!

Link to comment
Share on other sites

Oh no, I think I've made it worse.

Is there a page anywhere that shows me just what 'has' to be on this page and indicates clearly where I put the text I want to put in? I think I've scrambled this really badly so I need effectvely to copy and paste in a fresh version and start again.

 

For the moment I was going to run with the default template so all I'm trying to do is change the text to read 'Welcome to our new shop..ramble ramble...bear with us whilst we get sorted we'll be adding lots more stock over the next few days...' but I have no idea what is and isnt meant to be in my mess now.

 

This is what I have left of the coding:

 

<?php

/*

$Id: index.php,v 1.1 2003/06/11 17:38:00 hpdl Exp $

 

osCommerce, Open Source E-Commerce Solutions

http://www.oscommerce.com

 

Copyright © 2003 osCommerce

 

Released under the GNU General Public License

*/

 

:<br><br><nobr>define(\'TEXT_MAIN\', \'\');</nobr><br><br>target="_blank"><u>here</u></a>.</td></tr><tr><td class="main" valign="top">' . tep_image(DIR_WS_IMAGES . 'default/3.gif') . '</td><td class="main" valign="top"><b>Securing The Administration Tool</b><br><br>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') || (isset($HTTP_GET_VARS['manufacturers_id'])) ) {

define('HEADING_TITLE', 'Let\'s See What We Have Here');

define('TABLE_HEADING_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', '<b>Show:</b>');

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') {

define('HEADING_TITLE', 'What\'s New Here?');

} elseif ($category_depth == 'nested') {

define('HEADING_TITLE', 'Categories');

}

?>

Link to comment
Share on other sites

Go to this page and scroll to the bottom for a clean index.php file, copy and paste that into yours. ...hmm not all the way to the bottom, read the post to make sure you copy/paste the correct file ;)

 

http://www.oscommerce.com/forums/index.php?showtopic=213353&hl=

 

It's much safer to keep a backup copy of each file as you modify it, so you don't have to worry...you always have the 'undo' copy that way :thumbsup:

 

Are you editing with front page or something? A true plain text editor is much safer. There are a lot of free ones available online, some especially suited for php. My preference is php designer 2005 (it's free).

 

for that line that was giving you trouble,

 

define('TEXT_MAIN', 'test');

 

what I have pasted would simply put the word test on the page

 

If you have apostrophes in your text, they need to be escaped with a backslash \' like that

 

can't ...will cause a parse error

can\'t ...no parse error

 

There is one in your text, i've escaped it below

 

Welcome to our new shop..ramble ramble...bear with us whilst we get sorted we\'ll be adding lots more stock over the next few days...

 

Oh no, I think I've made it worse.

Is there a page anywhere that shows me just what 'has' to be on this page and indicates clearly where I put the text I want to put in? I think I've scrambled this really badly so I need effectvely to copy and paste in a fresh version and start again.

 

For the moment I was going to run with the default template so all I'm trying to do is change the text to read 'Welcome to our new shop..ramble ramble...bear with us whilst we get sorted we'll be adding lots more stock over the next few days...' but I have no idea what is and isnt meant to be in my mess now.

 

This is what I have left of the coding:

 

<?php

/*

$Id: index.php,v 1.1 2003/06/11 17:38:00 hpdl Exp $

 

osCommerce, Open Source E-Commerce Solutions

http://www.oscommerce.com

 

Copyright ? 2003 osCommerce

 

Released under the GNU General Public License

*/

 

:<br><br><nobr>define(\'TEXT_MAIN\', \'\');</nobr><br><br>target="_blank"><u>here</u></a>.</td></tr><tr><td class="main" valign="top">' . tep_image(DIR_WS_IMAGES . 'default/3.gif') . '</td><td class="main" valign="top"><b>Securing The Administration Tool</b><br><br>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') || (isset($HTTP_GET_VARS['manufacturers_id'])) ) {

define('HEADING_TITLE', 'Let\'s See What We Have Here');

define('TABLE_HEADING_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', '<b>Show:</b>');

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') {

define('HEADING_TITLE', 'What\'s New Here?');

} elseif ($category_depth == 'nested') {

define('HEADING_TITLE', 'Categories');

}

?>

Link to comment
Share on other sites

If you have apostrophes in your text, they need to be escaped with a backslash \' like that

 

can't ...will cause a parse error

can\'t ...no parse error

 

There is one in your text, i've escaped it below

 

Welcome to our new shop..ramble ramble...bear with us whilst we get sorted we\'ll be adding lots more stock over the next few days...

 

Aha, thats amazingly helpful! I would never have worked out the apostrophe thing by myself. Many thanks

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...