Author Topic: UNEXPECTED T-STRING error resolved  (Read 44466 times)

0 Members and 1 Guest are viewing this topic.

Offline NoBob

  • Newbie
  • *
  • Posts: 47
    • View Profile
UNEXPECTED T-STRING error resolved
« Reply #30 on: June 17, 2003, 07:24:21 AM »
V@no,

I've got

magic_quotes_gpc On On
magic_quotes_runtime Off Off
magic_quotes_sybase Off Off

NoBob.

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
UNEXPECTED T-STRING error resolved
« Reply #31 on: June 17, 2003, 10:53:12 AM »
magic_quotes changes anything...just tryed myself..
but if u use default template, do u get same error message? (lets go from here ;))
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline NoBob

  • Newbie
  • *
  • Posts: 47
    • View Profile
UNEXPECTED T-STRING error resolved
« Reply #32 on: June 17, 2003, 10:16:09 PM »
Just tried the default template and everything works okay.

I get these errors when using 4bare.

"Nice's old port" as category name. Error on home page:
Parse error: parse error, unexpected T_STRING in /usr/local/psa/home/vhosts/rtwtravel.com/httpdocs/gallery/includes/template.php(133) : eval()'d code on line 208


"Nice's old port" is in the description. When arrive at the category page through clickstream from home page, this is the error:
Parse error: parse error, unexpected T_STRING in /usr/local/psa/home/vhosts/rtwtravel.com/httpdocs/gallery/includes/template.php(133) : eval()'d code on line 95

When the apostrphe is in both the category name and the description, the error is:
Parse error: parse error, unexpected T_STRING in /usr/local/psa/home/vhosts/rtwtravel.com/httpdocs/gallery/includes/template.php(133) : eval()'d code on line 208

NoBob.

Offline www.girls-on-bikes.com

  • Full Member
  • ***
  • Posts: 145
    • View Profile
    • http://www.girls-on-bikes.com/
UNEXPECTED T-STRING error resolved
« Reply #33 on: June 17, 2003, 10:37:35 PM »
That pretty much proves it right there, a lot of these templates are modified, and as you can see, they don't deal with special characters well.
Kind of a bummer :(

Offline NoBob

  • Newbie
  • *
  • Posts: 47
    • View Profile
UNEXPECTED T-STRING error resolved
« Reply #34 on: June 17, 2003, 10:51:00 PM »
There must be a solution.

NoBob.

Offline www.girls-on-bikes.com

  • Full Member
  • ***
  • Posts: 145
    • View Profile
    • http://www.girls-on-bikes.com/
UNEXPECTED T-STRING error resolved
« Reply #35 on: June 17, 2003, 10:53:19 PM »
There is, pinpoint exactly which file is causing the error, and re-write the way that file deals with htmlspecialchars.

It's not easy if you don't know PHP well, but that is the basic solution.

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
UNEXPECTED T-STRING error resolved
« Reply #36 on: June 17, 2003, 11:51:05 PM »
Quote from: NoBob
Just tried the default template and everything works okay.

if there is something wrong with the template, then I'd first compare it with default, for {...} tags, and maybe syntaxis.
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline NoBob

  • Newbie
  • *
  • Posts: 47
    • View Profile
UNEXPECTED T-STRING error resolved
« Reply #37 on: June 18, 2003, 12:01:57 PM »
Does it matter that there are a mix of single and double quotes in 4bare's categories.html template?

<?php
 $cl = '{clickstream}';
 $uti = "{url_top_images}";
 $lti = "{lang_top_images}";
 $uni = "{url_new_images}";
 $lni = "{lang_new_images}";
 require "{template_url}/incl/click_incl.php";
 ?>
 <table width="100%" border="0" cellspacing="0" cellpadding="0">

<?php
$cn = '{cat_name}';
$cd = '{cat_description}';
$ch = '{cat_hits}';
require "{template_url}/incl/cat_incl.php";


NoBob

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
UNEXPECTED T-STRING error resolved
« Reply #38 on: June 18, 2003, 12:34:46 PM »
I think so, because when {...} tags get replaced by its value, its also strip slashes, so in your case u'll get:
Code: [Select]
$cd = 'Nice's old port';and that gives error message.
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline NoBob

  • Newbie
  • *
  • Posts: 47
    • View Profile
UNEXPECTED T-STRING error resolved
« Reply #39 on: June 18, 2003, 12:53:50 PM »
I tried replacing the single quotes around {cat_name} and {cat_description} with doubles, but that just generated error messages too. Anyway to re-write it?

NoBob

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
UNEXPECTED T-STRING error resolved
« Reply #40 on: June 18, 2003, 02:09:37 PM »
first off all, this is not a right way to do anything in the templates...
but anyway, then try find something like:
Quote
"cat_description" => $some_variable_name

and replace it with:
Quote
"cat_description" => htmlspecialchars($some_variable_name)
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline NoBob

  • Newbie
  • *
  • Posts: 47
    • View Profile
UNEXPECTED T-STRING error resolved
« Reply #41 on: June 18, 2003, 07:00:12 PM »
Good, good, good, we're halfway there...In categories.php, I made the changes to cat_description and now I can use an apostrophe in the description. But htmlspecialchars has always been there after cat_name, and I still get an error if I use an apostrophe in the category name. How's that work for you JoePCFX? You were having problems with descriptions.

Code now:
"cat_name" => htmlspecialchars($cat_cache[$cat_id]['cat_name']),
  "cat_description" => htmlspecialchars($cat_cache[$cat_id]['cat_description']),

NoBob.

Offline NoBob

  • Newbie
  • *
  • Posts: 47
    • View Profile
UNEXPECTED T-STRING error resolved
« Reply #42 on: June 19, 2003, 05:59:15 PM »
bump

Offline JoePCFX

  • Pre-Newbie
  • Posts: 9
    • View Profile
    • http://joe.pcfx.cc
UNEXPECTED T-STRING error resolved
« Reply #43 on: June 20, 2003, 11:39:53 PM »
Nothing works here, using 4_no_rand yet. Maybe Im just appying the code wrong though.

Offline www.girls-on-bikes.com

  • Full Member
  • ***
  • Posts: 145
    • View Profile
    • http://www.girls-on-bikes.com/
UNEXPECTED T-STRING error resolved
« Reply #44 on: June 20, 2003, 11:52:28 PM »
This may be a shot in the dark, but what if you try putting the HTML code version of the apostrophy where you enter in the category name, for example:

Quote
Blah Blah Don&#39;t


May be worth a try, but it doesn't solve the underlying problem.