Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Editing the main index.php


fldrummer

Recommended Posts

I went into file mananger then to includes/languages/english opened the index.php in the file mamanger and I could only copy the file so I copied it and used notepad and changed the text. I did not change any php stuff. Then I put it in viz ftp program then I get this

 

Parse error: parse error, unexpected T_STRING in /home/riversp/public_html/test/os/includes/languages/english/index.php on line 13

 

What can I do to edit the main index file? Sorry if this sounds dumb. :ph34r:

Link to comment
Share on other sites

I am not sure... But I used to get a lot of those erros with PHP... I think when you changed something maybe you added a " double quotes or ' single quotes and that messed up the php... try again and make sure you don't change the php.. it would be good if you could show us the line from where the error is coming from

Link to comment
Share on other sites

You will have used the online file manager to edit the code and this has removed \ backslashes from the code. It is a known issue with the use of the online file manager to edit code therefore it is better to use an ftp program to download the file and edit offline then ftp upload to the server thus avoiding the parse error caused by the online file manager removing \ backslashes from the code

 

these lines will require the backslash placed back into the code, however it may just be easier to edit a copy of the file offline and then upload this edited file to replace your now corrupt file

 

here is a clean copy of the file with the original text removed ready for your own text to be added

 

<?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 (c) 2003 osCommerce

 Released under the GNU General Public License
*/

define('TEXT_MAIN', '');
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');
}
?>

No longer giving free advice. Please place deposit in meter slot provided.  Individual: [=] SME: [==] Corporation: [===]
If deposit does not fit one of the slots provided then you are asking too much! :P

Is your Osc dated try Phoenix  raising oscommerce from the ashes.

Link to comment
Share on other sites

Steve,

 

Thanks for the original code, it helped alot. Here is the problem...any time I insert anything into the TEXT_MAIN part, everything changes... Instead of there being nothing where TEXT_MAIN should be, it actually says TEXT_MAIN and it also says: Heading_Title, TABLE_HEADING_UPCOMING_PRODUCTS, and TABLE_HEADING_DATE_EXPECTED in their respective places on the page... all simply by saying:

 

define('TEXT_MAIN', 'Hi');

 

why?

 

Please help

Link to comment
Share on other sites

This was happening to me as well. I wasn't making changes to the code either!

 

As Steve said, the online file manager removes the escape character (the backslashes) at times. FTPing also was unreliable at times for me. It took persistance...sometimes trying them (online manager or ftping or my solution following) one at a time in secession before any changes "stuck". My other solution was copying to my text editor, making changes then copy/pasting it back into the online file manager again and then saving. For some reason, this is what works for me most often. Also, I've noticed that the online file manage adds escape characters. :huh: Those were usually my problems - a missing or added backslash... Just keep checking those particular lines where it says there is an error and making the changes and eventually everything seems to work...at least that's my experience. :rolleyes:

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...