Go Back   CodingForums.com > :: Server side development > PHP

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 12-28-2011, 02:00 AM   PM User | #1
darkhost
New Coder

 
Join Date: Dec 2011
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
darkhost is an unknown quantity at this point
Unhappy 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
darkhost is offline   Reply With Quote
Old 12-28-2011, 02:03 AM   PM User | #2
melloorr
Regular Coder

 
Join Date: Dec 2011
Location: NW England
Posts: 194
Thanks: 8
Thanked 15 Times in 15 Posts
melloorr is an unknown quantity at this point
Quote:
Originally Posted by darkhost View Post
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

Last edited by melloorr; 12-28-2011 at 02:07 AM..
melloorr is offline   Reply With Quote
Old 12-28-2011, 02:05 AM   PM User | #3
tangoforce
Senior Coder

 
tangoforce's Avatar
 
Join Date: Feb 2011
Location: Your Monitor
Posts: 3,493
Thanks: 44
Thanked 438 Times in 427 Posts
tangoforce will become famous soon enoughtangoforce will become famous soon enough
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.
__________________
Please wrap your code in [php] tags. It is a sticky topic and it HELPS us to HELP YOU!
TIP: Coding styles and $end errors :::::::::: TIP: Warning: Cannot modify header information - headers already sent :::::::::: TIP: Quotes / Parse error: syntax error, unexpected T_..
PHP Code:
//Please don't use this for your form processing:
if (isset($_POST['submit']))
//Internet explorer has a bug and does not always send the submit value. 
Explanation: The IE if(isset($_POST['submit'])) bug explained.
tangoforce is offline   Reply With Quote
Old 12-28-2011, 02:18 AM   PM User | #4
darkhost
New Coder

 
Join Date: Dec 2011
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
darkhost is an unknown quantity at this point
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?
darkhost is offline   Reply With Quote
Old 12-28-2011, 02:21 AM   PM User | #5
melloorr
Regular Coder

 
Join Date: Dec 2011
Location: NW England
Posts: 194
Thanks: 8
Thanked 15 Times in 15 Posts
melloorr is an unknown quantity at this point
Quote:
Originally Posted by darkhost View Post
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...
melloorr is offline   Reply With Quote
Old 12-28-2011, 02:27 AM   PM User | #6
darkhost
New Coder

 
Join Date: Dec 2011
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
darkhost is an unknown quantity at this point
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
darkhost is offline   Reply With Quote
Old 12-28-2011, 02:29 AM   PM User | #7
melloorr
Regular Coder

 
Join Date: Dec 2011
Location: NW England
Posts: 194
Thanks: 8
Thanked 15 Times in 15 Posts
melloorr is an unknown quantity at this point
Quote:
Originally Posted by darkhost View Post
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
melloorr is offline   Reply With Quote
Old 12-28-2011, 02:33 AM   PM User | #8
darkhost
New Coder

 
Join Date: Dec 2011
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
darkhost is an unknown quantity at this point
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 ...
darkhost is offline   Reply With Quote
Old 12-28-2011, 02:36 AM   PM User | #9
melloorr
Regular Coder

 
Join Date: Dec 2011
Location: NW England
Posts: 194
Thanks: 8
Thanked 15 Times in 15 Posts
melloorr is an unknown quantity at this point
Quote:
Originally Posted by darkhost View Post
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
melloorr is offline   Reply With Quote
Old 12-28-2011, 02:38 AM   PM User | #10
tangoforce
Senior Coder

 
tangoforce's Avatar
 
Join Date: Feb 2011
Location: Your Monitor
Posts: 3,493
Thanks: 44
Thanked 438 Times in 427 Posts
tangoforce will become famous soon enoughtangoforce will become famous soon enough
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.
__________________
Please wrap your code in [php] tags. It is a sticky topic and it HELPS us to HELP YOU!
TIP: Coding styles and $end errors :::::::::: TIP: Warning: Cannot modify header information - headers already sent :::::::::: TIP: Quotes / Parse error: syntax error, unexpected T_..
PHP Code:
//Please don't use this for your form processing:
if (isset($_POST['submit']))
//Internet explorer has a bug and does not always send the submit value. 
Explanation: The IE if(isset($_POST['submit'])) bug explained.
tangoforce is offline   Reply With Quote
Old 12-28-2011, 02:40 AM   PM User | #11
melloorr
Regular Coder

 
Join Date: Dec 2011
Location: NW England
Posts: 194
Thanks: 8
Thanked 15 Times in 15 Posts
melloorr is an unknown quantity at this point
Quote:
Originally Posted by tangoforce View Post
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)
melloorr is offline   Reply With Quote
Old 12-28-2011, 02:46 AM   PM User | #12
darkhost
New Coder

 
Join Date: Dec 2011
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
darkhost is an unknown quantity at this point
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
darkhost is offline   Reply With Quote
Old 12-28-2011, 02:50 AM   PM User | #13
melloorr
Regular Coder

 
Join Date: Dec 2011
Location: NW England
Posts: 194
Thanks: 8
Thanked 15 Times in 15 Posts
melloorr is an unknown quantity at this point
Quote:
Originally Posted by darkhost View Post
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'
melloorr is offline   Reply With Quote
Old 12-28-2011, 02:55 AM   PM User | #14
darkhost
New Coder

 
Join Date: Dec 2011
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
darkhost is an unknown quantity at this point
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?
darkhost is offline   Reply With Quote
Old 12-28-2011, 02:58 AM   PM User | #15
melloorr
Regular Coder

 
Join Date: Dec 2011
Location: NW England
Posts: 194
Thanks: 8
Thanked 15 Times in 15 Posts
melloorr is an unknown quantity at this point
Quote:
Originally Posted by darkhost View Post
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
melloorr is offline   Reply With Quote
Reply

Bookmarks

Tags
error, parse

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 08:05 PM.


Advertisement
Log in to turn off these ads.