Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 Programming Discussions
  #1  
Old 04-03-2008, 06:38 AM
Boofo's Avatar
Boofo Boofo is offline
 
Join Date: Mar 2002
Location: Des Moines, IA (USA)
Posts: 15,776
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Template Error After Server Move

What could cause the following error when trying to view posts after a server move? And does anyone have any idea how to fix it?

Quote:
Parse error: syntax error, unexpected T_PRIVATE in /xxxx/xxxx/public_html/forums/includes/class_postbit.php(292) : eval()'d code on line 24
Reply With Quote
  #2  
Old 04-03-2008, 08:08 AM
Opserty Opserty is offline
 
Join Date: Apr 2007
Posts: 4,103
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I thought you of all people would give more info then that!

What is on line 292 of class_postbit.php (what hook/template)?

What is on line 24 of that template/plugin?

According to a quick google search 'private' is now a PHP Keyword/constant, using somthing like $vbphrase[private] is probably causing you an error, are you running PHP5?
Reply With Quote
  #3  
Old 04-03-2008, 08:40 AM
Boofo's Avatar
Boofo Boofo is offline
 
Join Date: Mar 2002
Location: Des Moines, IA (USA)
Posts: 15,776
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Opserty View Post
I thought you of all people would give more info then that!

What is on line 292 of class_postbit.php (what hook/template)?

What is on line 24 of that template/plugin?

According to a quick google search 'private' is now a PHP Keyword/constant, using somthing like $vbphrase[private] is probably causing you an error, are you running PHP5?
LOL Yeah, I figured someone moving to PHP 5 from 4 would have already had this happen so I figured someone would know what to do. My bad. Does this mean I have tio go back to newbie status and start all over again. Awww, man!

The line in the class_postbit.php is:

Code:
  eval('$postbit = "' . fetch_template($this->templatename) . '";');
Line 24 of the postbit is:

HTML Code:
   <if condition="THIS_SCRIPT != private AND !$show['moderated'] AND $post['threadid']"><a href="printpost.php?$session[sessionurl]t=$post[threadid]&amp;p=$post[postid]" rel="nofollow"><img class="inlineimg" src="$stylevar[imgdir_button]/printer.gif" alt="$vbphrase[show_printable_version]" border="0" /></a></if>
How do we check for the private script then in version 5?
Reply With Quote
  #4  
Old 04-03-2008, 08:44 AM
Marco van Herwaarden Marco van Herwaarden is offline
 
Join Date: Jul 2004
Posts: 25,415
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

By testing against a string value.
Reply With Quote
  #5  
Old 04-03-2008, 08:47 AM
Boofo's Avatar
Boofo Boofo is offline
 
Join Date: Mar 2002
Location: Des Moines, IA (USA)
Posts: 15,776
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Ok, I added the single quotes around it and that fixed it. Is that how we had to do it for all of those now when we have the AND in there? Or just for private? And are there any other things I should know about PHP 5 and the templates?

And thank you for sending me in the right direction. PHP 5 is not every forgiving it seems.

Code:
 
<if condition="THIS_SCRIPT != 'private' AND !$show['moderated'] AND $post['threadid']"><a href="printpost.php?$session[sessionurl]t=$post[threadid]&amp;p=$post[postid]" rel="nofollow"><img class="inlineimg" src="$stylevar[imgdir_button]/printer.gif" alt="$vbphrase[show_printable_version]" border="0" /></a></if>
--------------- Added [DATE]1207216062[/DATE] at [TIME]1207216062[/TIME] ---------------

Quote:
Originally Posted by Marco van Herwaarden View Post
By testing against a string value.
How do we do that, sir?
Reply With Quote
  #6  
Old 04-03-2008, 08:49 AM
Marco van Herwaarden Marco van Herwaarden is offline
 
Join Date: Jul 2004
Posts: 25,415
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

You just did it by adding quotes.
Reply With Quote
  #7  
Old 04-03-2008, 08:51 AM
Boofo's Avatar
Boofo Boofo is offline
 
Join Date: Mar 2002
Location: Des Moines, IA (USA)
Posts: 15,776
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Ahh, so I really should have been doing that all along, even in PHP 4, huh?

Thank you for the info, Marco.
Reply With Quote
  #8  
Old 04-03-2008, 09:16 AM
Marco van Herwaarden Marco van Herwaarden is offline
 
Join Date: Jul 2004
Posts: 25,415
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Yes you should always do that. Otherwise it will only work if the string is not also defined as constant or is a reserved word. Without quotes you are trusting on luck if it will work or not.
Reply With Quote
  #9  
Old 04-03-2008, 09:25 AM
Boofo's Avatar
Boofo Boofo is offline
 
Join Date: Mar 2002
Location: Des Moines, IA (USA)
Posts: 15,776
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I can't believe I did it that way. I always do the quotes when I do it without the AND. Must have been an off day there.
Reply With Quote
Reply

Thread Tools
Display Modes

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. The time now is 08:28 AM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.08046 seconds
  • Memory Usage 2,239KB
  • Queries Executed 11 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (2)bbcode_code
  • (1)bbcode_html
  • (3)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (9)post_thanks_box
  • (9)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (9)post_thanks_postbit_info
  • (9)postbit
  • (9)postbit_onlinestatus
  • (9)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete