Forum Moderators: coopster

Message Too Old, No Replies

osC store gone, t-string error message

please help!

         

Dirndl

9:47 pm on Aug 10, 2005 (gmt 0)

10+ Year Member



This is the error message i get on my osC store page:

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

Here is line 13 of my index file:

define('TEXT_MAIN', 'This is a default setup of the osCommerce project, products shown are for demonstrational purposes, <b>any products purchased will not be delivered nor will the customer be billed</b>. Any information seen on these products is to be treated as fictional.<br><br><table border="0" width="100%" cellspacing="5" cellpadding="2"><tr><td class="main" valign="top">' . tep_image(DIR_WS_IMAGES . 'default/1.gif') . '</td><td class="main" valign="top"><b>Error Messages</b><br><br>If there are any error or warning messages shown above, please correct them first before proceeding.<br><br>Error messages are displayed at the very top of the page with a complete <span class="messageStackError">background</span> color.<br><br>Several checks are performed to ensure a healthy setup of your online store - these checks can be disabled by editing the appropriate parameters at the bottom of the includes/application_top.php file.</td></tr><td class="main" valign="top">' . tep_image(DIR_WS_IMAGES . 'default/2.gif') . '</td><td class="main" valign="top"><b>Editing Page Texts</b><br><br>The text shown here can be modified in the following file, on each language basis:<br><br><nobr class="messageStackSuccess">[path to catalog]/includes/languages/' . $language . '/' . FILENAME_DEFAULT . '</nobr><br><br>That file can be edited manually, or via the Administration Tool with the <nobr class="messageStackSuccess">Languages->' . ucfirst($language) . '->Define</nobr> or <nobr class="messageStackSuccess">Tools->File Manager</nobr> modules.<br><br>The text is set in the following manner:<br><br><nobr>define('TEXT_MAIN', '<span class="messageStackSuccess">This is a default setup of the osCommerce project...</span>');</nobr><br><br>The text highlighted in green may be modified - it is important to keep the define() of the TEXT_MAIN keyword. To remove the text for TEXT_MAIN completely, the following example is used where only two single quote characters exist:<br><br><nobr>define('TEXT_MAIN', '');</nobr><br><br>More information concerning the PHP define() function can be read <a href="http://www.php.net/define" 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>It is important to secure the Administration Tool as there is currently no security implementation available.</td></tr><tr><td class="main" valign="top">' . tep_image(DIR_WS_IMAGES . 'default/4.gif') . '</td><td class="main" valign="top"><b>Online Documentation</b><br><br>Online documentation can be read at the <a href="http://wiki.oscommerce.com" target="_blank"><u>osCommerce Wiki Documentation Effort</u></a> site.<br><br>Community support is available at the <a href="http://forums.oscommerce.com" target="_blank"><u>osCommerce Community Support Forums</u></a> site.</td></tr></table><br>If you wish to download the solution powering this shop, or if you wish to contribute to the osCommerce project, please visit the <a href="http://www.oscommerce.com" target="_blank"><u>support site of osCommerce</u></a>. This shop is running on osCommerce version <font color="#f0000"><b>' . PROJECT_VERSION . '</b></font>.');

What is a t_string (in the world of .php)?
Please help.
Thank you so much!
dirndl

sned

11:28 pm on Aug 10, 2005 (gmt 0)

10+ Year Member



Hello, a few lines down in the string, you have this:

define('TEXT_MAIN', '<span class="messageStackSuccess">...

and you have it again a couple of lines later. The ' needs to be escaped :

define(\'TEXT_MAIN\', \'<span class="messageStackSuccess">..., and you need to do that for all ' within the main define statement.

-sned

Dirndl

12:25 am on Aug 11, 2005 (gmt 0)

10+ Year Member



Thank you so much for your respond, sned!

I made the changes but it gave me more error messages then before. I also tried to do it in stages to find out which ones gave what errors.

Can you please tell me in idiot save detail where I need to insert the \

Thank you again, I will be forever grateful!

Dany

jatar_k

1:47 am on Aug 11, 2005 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



actually I was thinking it was here

<br><br>The text is set in the following manner:<br><br><nobr>define('TEXT_MAIN', '<span class="messageStackSuccess">This is a default setup of the osCommerce project...</span>');</nobr><br><br>The text highlighted in green may be modified

it looks like that define was added right in but improperly. I was thinking to change that chunk to this

<br><br>The text is set in the following manner:<br><br><nobr>' . define('TEXT_MAIN', '<span class="messageStackSuccess">This is a default setup of the osCommerce project...</span>') . '</nobr><br><br>The text highlighted in green may be modified

madmac

4:45 pm on Aug 11, 2005 (gmt 0)

10+ Year Member



>> it looks like that define was added right in but improperly. I was thinking to change that chunk to this

Actually, if you read his text, he is showing how one can change it. So the define inside the other define should be printed as text.

>> Can you please tell me in idiot save detail where I need to insert the \

In simple terms, you need to escape single quotes if they are inside of single quotes, and double quotes if they are inside of double quotes. You "escape" them with a \

Example:

define('MY_CONSTANT', 'Place some text here, and don\'t forget to escape single quotes');
define('MY_CONSTANT', "Place \"some text here\", and don't forget to escape double quotes");

So then, your code needs to be (I had BBEdit break it into lines to make editing easier):

define('TEXT_MAIN', 'This is a default setup of the osCommerce project,
products shown are for demonstrational purposes, <b>any products purchased will
not be delivered nor will the customer be billed</b>. Any information seen on
these products is to be treated as fictional.<br><br><table border="0"
width="100%" cellspacing="5" cellpadding="2"><tr><td class="main" valign="top">'
. tep_image(DIR_WS_IMAGES . 'default/1.gif') . '</td><td class="main"
valign="top"><b>Error Messages</b><br><br>If there are any error or warning
messages shown above, please correct them first before proceeding.<br><br>Error
messages are displayed at the very top of the page with a complete <span
class="messageStackError">background</span> color.<br><br>Several checks are
performed to ensure a healthy setup of your online store - these checks can be
disabled by editing the appropriate parameters at the bottom of the
includes/application_top.php file.</td></tr><td class="main" valign="top">' .
tep_image(DIR_WS_IMAGES . 'default/2.gif') . '</td><td class="main"
valign="top"><b>Editing Page Texts</b><br><br>The text shown here can be
modified in the following file, on each language basis:<br><br><nobr
class="messageStackSuccess">[path to catalog]/includes/languages/' . $language .
'/' . FILENAME_DEFAULT . '</nobr><br><br>That file can be edited manually, or
via the Administration Tool with the <nobr
class="messageStackSuccess">Languages->' . ucfirst($language) . '->Define</nobr>
or <nobr class="messageStackSuccess">Tools->File Manager</nobr>
modules.<br><br>The text is set in the following
manner:<br><br><nobr>define(\'TEXT_MAIN\', \'<span class="messageStackSuccess">This
is a default setup of the osCommerce project...</span>\');</nobr><br><br>The text
highlighted in green may be modified - it is important to keep the define() of
the TEXT_MAIN keyword. To remove the text for TEXT_MAIN completely, the
following example is used where only two single quote characters
exist:<br><br><nobr>define(\'TEXT_MAIN\', \'\');</nobr><br><br>More information
concerning the PHP define() function can be read <a
href="http://www.php.net/define"
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>It is important to
secure the Administration Tool as there is currently no security implementation
available.</td></tr><tr><td class="main" valign="top">' .
tep_image(DIR_WS_IMAGES . 'default/4.gif') . '</td><td class="main"
valign="top"><b>Online Documentation</b><br><br>Online documentation can be read
at the <a href="http://wiki.oscommerce.com" target="_blank"><u>osCommerce Wiki
Documentation Effort</u></a> site.<br><br>Community support is available at the
<a href="http://forums.oscommerce.com" target="_blank"><u>osCommerce Community
Support Forums</u></a> site.</td></tr></table><br>If you wish to download the
solution powering this shop, or if you wish to contribute to the osCommerce
project, please visit the <a href="http://www.oscommerce.com"
target="_blank"><u>support site of osCommerce</u></a>. This shop is running on
osCommerce version <font color="#f0000"><b>' . PROJECT_VERSION .
'</b></font>.');

Dirndl

5:23 pm on Aug 11, 2005 (gmt 0)

10+ Year Member



Thank you for your respond, jatar_k and madmac

I pasted the code you gave me, madmac and now I have this new error message:

Fatal error: Call to undefined function: tep_image() in /home/talico2/public_html/index.php on line 19

Do you know how I can fix this?
Thank you so much!
Dany

[edited by: jatar_k at 5:38 pm (utc) on Aug. 11, 2005]
[edit reason] no sigs thanks [/edit]

jatar_k

5:40 pm on Aug 11, 2005 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



>> Actually, if you read his text

hehe, touché madmac, you are correct

alright so I didn't read it just let my editor match quotes

madmac

6:05 pm on Aug 11, 2005 (gmt 0)

10+ Year Member



>> Fatal error: Call to undefined function: tep_image() in /home/talico2/public_html/index.php on line 19

What version of osCommerce are you running? The tep_image() function should be located in includes/functions/html_output.php (or maybe in the general.php), and this function file should be being loaded on each page, before the language files are.

I'm not sure why you'd be getting that error, as having tep_image() in a language define should not be a problem on a default osCommerce MS2 install.

Though, you could simply avoid it by replacing the tep_image() calls in the define with just html <img> tags.

Dirndl

6:49 pm on Aug 11, 2005 (gmt 0)

10+ Year Member



oh madmac!
I fixed the image error, however, yet again I received an error message:

Parse error: parse error, unexpected T_STRING in /home/talico2/public_html/index.php on line 35

With all the tips I have received today, I still cannot for the life of figure it out.

define('TEXT_MAIN', 'This is a default setup of the osCommerce project,
products shown are for demonstrational purposes, <b>any products purchased will
not be delivered nor will the customer be billed</b>. Any information seen on
these products is to be treated as fictional.<br><br><table border="0"
width="100%" cellspacing="5" cellpadding="2"><tr><td class="main" valign="top">'
. tep_image(DIR_WS_IMAGES . 'default/3.gif') . '</td><td class="main"
valign="top"><b>Error Messages</b><br><br>If there are any error or warning
messages shown above, please correct them first before proceeding.<br><br>Error
messages are displayed at the very top of the page with a complete <span
class="messageStackError">background</span> color.<br><br>Several checks are
performed to ensure a healthy setup of your online store - these checks can be
disabled by editing the appropriate parameters at the bottom of the
includes/application_top.php file.</td></tr><td class="main" valign="top">' .
tep_image(DIR_WS_IMAGES . 'default/2.gif') . '</td><td class="main"
valign="top"><b>Editing Page Texts</b><br><br>The text shown here can be
modified in the following file, on each language basis:<br><br><nobr
class="messageStackSuccess">[path to catalog]/includes/languages/' . $language .
'/' . FILENAME_DEFAULT . '</nobr><br><br>That file can be edited manually, or
via the Administration Tool with the <nobr
class="messageStackSuccess">Languages->' . ucfirst($language) . '->Define</nobr>
or <nobr class="messageStackSuccess">Tools->File Manager</nobr>
modules.<br><br>The text is set in the following
manner:<br><br><nobr>define('TEXT_MAIN', '<span class="messageStackSuccess">This
is a default setup of the osCommerce project...</span>');</nobr><br><br>The text
highlighted in green may be modified - it is important to keep the define() of
the TEXT_MAIN keyword. To remove the text for TEXT_MAIN completely, the
following example is used where only two single quote characters
exist:<br><br><nobr>define('TEXT_MAIN', '');</nobr><br><br>More information
concerning the PHP define() function can be read <a
href="http://www.php.net/define"
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>It is important to
secure the Administration Tool as there is currently no security implementation
available.</td></tr><tr><td class="main" valign="top">' .
tep_image(DIR_WS_IMAGES . 'default/4.gif') . '</td><td class="main"
valign="top"><b>Online Documentation</b><br><br>Online documentation can be read
at the <a href="http://wiki.oscommerce.com" target="_blank"><u>osCommerce Wiki
Documentation Effort</u></a> site.<br><br>Community support is available at the
<a href="http://forums.oscommerce.com" target="_blank"><u>osCommerce Community
Support Forums</u></a> site.</td></tr></table><br>If you wish to download the
solution powering this shop, or if you wish to contribute to the osCommerce
project, please visit the <a href="http://www.oscommerce.com"
target="_blank"><u>support site of osCommerce</u></a>. This shop is running on
osCommerce version <font color="#f0000"><b>' . PROJECT_VERSION .
'</b></font>.');

madmac

8:51 pm on Aug 11, 2005 (gmt 0)

10+ Year Member



In the following part, the single quotes need escaped:

define('TEXT_MAIN', '<span class="messageStackSuccess">This
is a default setup of the osCommerce project...</span>');</nobr><br><br>The text
highlighted in green may be modified - it is important to keep the define() of
the TEXT_MAIN keyword. To remove the text for TEXT_MAIN completely, the
following example is used where only two single quote characters
exist:<br><br><nobr>define('TEXT_MAIN', '');

Dirndl

9:24 pm on Aug 11, 2005 (gmt 0)

10+ Year Member



This is what I fixed it to and I still get the error message.
What am I doing wrong?

define('TEXT_MAIN', \'<span class="messageStackSuccess">This
is a default setup of the osCommerce project...</span>\');</nobr><br><br>The text
highlighted in green may be modified - it is important to keep the define() of
the TEXT_MAIN keyword. To remove the text for TEXT_MAIN completely, the
following example is used where only two single quote characters
exist:<br><br><nobr>define('TEXT_MAIN', '');

madmac

9:33 pm on Aug 11, 2005 (gmt 0)

10+ Year Member



All of that text there is inside of another set of single quotes... so you have to escape all of the single quotes (otherwise PHP thinks you are closing the string to parse more script.

i.e, it should be:

define(\'TEXT_MAIN\', \'<span class="messageStackSuccess">This 
is a default setup of the osCommerce project...</span>\');</nobr><br><br>The text
highlighted in green may be modified - it is important to keep the define() of
the TEXT_MAIN keyword. To remove the text for TEXT_MAIN completely, the
following example is used where only two single quote characters
exist:<br><br><nobr>define(\'TEXT_MAIN\', \'\');

Dirndl

9:44 pm on Aug 11, 2005 (gmt 0)

10+ Year Member



Thank you for spelling it out, madmac.

I pasted the section, check everything, and I still get the same line 35 error message.

Is there a index.php file out there for me to just copy and paste into my code area, since I have not made any changes yet. My index file is still the origional file from when I downloaded osC?

I really don't know what else to do anymore.

Dirndl

11:04 pm on Aug 11, 2005 (gmt 0)

10+ Year Member



Thanks for all your help!
Never mind. I have been reading about my error messages for the past 35 hours and figured out that I am doomed.

I used the osC panel to change and post code and that is a no-no.

I deleted my store completly and am off to zen cart.

Thank you again!