Forum Moderators: coopster
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
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
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
<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
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>.');
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]
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.
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>.');
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', '');
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', '');
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\', \'\');
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.