Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 Programming Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 07-02-2006, 04:03 PM
Adrian Schneider's Avatar
Adrian Schneider Adrian Schneider is offline
 
Join Date: Jul 2004
Posts: 2,528
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Do you want vbJournal working in PHP 5?

Okay, from what I've seen, there are two major bugs with vbJournal and PHP 5.
  • Parse error: parse error, unexpected T_PRIVATE, expecting ']' in (place) in (the file) evaluated code in (many templates).
This is actually very easy to fix! This is yet another reason to QUOTE ARRAY KEYS IN CONDITIONS! Though template conditions are written in double quotes, they aren't parsed that way. They are parsed using the ternary operator ( ? : )

The template
Code:
<strong><if condition="$bbuserinfo['posts'] > 50">Hey Man!<else />Hey Noob!</if></strong>
is executed in the template like so:
PHP Code:
$var "<strong>" . (($bbuserinfo['posts'] > 50) ? "Hey Man!" "Hey Noob!") . "</strong>"
Writing it without the quotes around 'posts' is usually okay (well bad!) but no errors show up, though an E_NOTICE Is issued. If the quotes aren't there, PHP will use the constant 'posts' first, but if it doesn't exist, then the notice is issued, and it uses the string instead. vBulletin was made to hide these notices. However, in PHP 5, with the new OOP functionality, there was a new keyword: "private".

So now, instead of just sending out a notice (which is hidden), it is actually a fatal error, becuase that private keyword shouldn't be in that template condition.

So the fix? Whenever you see this error, just find the line in question (by journal.php) and see which template is evalulated. Then, go to that template, and find the line which is causing the error. You should see the condition like in this post, just fix it by surrounding 'private' in quotes.
  • Blank screen
I've had no spare time to look at this. Hopefully somebody else can figure it out! Just thinking about it now... do the users who get blank screens have error reporting disabled? It could just be the same problem!!

There really is no excuse for something as popular as vbJournal to not support PHP 5; these are bugs... not "incompatibilities"...
Reply With Quote
  #2  
Old 07-02-2006, 04:25 PM
Code Monkey's Avatar
Code Monkey Code Monkey is offline
 
Join Date: May 2004
Posts: 1,080
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

That's what I did to fix mine a couple months ago. There where just a few that needed the quotes and all was good. vbjournal does not have the support option checked so I really have nothing to complain about.
Reply With Quote
  #3  
Old 07-02-2006, 05:35 PM
Snake's Avatar
Snake Snake is offline
 
Join Date: Mar 2005
Location: Cleveland, OH
Posts: 3,832
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I'm looking for someone to figure out the blank screen issue. Anyone please sort this out ASAP!

And thanks Adrian!
Reply With Quote
  #4  
Old 07-02-2006, 05:47 PM
Adrian Schneider's Avatar
Adrian Schneider Adrian Schneider is offline
 
Join Date: Jul 2004
Posts: 2,528
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Dark Cloud
I'm looking for someone to figure out the blank screen issue. Anyone please sort this out ASAP!

And thanks Adrian!
Read posts 1300 and up from that thread. They will probably fix your problem.
Reply With Quote
  #5  
Old 07-02-2006, 06:13 PM
Code Monkey's Avatar
Code Monkey Code Monkey is offline
 
Join Date: May 2004
Posts: 1,080
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Dark Cloud
I'm looking for someone to figure out the blank screen issue. Anyone please sort this out ASAP!

And thanks Adrian!
Look at the error log on your site and see if you have any php errors listed. It's probably the same thing but, as SirAdrian pointed out, you may have error display turned off.
Reply With Quote
  #6  
Old 08-07-2006, 06:00 PM
Chicago_VLNU_4s Chicago_VLNU_4s is offline
 
Join Date: Mar 2006
Location: Chicago
Posts: 453
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

wow, i have no idea what you just said. i'm new to all this so all i really understood was lookin in the journal.php file on line 948 and doing somethin... after that, i'm lost
Reply With Quote
  #7  
Old 08-13-2006, 03:46 AM
Adrian Schneider's Avatar
Adrian Schneider Adrian Schneider is offline
 
Join Date: Jul 2004
Posts: 2,528
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by mini2
I believe I'm doing this correctly, I've found a few cases of [private] in my JOURNAL template for example (line 188).

However, when put them in either " " or ' ' quotes, it still wont save the template due to the parse error on that line.

Any suggestions?
['private'] should work... post the full line here if you are still having problems.
Reply With Quote
  #8  
Old 08-14-2006, 01:56 AM
Adrian Schneider's Avatar
Adrian Schneider Adrian Schneider is offline
 
Join Date: Jul 2004
Posts: 2,528
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

If you aren't inside a condition="..." then you can't quote array keys.
Code:
<font color="red">$vbphrase['private']</font>
should be
Code:
<font color="red">$vbphrase[private]</font>
Also, I would change this:
Code:
<if condition="$bbuserinfo['private']=='1'">
to this
Code:
<if condition="$bbuserinfo['private'] == 1">
Reply With Quote
  #9  
Old 08-14-2006, 03:12 AM
Ntfu2 Ntfu2 is offline
 
Join Date: Feb 2006
Posts: 1,247
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I got it working with php5 using the directions on the 1300 posts and up
Reply With Quote
  #10  
Old 08-14-2006, 11:08 AM
Chadi's Avatar
Chadi Chadi is offline
 
Join Date: May 2004
Location: USA
Posts: 2,043
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Oblivion Knight
Follow these instructions:
https://vborg.vbsupport.ru/showthread.php?t=120134

You're using PHP5.
I'm a little confused, please help me out. I just downloaded the latest and overwrote previous xml and files uploaded.

My error:

Parse error: syntax error, unexpected T_PRIVATE, expecting ']' in /home/chadi/public_html/journal.php(564) : eval()'d code on line 188

Line 188 shows this in journal.php
$pagenumber = $countj['journals'];

Which template am I supposed to edit now?

In case 564 is the line to look at:
eval('print_output("' . fetch_template('JOURNAL') . '");');

I searched the template "journal" and the only area with the word private is below

condition="$bbuserinfo['private']=='1'"><b><font color="red">$vbphrase['private']</font></b><else /><if condition="$bbuserinfo['private']==''"><b><font

I attempted to make it look like this:

condition="$bbuserinfo['private']=='1'"><b><font color="red">$vbphrase['private']</font></b><else /><if condition="$bbuserinfo['private']==''"><b><font

And it gave this error after hitting submit:

Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in /home/chadi/public_html/includes/adminfunctions_template.php(3537) : eval()'d code on line 188
Reply With Quote
Reply


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 09:51 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.05013 seconds
  • Memory Usage 2,269KB
  • 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
  • (5)bbcode_code
  • (1)bbcode_php
  • (4)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (10)postbit
  • (10)postbit_onlinestatus
  • (10)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
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete