Jump to the post that solved this thread.
Thread Rating:
  • 2 Vote(s) - 3 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Solved: 3 Years, 1 Month, 3 Weeks, 1 Day, 9 Hours, 11 Minutes, 39 Seconds ago URGENT showthread.php, forumdisplay.php and possibly others with syntax errors.
#1
Solved: 3 Years, 1 Month, 3 Weeks, 1 Day, 9 Hours, 11 Minutes, 39 Seconds ago
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 ...
Reply
#2
Solved: 3 Years, 1 Month, 3 Weeks, 1 Day, 9 Hours, 11 Minutes, 39 Seconds ago
" 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++
Reply
#3
Solved: 3 Years, 1 Month, 3 Weeks, 1 Day, 9 Hours, 11 Minutes, 39 Seconds ago
(07-27-2011, 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...
Reply
#4
Solved: 3 Years, 1 Month, 3 Weeks, 1 Day, 9 Hours, 11 Minutes, 39 Seconds ago
Rebuild the threadprefix and forumdisplay caches from the ACP Cache Manager.

Are you running file cache or database cache?
Reply
#5
Solved: 3 Years, 1 Month, 3 Weeks, 1 Day, 9 Hours, 11 Minutes, 39 Seconds ago
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:
PHP Code:
$forum_stats $cache->read("forumsdisplay");
if(
$forum_stats[-1]['announcements'] || $forum_stats[$fid]['announcements']) 

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

so it ends like this:
PHP Code:
$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:
PHP Code:
    {
        if(
$forum_stats[-1]['modtools'] || $forum_stats[$forum['fid']]['modtools']) 

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

so it ends like this:
PHP Code:
    {
        
$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:
PHP Code:
    foreach($prefix_cache as $prefix

And replace it with:
PHP Code:
    foreach($prefixes_cache as $prefix

Smile

PS: thanks to Tech Blog for giving me the idea
Reply
#6
Solved: 3 Years, 1 Month, 3 Weeks, 1 Day, 9 Hours, 11 Minutes, 39 Seconds ago
With your fix, the functions don't work anymore. Just do, what Tomm M said...
[Image: banner.png]
Reply
#7
Solved: 3 Years, 1 Month, 3 Weeks, 1 Day, 9 Hours, 11 Minutes, 39 Seconds ago
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
Reply
#8
Solved: 3 Years, 1 Month, 3 Weeks, 1 Day, 9 Hours, 11 Minutes, 39 Seconds ago
This user has been denied support. This user has been denied support.
All of those code changes are wrong... Undecided
Reply
#9
Solved: 3 Years, 1 Month, 3 Weeks, 1 Day, 9 Hours, 11 Minutes, 39 Seconds ago
(07-27-2011, 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..


Reply
#10
Solved: 3 Years, 1 Month, 3 Weeks, 1 Day, 9 Hours, 11 Minutes, 39 Seconds ago
This user has been denied support. This user has been denied support.
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?
Reply
Jump to the post that solved this thread.


Forum Jump:


Users browsing this thread: 1 Guest(s)