vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   Template Error After Server Move (https://vborg.vbsupport.ru/showthread.php?t=175007)

Boofo 04-03-2008 06:38 AM

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

Opserty 04-03-2008 08:08 AM

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

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?

Boofo 04-03-2008 08:40 AM

Quote:

Originally Posted by Opserty (Post 1481751)
I thought you of all people would give more info then that! :p

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?

Marco van Herwaarden 04-03-2008 08:44 AM

By testing against a string value.

Boofo 04-03-2008 08:47 AM

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 (Post 1481785)
By testing against a string value.

How do we do that, sir? ;)

Marco van Herwaarden 04-03-2008 08:49 AM

You just did it by adding quotes.

Boofo 04-03-2008 08:51 AM

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

Thank you for the info, Marco. ;)

Marco van Herwaarden 04-03-2008 09:16 AM

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.

Boofo 04-03-2008 09:25 AM

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. ;)


All times are GMT. The time now is 04:19 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01011 seconds
  • Memory Usage 1,733KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (2)bbcode_code_printable
  • (1)bbcode_html_printable
  • (3)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (9)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.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/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.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
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete