Simple Machines Community Forum

SMF Support => SMF 2.0.x Support => Topic started by: tk2012 on August 15, 2008, 02:11:37 AM

Title: Parse error -- YIPPEE!
Post by: tk2012 on August 15, 2008, 02:11:37 AM
I love having problems and they seem to love me, too.  But, with each problem I get a little bit smarter and won't have to ask the same question again... hopefully!  ;)

Sooo, I just installed a modification, but I'm not sure if this is causing it or not.  Regardless, I go to look at a post and I get a parse error that is attached below...

Questions:

1) What does this error tell me when I see something like this?
2) What do I do to go about fixing this error?

PS - If I knew what a double arrow was that may help! 
Title: Re: Parse error -- YIPPEE!
Post by: ccbtimewiz on August 15, 2008, 02:16:09 AM
The error is caused when you have illogical statements together. Mostly, misplaced functions, commands, etc. This creates parse errors and causes the template not to load and spitting out an error.

They are usually simple to fix. Could you attach your Display.template.php file?
Title: Re: Parse error -- YIPPEE!
Post by: tk2012 on August 15, 2008, 02:19:33 AM
Sure, I just installed "Bookmarks" , but I was getting an error with "Today's Birthday" as well, so JohnnyB is looking at it, too in regards to his mod. 

Is there no "code check" feature for Notepad+++?  Kinda like a spellcheck, but for code... Someone should make that for the less to no skilled computer workers like me!! LOL

Title: Re: Parse error -- YIPPEE!
Post by: ccbtimewiz on August 15, 2008, 02:21:58 AM
Found the error. I'd report this to Aaron when you can, BTW.

Find:
/ Build the normal button array.
'bookmark' => array('test' => 'can_reply', 'text' => 'bookmark_add', 'lang' => true, 'url' => $scripturl . '?action=bookmarks;sa=add;topic=' . $context['current_topic']),
$normal_buttons = array(
'reply' => array('test' => 'can_reply', 'text' => 'reply', 'image' => 'reply.gif', 'lang' => true, 'url' => $scripturl . '?action=post;topic=' . $context['current_topic'] . '.' . $context['start'] . ';num_replies=' . $context['num_replies']),


Replace with:
/ Build the normal button array.
$normal_buttons = array(
'reply' => array('test' => 'can_reply', 'text' => 'reply', 'image' => 'reply.gif', 'lang' => true, 'url' => $scripturl . '?action=post;topic=' . $context['current_topic'] . '.' . $context['start'] . ';num_replies=' . $context['num_replies']),
                'bookmark' => array('test' => 'can_reply', 'text' => 'bookmark_add', 'lang' => true, 'url' => $scripturl . '?action=bookmarks;sa=add;topic=' . $context['current_topic']),
Title: Re: Parse error -- YIPPEE!
Post by: tk2012 on August 15, 2008, 02:24:57 AM
THANK YOU!!

I need to track down my PayPal password and share the love.  You guys are truly awesome!  Will do the above change and will let him know after my edit is done!

THANK YOU AGAIN!

-TK
Title: Re: Parse error -- YIPPEE!
Post by: tk2012 on August 15, 2008, 02:30:50 AM
I got another error, but I think I may see what happened....

shouldn't the beginning of the code have two "//" instead of one "/" ??

I uploaded and I'm getting the error now that says...  syntax error, unexpected '/'



EDIT!! 

Woohoo.. I added the extra "/" and it works!  No more parse error!  YAY!!! Go Me! Go Me!
Title: Re: Parse error -- YIPPEE!
Post by: ccbtimewiz on August 15, 2008, 02:35:39 AM
Oh wow, how could I miss that? Must be 2am madness. x.x

Yes, comment tags are suffixed by using "//" or "#" or putting the information between /* and */.

Though looks like you figured it out. :)

I'll mark this as solved seeing how I managed to fix your first error and you managed to fix the other.
Title: Re: Parse error -- YIPPEE!
Post by: tk2012 on August 15, 2008, 02:44:43 AM
Yes, I was supposed to be asleep about 3 hours ago... it is almost 3am now.  Oh well, the weekend is almost here and tomorrow is a 1/2 day! 

Thanks again!

solved!

and noted in the bookmarks thread, too