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

0 Members and 1 Guest are viewing this topic.

Offline NoBob

  • Newbie
  • *
  • Posts: 47
    • View Profile
UNEXPECTED T-STRING error resolved
« on: June 10, 2003, 12:38:44 AM »
Thought I'd pass on some info about solving an UNEXPECTED T-STRING ERROR message I got on my gallery home page.

The story:

I set up the templates and changed the look of the site, added the categories and then ftd'd the images into the numbered folders. Then I started to 'check new images' and add them. While I began by hitting the 'Go to the gallery home page' each time I added them, after a while I  just added them and moved onto the next category. To my horror I got an 'UNEXPECTED T-STRING ERROR in...template.php(133)...when I next checked the home page. Luckily I still had a previous gallery window open that showed the categories and I could move around the site - but not the home page. Eventually I found that the last pictures I'd added to a category called 'Nice's old port' were giving the T-STRING ERROR as well. So I deleted the category and tried again. Still the same problem. So, I changed the name of the category to 'Nice old port' and everything worked - works - okay. To cut an already long story short, it seems as if an 's was the problem. Hope this helps someone. My advice - don't close an old gallery window until the updated one appears okay. And back up soon and often.

Best, 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 #1 on: June 10, 2003, 12:54:03 AM »
Just to check your theory, I created new category with name 'Nice's old port', uploaded new images, went to index.php and....nothing happend, no error messages. Not sure why u got that error.
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
Tested it again
« Reply #2 on: June 10, 2003, 01:05:02 AM »
I just changed the category name back to 'Nice's old port' and got '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 190' on the home page. Got rid of the 's again and everything is fine. The results: www.rtwtravel.com/gallery/index.php

Best, NoBob.

Offline omp

  • Pre-Newbie
  • Posts: 2
    • View Profile
UNEXPECTED T-STRING error resolved
« Reply #3 on: June 11, 2003, 06:58:33 AM »
The actual cause of this error is having a ' in the name.  The php code does not know how to handle the ' and it tra-la-las it up.  I have this same issue anytime someone uploads a image and puts a ' in the title of the image.  Only mod iv'e installed is the user upload limit/time limit mod.

Offline NoBob

  • Newbie
  • *
  • Posts: 47
    • View Profile
Thanks for that
« Reply #4 on: June 11, 2003, 08:05:03 AM »
Hi omp,

Yeah, I thought of going back and trying different variations - with just an apostrophe, just a space and an s, etc - to see if it was really both the ' and the s that were causing the problem, but didn't get time. You've answered that for me. Thanks.

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 #5 on: June 11, 2003, 12:17:08 PM »
did u guys remove htmlspecialchars(...); from the code? if u didnt then this error just shouldt happend, 4images uses this function that convers all quotes into " - into HTML codes.
personaly I've never had this problem, even though I have categorie, images and users with single quotes in the name.
And the only problem I had was when I installed first version of Slide show mod. but that's different story.
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
Nope
« Reply #6 on: June 11, 2003, 12:23:15 PM »
Nope, not me - well, don't think so, anyway. Could you tell me where htmlspecialchars(...); is?

Best, 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
Re: Nope
« Reply #7 on: June 11, 2003, 12:24:56 PM »
Quote from: NoBob
Nope, not me - well, don't think so, anyway. Could you tell me where htmlspecialchars(...); is?

Best, NoBob.

everywhere ;)
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 #8 on: June 11, 2003, 12:35:45 PM »
Okay, I give up. I've just looked for htmlspecialchars in three templates (header, home and details) and the index.php file. If it's everywhere, then it's cloaked somehow.

Best, NoBob.

Offline Chris

  • 4images Moderator
  • 4images Guru
  • *****
  • Posts: 4.487
  • Did u ever stop to think and then forget to start?
    • View Profile
UNEXPECTED T-STRING error resolved
« Reply #9 on: June 11, 2003, 03:02:40 PM »
It's mostly used in the php files found in the includes directories.  There are many more php files than index.php

Offline NoBob

  • Newbie
  • *
  • Posts: 47
    • View Profile
UNEXPECTED T-STRING error resolved
« Reply #10 on: June 11, 2003, 03:45:13 PM »
I'm certain I haven't deleted that code - not knowingly anyway. I've carefully changed bits of code in header, home, details, searchbox, index, click_incl, just to change the look, but that's it.

Best, NoBob.
words&pictures

Offline JoePCFX

  • Pre-Newbie
  • Posts: 9
    • View Profile
    • http://joe.pcfx.cc
UNEXPECTED T-STRING error resolved
« Reply #11 on: June 12, 2003, 09:46:23 AM »
I just got this error a few minutes ago for the first time. I had a ' in 2 album's descriptions. Got rid of them, and it works now. I've ALWAYS had the ' in there with no problem, so why is it all the sudden messing up?

I've never touched php templates, and the htmlspecialchar is all there.

Offline JoePCFX

  • Pre-Newbie
  • Posts: 9
    • View Profile
    • http://joe.pcfx.cc
UNEXPECTED T-STRING error resolved
« Reply #12 on: June 13, 2003, 01:44:25 AM »
bump

Offline www.girls-on-bikes.com

  • Full Member
  • ***
  • Posts: 145
    • View Profile
    • http://www.girls-on-bikes.com/
UNEXPECTED T-STRING error resolved
« Reply #13 on: June 13, 2003, 06:05:04 AM »
Just my .02 where it don't belong.

I've noticed some templates (template writers) change up code, including htmlspecialchars(...); (i.e. removing it)

I have a feeling this is where this problem originated.

Offline NoBob

  • Newbie
  • *
  • Posts: 47
    • View Profile
UNEXPECTED T-STRING error resolved
« Reply #14 on: June 13, 2003, 02:21:26 PM »
I was careful not to put an apostrophe in a category's name, but then this morning I put one in the description, and got the same parse error. Will I never be able to use an apostrophe again? I haven't touched any special characters code. Would really like to find the solution to this problem.

www.girls-on-bikes.com, would you mind explaining what you mean about code writers? Which templates have you noticed getting affected?

Thanks.
Best, NoBob.
words&pictures