Author Topic: Parse error: syntax error, unexpected $end in includes/template.php(101)  (Read 57157 times)

0 Members and 1 Guest are viewing this topic.

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
If you see error message similar to:
Quote
Parse error: syntax error, unexpected $end in includes/template.php(101) : eval()'d code on line 160
This means one or more template files have not matching number of {if ..} and {endif ..} or {ifno ..} and {endifno ..} template tags ( ".." is the name of a tag, i.e. {if blahexample} and {endif blahexample})
Such error didn't show on 4images v1.7, so if your template worked on v1.7 and after 4images upgrade it shows this error, it means your template is not compatible with new 4images, read next how you can make your template compatible.

What you'll need to do is search in all .html template files for all {if ..} and {ifno ..} tags and make sure they have matching {endif ..} and {endifno ..} tags.
Also, the number of {if ..} and {ifno ..} must be equal to number of {endif ..} and {endifno ..} tags in each template file.

For example this is wrong, because it has only one {if ..} and two {endif ..} tags:
Code: [Select]
{if blahexample}
....some html stuff....
{endif blahexample}
...some more html stuff...
{endif blahexample}

Or change template.
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 yesme

  • Jr. Member
  • **
  • Posts: 61
  • Yes for 4images!
    • View Profile
Re: Parse error: syntax error, unexpected $end in includes/template.php(101)
« Reply #1 on: February 14, 2009, 10:59:14 AM »
Thank you V@no. You have released my tension just now. :)
Love 4images! @--^-----

Offline d1eter

  • Newbie
  • *
  • Posts: 42
    • View Profile
Hello..,
I have v1.7.6 website which has been running fine most of the time, I haven;t been visited the ACP for probably almost two months.

Now I have to change some Categories in the website so I visited the ACP.
it gives the error "Parse error: syntax error, unexpected $end in /home/a7746017/public_html/admin/admin_functions.php on line 64"

is it the same symptom as covered in this thread..?
how do I fix the error?

thank you very much for the help!

Offline V@nо

  • Addicted member
  • ******
  • Posts: 1.223
    • View Profile
no, your error is different. something is wrong with your admin/admin_functions.php
try restore that file from backups
Your first three "must do" before you ask a question:
If I asked you to PM me, I meant PM to my primary account, this account doesn't accept PMs.

Offline d1eter

  • Newbie
  • *
  • Posts: 42
    • View Profile
no, your error is different. something is wrong with your admin/admin_functions.php
try restore that file from backups

thanks Vano..,
you're right.., I did try to restore but result still the same.
turns out.. my latest and before backup.., got corrupted somehow. the file got truncated.

I end up replacing the file with the original file from 1.7.6 package.

All is OK now.
Thank you for the hints!

« Last Edit: August 14, 2009, 06:22:04 AM by d1eter »

Offline TMO

  • Newbie
  • *
  • Posts: 11
    • View Profile
hi,
 for some reason i get an error message, trying to plugin a picture into a new category.

Fatal error: Cannot break/continue 1 level in /home/www/web4161/html/swb9001/db/includes/template.php(101) : eval()'d code on line 97

if i delete this image, category page work well again without any picture of course.

I try to solve this problem looking for Tags Errors, but without success, may anyone help me?

Thanks
TMO