MyBB Community Forums

Full Version: URGENT showthread.php, forumdisplay.php and possibly others with syntax errors.
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3 4 5
Ok I JUST upgraded to 1.6.4 and re-downloaded twice to make sure.

There is a syntax error in multiple scripts.
Quote:Fatal error: Cannot use string offset as an array

Forum display and showthread are just two that I have tested.

Quote:Fatal error: Cannot use string offset as an array in /home/******/public_html/forumdisplay.php on line 632

Quote:Fatal error: Cannot use string offset as an array in /home/*****/public_html/showthread.php on line 1107

My PHP on my server is PHP 5.2.17 (cli) (built: Jul 5 2011 17:48:00)

I uploaded all the scripts, upgraded my DB with the install/upgrader and then try to browse and get this.

(user home dir has been replaced with * in error messages)

Any Help?
Ok this is just weird and I don't know what to do. I ran on a test board fine, but i get a syntax error on my site and I tried the new disable all plugins and it solves nothing so its not a plugin causing it. i don't know what else it do...

Help?
k until this can get fixed i was able to replace the problematic php scripts with 1.6.3 mybb versions. I know its bad idea to mix versions like that, but its only thing I can think of ...
" I ran on a test board fine, but i get a syntax error on my site " --> appears to be corrupt files

try comparing the above two files AND the files at your installation package by using notepad++
(2011-07-27, 11:29 AM)ranjani Wrote: [ -> ]" I ran on a test board fine, but i get a syntax error on my site " --> appears to be corrupt files

try comparing the above two files AND the files at your installation package by using notepad++

I don't follow. I uploaded the same files the same way to the test board with no error. I downloaded the zip 3+ times and tried and got an error so I don't see how it is corrupt files. i am using filezilla on debian squeeze.
I also just upgraded another forum I am currently running with no problems using the same files as well on the same server...
Rebuild the threadprefix and forumdisplay caches from the ACP Cache Manager.

Are you running file cache or database cache?
Hi pcfreak30,

I had the same problem and I solved it. It's a MyBB code problem, so I expect to be fixed in the next upgrade.

1] Edit the "forumdisplay.php" file:

Search the line 632 where it says:
$forum_stats = $cache->read("forumsdisplay");
if($forum_stats[-1]['announcements'] || $forum_stats[$fid]['announcements'])

You have to add between those 2 lines:
$forum_stats=array();

so it ends like this:
$forum_stats = $cache->read("forumsdisplay");
$forum_stats=array();
if($forum_stats[-1]['announcements'] || $forum_stats[$fid]['announcements'])

2] Edit the "showthread.php" file:
Search the line 1107 where it says:
	{
		if($forum_stats[-1]['modtools'] || $forum_stats[$forum['fid']]['modtools'])

You have to add between those 2 lines:
$forum_stats=array();

so it ends like this:
	{
		$forum_stats=array();
		if($forum_stats[-1]['modtools'] || $forum_stats[$forum['fid']]['modtools'])

3] There is another typo line on "inc/functions.php" file.
Edit the "inc/functions.php" file:
Search the line 2573 where it says:
	foreach($prefix_cache as $prefix)

And replace it with:
	foreach($prefixes_cache as $prefix)

Smile

PS: thanks to Tech Blog for giving me the idea
With your fix, the functions don't work anymore. Just do, what Tomm M said...
Hi StefanT,

so..., if I declare an array, it didn't work? How is this possible?

And how could I have an active forum, "working" like a charm if the functions don't work anymore?

If you could give me a little advise, I'll appreciate your help
All of those code changes are wrong... Undecided
(2011-07-27, 12:56 PM)Tomm M Wrote: [ -> ]Rebuild the threadprefix and forumdisplay caches from the ACP Cache Manager.

Are you running file cache or database cache?

I am using memcache. Your suggestion worked as well..


This is related to error_reporting() in php.

If you've changed a setting so that it's E_ALL you might see those errors.

I could be wrong but what is error_reporting set at?
Pages: 1 2 3 4 5