CodingForums.com

CodingForums.com (http://www.codingforums.com/index.php)
-   PHP (http://www.codingforums.com/forumdisplay.php?f=6)
-   -   Parse error: syntax error, unexpected '}' (http://www.codingforums.com/showthread.php?t=247285)

darkhost 12-28-2011 02:00 AM

Parse error: syntax error, unexpected '}'
 
Greetings,


I have this error:

Parse error: syntax error, unexpected '}' in /home/user/public_html/Forum/cache/tpl_prosilver_viewtopic_body.html.php on line 44


Can anybody help me resolve this issue? Everytime i try to enter on a post in forum appear that error. I don't know what to do and what to edit.


On line 44 from "cache/tpl_prosilver_viewtopic_body.html.php" is this:

Code:


<dd><?php if ($_poll_option_val['POLL_OPTION_RESULT'] == 0) {  echo ((isset($this->_rootref['L_NO_VOTES'])) ? $this->_rootref['L_NO_VOTES'] : ((isset($user->lang['NO_VOTES'])) ? $user->lang['NO_VOTES'] : '{ NO_VOTES }')); } else { echo $_poll_option_val['POLL_OPTION_PERCENT']; } ?></dd><?php } ?></dl><?php }} if ($this->_rootref['S_DISPLAY_RESULTS']) {  ?>


Please anybody can help?
If that line is not enough for resolving i can provide another codes.I'm new in this job and don't know much.

Thanks

melloorr 12-28-2011 02:03 AM

Quote:

Originally Posted by darkhost (Post 1174801)
Greetings,


I have this error:

Parse error: syntax error, unexpected '}' in /home/user/public_html/Forum/cache/tpl_prosilver_viewtopic_body.html.php on line 44


Can anybody help me resolve this issue? Everytime i try to enter on a post in forum appear that error. I don't know what to do and what to edit.


On line 44 from "cache/tpl_prosilver_viewtopic_body.html.php" is this:

Code:


<dd><?php if ($_poll_option_val['POLL_OPTION_RESULT'] == 0) {  echo ((isset($this->_rootref['L_NO_VOTES'])) ? $this->_rootref['L_NO_VOTES'] : ((isset($user->lang['NO_VOTES'])) ? $user->lang['NO_VOTES'] : '{ NO_VOTES }')); } else { echo $_poll_option_val['POLL_OPTION_PERCENT']; } ?></dd><?php } ?></dl><?php }} if ($this->_rootref['S_DISPLAY_RESULTS']) {  ?>


Please anybody can help?
If that line is not enough for resolving i can provide another codes.I'm new in this job and don't know much.

Thanks

Take off one } just before the last if statement you showed us

tangoforce 12-28-2011 02:05 AM

See the Coding Styles link in my signature for more help on dealing with this problem and to see why your should format your code neatly.

darkhost 12-28-2011 02:18 AM

i've removed the last { from the last if statement..... and now the parse error syntax error, unexpected '}' is in "/home/user/public_html/Forum/includes/template.php(229) : eval()'d code on line 44"


after second refresh the error is back in on cache/tpl_prosilver_viewtopic_body.html.php" ...

any ideas? :(

melloorr 12-28-2011 02:21 AM

Quote:

Originally Posted by darkhost (Post 1174808)
i've removed the last { from the last if statement..... and now the parse error syntax error, unexpected '}' is in "/home/user/public_html/Forum/includes/template.php(229) : eval()'d code on line 44"


after second refresh the error is back in on cache/tpl_prosilver_viewtopic_body.html.php" ...

any ideas? :(

I said last } BEFORE the last if statement.

Copy and paste this:

PHP Code:

<dd><?php if ($_poll_option_val['POLL_OPTION_RESULT'] == 0) {  echo ((isset($this->_rootref['L_NO_VOTES'])) ? $this->_rootref['L_NO_VOTES'] : ((isset($user->lang['NO_VOTES'])) ? $user->lang['NO_VOTES'] : '{ NO_VOTES }')); } else { echo $_poll_option_val['POLL_OPTION_PERCENT']; } ?></dd><?php ?></dl><?php } if ($this->_rootref['S_DISPLAY_RESULTS']) {  ?>

If it doesn't work, then go to the phpbb forum...

darkhost 12-28-2011 02:27 AM

ok...i will paste that....but i don't wanna make any mistakes paste it in another files....where to paste that?

in: /cache/tpl_prosilver_viewtopic_body.html.php

or

in: styles/prosilver/template/viewtopic_body.html


or somewhere else?

sorry....i'm new in php

melloorr 12-28-2011 02:29 AM

Quote:

Originally Posted by darkhost (Post 1174819)
ok...i will paste that....but i don't wanna make any mistakes paste it in another files....where to paste that?

in: /cache/tpl_prosilver_viewtopic_body.html.php

or

in: styles/prosilver/template/viewtopic_body.html


or somewhere else?

sorry....i'm new in php

Paste it over the code you first posted, replace all of it (line 44) with what I just posted

darkhost 12-28-2011 02:33 AM

done that....i've maded a refresh and same error....and the i go to administator control panel->styles->templates and hit the refresh button and cleared all the cache and still same error ...

melloorr 12-28-2011 02:36 AM

Quote:

Originally Posted by darkhost (Post 1174823)
done that....i've maded a refresh and same error....and the i go to administator control panel->styles->templates and hit the refresh button and cleared all the cache and still same error ...

Have you tried just deleting that file? Its cache, so it shouldn't matter if it is deleted. Just make a backup of it just in case

tangoforce 12-28-2011 02:38 AM

Did you even look at my topic? - You've come here and posted one very long line of code.

It's no wonder you can't see the error. Break it down into lines of readable code as suggested in the 'Coding Styles' link in my topic. It will make your life so much easier.

Trust me, I had to learn PHP once too.

melloorr 12-28-2011 02:40 AM

Quote:

Originally Posted by tangoforce (Post 1174827)
Did you even look at my topic? - You've come here and posted one very long line of code.

It's no wonder you can't see the error. Break it down into lines of readable code as suggested in the 'Coding Styles' link in my topic. It will make your life so much easier.

Trust me, I had to learn PHP once too.

He didn't even make the code, it is a theme from phpbb (why he didn't ask this on their forum, I don't know)

darkhost 12-28-2011 02:46 AM

tangoforce - i will do gladly that "Break it down into lines of readable code" but like i sayd i'm new in this and don't know how to do that...who knows what mistake i made when try something on my own without having the knowledge of php ... i just wanna get rid of that error.


melloorr - i've deleted that php. at first refresh sayd this:

Quote:

Parse error: syntax error, unexpected '}' in /home/user/public_html/Forum/includes/template.php(230) : eval()'d code on line 44
at second refresh sayd this:

Quote:

Parse error: syntax error, unexpected '}' in /home/user/public_html/Forum/cache/tpl_prosilver_viewtopic_body.html.php on line 44

melloorr 12-28-2011 02:50 AM

Quote:

Originally Posted by darkhost (Post 1174830)
tangoforce - i will do gladly that "Break it down into lines of readable code" but like i sayd i'm new in this and don't know how to do that...who knows what mistake i made when try something on my own without having the knowledge of php ... i just wanna get rid of that error.


melloorr - i've deleted that php. at first refresh sayd this:



at second refresh sayd this:

Go into Admin Control Panel and on the first page, click the button 'Purge the cache'

darkhost 12-28-2011 02:55 AM

done that....same errors....

i think this erros is because i modified something in "viewtopic_body.html"....but when i saw those errors i delete my modifications....its about the +1 Google Button.

i don't understand...i undo my modifications...i cleared the cache...i deleted that cache manualy from file manager...and still same errors......

what can it be the problem?

melloorr 12-28-2011 02:58 AM

Quote:

Originally Posted by darkhost (Post 1174833)
done that....same errors....

i think this erros is because i modified something in "viewtopic_body.html"....but when i saw those errors i delete my modifications....its about the +1 Google Button.

i don't understand...i undo my modifications...i cleared the cache...i deleted that cache manualy from file manager...and still same errors......

what can it be the problem?

I do not know. If you file has been open in the editor since you edited it, just keep undoing untill you cannot anymore, then save and upload it. if that does not work then you may have to reinstall the forum theme


All times are GMT +1. The time now is 07:37 PM.

Powered by vBulletin®
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.