PDA

View Full Version : Do you want vbJournal working in PHP 5?


Adrian Schneider
07-02-2006, 04:03 PM
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 <strong><if condition="$bbuserinfo['posts'] > 50">Hey Man!<else />Hey Noob!</if></strong> is executed in the template like so: $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 screenI'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"...

Code Monkey
07-02-2006, 04:25 PM
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.

Snake
07-02-2006, 05:35 PM
I'm looking for someone to figure out the blank screen issue. Anyone please sort this out ASAP!

And thanks Adrian!

Adrian Schneider
07-02-2006, 05:47 PM
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.

Code Monkey
07-02-2006, 06:13 PM
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.

Chicago_VLNU_4s
08-07-2006, 06:00 PM
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

Adrian Schneider
08-13-2006, 03:46 AM
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.

Adrian Schneider
08-14-2006, 01:56 AM
If you aren't inside a condition="..." then you can't quote array keys.
<font color="red">$vbphrase['private']</font>should be<font color="red">$vbphrase[private]</font>

Also, I would change this: <if condition="$bbuserinfo['private']=='1'">to this<if condition="$bbuserinfo['private'] == 1">

Ntfu2
08-14-2006, 03:12 AM
I got it working with php5 using the directions on the 1300 posts and up :)

Chadi
08-14-2006, 11:08 AM
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

Adrian Schneider
08-14-2006, 11:33 AM
See post #10.

Chadi
08-14-2006, 11:44 AM
I tried to change to this:

<if condition="$bbuserinfo['private'] == 1">
Got this:

The following error occurred when attempting to evaluate this template:

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

This is likely caused by a malformed conditional statement. It is highly recommended that you fix this error before continuing, but you may continue as-is if you wish.


Also, this is already there as is, untouched

<font color="red">$vbphrase['private']</font>

Nevermind I got it thanks!

<font color="red">$vbphrase[private]</font>

That was all that needed to be done on my end

FamilyCorner
08-21-2006, 02:36 PM
Oh yay, they are fixed and displaying again, thank you all so much!

Renmiri
09-01-2006, 01:12 AM
You are an angel!!!

Thnks, Journal works now :cool:

Chicago_VLNU_4s
09-09-2006, 05:36 AM
wish i could say the same, i've been having the T_PRIVATE problem and don't know what to do....

Cyn
09-25-2006, 12:15 AM
So what about MySQL 5 with this hack? Seems like it's part of the issue for some. We have PHP 5 and MySQL 5 and would really like to have this hack but I'm very hesitant to even try it out. Anyone using it with PHP 5 and MySQL 5 ?

thenewuser
10-09-2006, 04:20 PM
I just get a blank screen...

Snake
12-23-2006, 09:18 PM
I'm getting this error. Any help please?

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

bheo
02-25-2007, 11:24 AM
can you give me journal.php scripts, couse me confuse about above

n.b.:

look my error http://forum.heartbeatstation.net/journal.php

with this error :

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

Marco van Herwaarden
02-27-2007, 09:05 AM
Probably a problem in one of your templates.

Yours Truly
03-18-2007, 05:17 PM
Thanks a lot for this :)

This is what i use as my JOURNAL template i believe it should work if you copy and paste this.

$stylevar[htmldoctype]
<html dir="$stylevar[textdirection]" lang="$stylevar[languagecode]">
<head>
$headinclude
<title>$vboptions[bbtitle] - $vbphrase[journals]</title>
</head>
<body>
$header
$navbar
<!-- Journal Welcome Panel -->
<table class="tborder" cellspacing="$stylevar[cellspacing]" cellpadding="$stylevar[cellpadding]" border="0" align="center" width="100%">
<tbody>
<tr>
<td class="tcat" colspan="3" align="center">
<a style="float:$stylevar[right]" href="#top" onclick="return toggle_collapse('welcome_vbjournal')"><img id="collapseimg_welcome_vbjournal" src="$stylevar[imgdir_button]/collapse_tcat$vbcollapse[collapseimg_welcome_vbjournal].gif" alt="" border="0" /></a>
$vbphrase[welcome_to_vbjournal]</td>
</tr>
</tbody>
<tbody id="collapseobj_welcome_vbjournal" style="$vbcollapse[collapsetobj_welcome_vbjournal]">
<tr>
<td class="thead" nowrap="nowrap" align="center">$vbphrase[latest_entries]</td>
<td class="thead" nowrap="nowrap" align="center">$vbphrase[latest_journals]</td>
</tr>
$latestbits
</tbody>
<tbody>
<tr>
</tr>
</tbody>
</table>
<!-- /Journal Welcome Panel -->
<br />

<table border="0" align="center" width="100%" cellpadding="0" cellspacing="0">
<tr valign="bottom">
<td align="$stylevar[left]" style="padding-bottom:3px;">
<if condition="$canhave[journal] AND !$bbuserinfo['journal_id']">
<a href="journal.php?$session[sessionurl]do=startjournal"><img src="$stylevar[imgdir_button]/newjournal.gif" border="0" alt="$vbphrase[start_your_journal_now]" /></a>
<else />
<if condition="$bbuserinfo['journal_id']">
<a href="journal.php?$session[sessionurl]do=gotomyjournal"><img src="$stylevar[imgdir_button]/myjournal.gif" border="0" alt="$vbphrase[go_to_your_journal]" /></a>
</if>
</if>
</td>
<td class="$stylevar[right]" style="padding-bottom:3px;">$pgnav</td>
</tr>
<tr>
<td colspan="2">
<table class="tborder" cellspacing="$stylevar[cellspacing]" cellpadding="$stylevar[cellpadding]" border="0" align="center" width="100%" style="border-bottom-width:0px">
<tbody>
<tr>
<td class="tcat" align="$stylevar[left]" width="100%">$vbphrase[journals]</td>
<td id="jlinks" class="vbmenu_control"><a href="#jlinks">$vbphrase[journal_links]</a> <script type="text/javascript"> vbmenu_register("jlinks"); </script></td>
<td id="journalsearch" class="vbmenu_control"><a href="#journalsearch">$vbphrase[search_journals]</a> <script type="text/javascript"> vbmenu_register("journalsearch"); </script></td>
</tr>
</table>
<table class="tborder" cellspacing="$stylevar[cellspacing]" cellpadding="$stylevar[cellpadding]" border="0" align="center" width="100%">
<tr>
<td class="thead">&nbsp;</td>
<td class="thead" nowrap="nowrap">$vbphrase[journal] / $vbphrase[journal_description]</td>
<td class="thead" width="208" nowrap="nowrap" align="center">$vbphrase[last_entry]</td>
<td class="thead" width="69" nowrap="nowrap" align="center">$vbphrase[entries]</td>
<td class="thead" width="69" nowrap="nowrap" align="center">$vbphrase[comments]</td>
</tr>
</tbody>
<tbody id="collapseobj_index_journals" style="$vbcollapse[collapsetobj_index_journals]">
$journalbits
</tbody>
<if condition="$pgnav">
<tr><td class="tfoot" colspan="5" align="$stylevar[right]">
<phrase 1="$journalsstart" 2="$journalsend" 3="$journalount">$vbphrase[showing_results_x_to_y_of_z]</phrase>
</td></tr>
</if>
</table>
</td>
</tr>
<tr valign="top">
<td align="$stylevar[left]" style="padding-top:3px;">
<if condition="$canhave[journal] AND !$bbuserinfo['journal_id']">
<a href="journal.php?$session[sessionurl]do=startjournal"><img src="$stylevar[imgdir_button]/newjournal.gif" border="0" alt="$vbphrase[start_your_journal_now]" /></a>
<else />
<if condition="$bbuserinfo['journal_id']">
<a href="journal.php?$session[sessionurl]do=gotomyjournal"><img src="$stylevar[imgdir_button]/myjournal.gif" border="0" alt="$vbphrase[go_to_your_journal]" /></a>
</if>
</if>
</td>
<td class="$stylevar[right]" style="padding-top:3px;">$pgnav
<br />
</td>
</tr>
<tr>
<td colspan="2">
<br />
<table class="tborder" cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" border="0" width="100%" align="center">
<tr>
<td class="tcat" align="$stylevar[left]">$vbphrase[display_options]</td>
</tr>
<tr>
<td class="thead" align="$stylevar[left]">$vbphrase[options]</td>
</tr>
<tr>
<td class="alt1" align="center">
<form action="journal.php" method="get">
<table cellpadding="0" cellspacing="1" border="0" width="auto">
<tr>
<td class="smallfont">
$vbphrase[sort_by]: <select name="sort">
<option value="journalist"<if condition="$sort=='journalist'"> select="selected"</if>>$vbphrase[journalist]</option>
<option value="journalname"<if condition="$sort=='journalname'"> selected="selected"</if>>$vbphrase[journal_name]</option>
<option value="journaldate"<if condition="$sort=='journaldate'"> selected="selected"</if>>$vbphrase[journal_start_date]</option>
<option value="journaldesc"<if condition="$sort=='journaldesc'"> selected="selected"</if>>$vbphrase[journal_description]</option>
<option value="entrycount"<if condition="$sort=='entrycount'"> selected="selected"</if>>$vbphrase[entry_count]</option>
<option value="lastentry_date"<if condition="$sort=='lastentry_date'"> selected="selected"</if>>$vbphrase[last_entry_date]</option>
<option value="lastentry"<if condition="$sort=='lastentry'"> selected="selected"</if>>$vbphrase[last_entry_title]</option>
</select>
</td>
<td class="smallfont" style="padding-left:20px">
$vbphrase[sort_order]: <select name="order">
<option value="ASC" <if condition="$order=='ASC'"> selected="selected"</if>>$vbphrase[ascending]</option>
<option value="DESC"<if condition="$order=='DESC'"> selected="selected"</if>>$vbphrase[descending]</option>
</select>
</td>
<td align="$stylevar[right]" style="padding-left:20px"><input type="submit" value="$vbphrase[show_journals]" class="button" /></td>
</tr>
</table>
</form>
</td>
</tr>
</tbody>
</table>
<div class="vbmenu_popup" id="journalsearch_menu" style="display:none">
<form action="journal.php" method="get">
<input type="hidden" name="do" value="searchresults" />
<input type="hidden" name="st" value="3" />
<table cellpadding="4" cellspacing="1" border="0">

<tr><td class="thead">$vbphrase[search_journals]</td></tr>
<tr><td class="vbmenu_option" title="nohilite"><input type="text" name="sk" value="" size="20" maxlength="50" /> $gobutton<!--input type="submit" value="Go" class="button" /--></td></tr>
<tr><td class="vbmenu_option"><a href="journal.php?do=search" title="$vbphrase[advanced_journal_search]">$vbphrase[advanced_search]</a></td></tr>
</table>
</form>
</div>
<div class="vbmenu_popup" id="jlinks_menu" style="display:none">
<table cellpadding="4" cellspacing="1" border="0">
<tr><td class="thead">$vbphrase[journal_links]</td></tr>
<if condition="$canhave[journal]"><tr><td class="vbmenu_option"><a href="journal.php?do=gotomyjournal">$vbphrase[my_journal]</a></td></tr>
<tr><td class="vbmenu_option"><a href="journal.php?do=gotomyjournal&amp;action=addentry">$vbphrase[new_entry]</a></td></tr></if>
<tr><td class="vbmenu_option"><a href="journal.php?do=topjournals">$vbphrase[top_journals_list]</a></td></tr>
</table>
</div>

<!-- / NAVBAR POPUP MENUS -->
<br />
<br />
</td>
</tr>
<tr>
<td colspan="2">
<table class="tborder" cellspacing="$stylevar[cellspacing]" cellpadding="$stylevar[cellpadding]" border="0" align="center" width="100%">
<tr>
<td class="tcat" colspan="2">$vbphrase[whats_going_on]</td>
</tr>
<tbody>
<tr>
<td class="thead" colspan="2">
<a style="float:$stylevar[right]" href="#top" onclick="return toggle_collapse('index_wov')">
<img id="collapseimg_index_wov" src="$stylevar[imgdir_button]/collapse_thead$vbcollapse[collapseimg_index_wov].gif" alt="" border="0"></a>
<a href="online.php">$vbphrase[currently_active_users]</a>: $totalviewing (<phrase 1="$numberregistered" 2="$numberguest">$vbphrase[x_members_and_y_guests]</phrase>)</td>
</tr>
</tbody>
<tbody id="collapseobj_index_wov" style="$vbcollapse[collapsetobj_index_wov]">
<tr>
<td class="alt2" align="center"><a href="online.php"><img src="$stylevar[imgdir_misc]/whos_online.gif" border="0" /></a></td>
<td class="alt1" width="100%"><div class="smallfont">$activeusers</div></td>
</tr>
</tbody>
<tbody>
<tr>
<td class="thead" colspan="2"><a style="float:$stylevar[right]" href="#top" onclick="return toggle_collapse('index_statistics')">
<img id="collapseimg_index_statistics" src="$stylevar[imgdir_button]/collapse_thead$vbcollapse[collapseimg_index_statistics].gif" alt="" border="0"></a><phrase 1="$vboptions[bbtitle]">$vbphrase[x_journal_statistics]</phrase></td>
</tr>
</tbody>
<tbody id="collapseobj_index_statistics" style="$vbcollapse[collapsetobj_index_statistics]">
<tr>
<td class="alt2" align="center"><img src="$stylevar[imgdir_misc]/stats.gif" /></td>
<td class="alt1"><div class="smallfont">$vbphrase[journals]: $totaljournals, $vbphrase[entries]: $total[entries], $vbphrase[comments]: $total[comments], $vbphrase[views]: $total[views]</div>
<div class="smallfont"><phrase 1="$session[sessionurl]" 2="$getlatestj[journal_id]" 3="$getlatestj[journalist]">$vbphrase[welcome_to_our_newest_journalist_x]</phrase></div>
<div class="smallfont">$vbphrase[your_current_journal_status_is]: <if condition="$bbuserinfo['private'] == 1"><b><font color="red">$vbphrase[private]</font></b><else /><if condition="$bbuserinfo['private']==''"><b><font color="orange">$vbphrase[non_existent]</font></b><else /><b><font color="green">$vbphrase[public]</font></b></if></if></div></td>
</tr>
</tbody>
<tbody>
<tr>
<td class="thead" colspan="2"><a style="float:$stylevar[right]" href="#top" onclick="return toggle_collapse('index_buddies')"><img id="collapseimg_index_buddies" src="$stylevar[imgdir_button]/collapse_thead$vbcollapse[collapseimg_index_buddies].gif" alt="" border="0"></a><a href="profile.php?$session[sessionurl]do=editlist">$vbphrase[buddy_journals]</a>: $buddycount</td>
</tr>
</tbody>
<tbody id="collapseobj_index_buddies" style="$vbcollapse[collapsetobj_index_buddies]">
<tr>
<td class="alt2" align="center"><a href="profile.php?$session[sessionurl]do=editlist"><img src="$stylevar[imgdir_misc]/buddy_journals.gif" border="0" alt="" /></a></td>
<td class="alt1"><div class="smallfont">$jbuddy_listbits</div></td>
</tr>
</tbody>
<tr>
<td class="tfoot" colspan="2" align="center"><div class="smallfont"><strong><if condition="$bbuserinfo[userid]!=0"><a href="journal.php?do=markjournalsread">$vbphrase[mark_journals_read]</a><else />&nbsp;</if></strong></div></td>
</tr></td>
</tr>
</table>
</td>
</tr>
</table>
$footer
</body>
</html>

ABeautifulBrown
04-26-2007, 12:43 AM
mine says like 48 is the problem, the template there is journal_deletion_journal_confirmation
but I don't see anything in it wrong

rabbits slayer
05-02-2007, 08:38 PM
mine says like 48 is the problem, the template there is journal_deletion_journal_confirmation
but I don't see anything in it wrong

Same here. Help??

Saulie
05-15-2007, 03:42 PM
Same as the previous two members, I get the sam error on line 48. Help please? =)

ArchangelX
03-04-2009, 02:31 AM
Not sure if you guys care at all, but the fix for line 48 problem is in this post:

https://vborg.vbsupport.ru/showpost.php?p=994614&postcount=1227

Couldn't figure it out either...