Current time: 07-22-2014, 07:11 PM Hello There, Guest! (LoginRegister)


Jump to the post that solved this thread.
Post Reply 
 
Thread Rating:
  • 2 Vote(s) - 3 Average
  • 1
  • 2
  • 3
  • 4
  • 5
URGENT showthread.php, forumdisplay.php and possibly others with syntax errors.
07-27-2011, 10:57 AM (This post was last modified: 07-27-2011 11:25 AM by pcfreak30.)
Post: #1
Solved: 2 Years, 11 Months, 2 Weeks, 5 Days, 20 Hours, 43 Minutes, 38 Seconds ago URGENT showthread.php, forumdisplay.php and possibly others with syntax errors.
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 ...
Find all posts by this user
Quote this message in a reply
07-27-2011, 11:29 AM
Post: #2
Solved: 2 Years, 11 Months, 2 Weeks, 5 Days, 20 Hours, 43 Minutes, 38 Seconds ago RE: URGENT showthread.php, forumdisplay.php and possibly others with syntax errors.
" 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++
Find all posts by this user
Quote this message in a reply
07-27-2011, 11:53 AM (This post was last modified: 07-27-2011 12:05 PM by pcfreak30.)
Post: #3
Solved: 2 Years, 11 Months, 2 Weeks, 5 Days, 20 Hours, 43 Minutes, 38 Seconds ago RE: URGENT showthread.php, forumdisplay.php and possibly others with syntax errors.
(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...
Find all posts by this user
Quote this message in a reply
07-27-2011, 12:56 PM
Post: #4
Solved: 2 Years, 11 Months, 2 Weeks, 5 Days, 20 Hours, 43 Minutes, 38 Seconds ago RE: URGENT showthread.php, forumdisplay.php and possibly others with syntax errors.
Rebuild the threadprefix and forumdisplay caches from the ACP Cache Manager.

Are you running file cache or database cache?
Find all posts by this user
Quote this message in a reply
07-27-2011, 04:18 PM (This post was last modified: 07-27-2011 04:23 PM by NoRules.)
Post: #5
Solved: 2 Years, 11 Months, 2 Weeks, 5 Days, 20 Hours, 43 Minutes, 38 Seconds ago RE: URGENT showthread.php, forumdisplay.php and possibly others with syntax errors.
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
Find all posts by this user
Quote this message in a reply
07-27-2011, 04:34 PM
Post: #6
Solved: 2 Years, 11 Months, 2 Weeks, 5 Days, 20 Hours, 43 Minutes, 38 Seconds ago RE: URGENT showthread.php, forumdisplay.php and possibly others with syntax errors.
With your fix, the functions don't work anymore. Just do, what Tomm M said...

[Image: banner.png]
Visit this user's website Find all posts by this user
Quote this message in a reply
07-27-2011, 04:43 PM
Post: #7
Solved: 2 Years, 11 Months, 2 Weeks, 5 Days, 20 Hours, 43 Minutes, 38 Seconds ago RE: URGENT showthread.php, forumdisplay.php and possibly others with syntax errors.
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
Find all posts by this user
Quote this message in a reply
07-27-2011, 04:58 PM
Post: #8
Solved: 2 Years, 11 Months, 2 Weeks, 5 Days, 20 Hours, 43 Minutes, 38 Seconds ago RE: URGENT showthread.php, forumdisplay.php and possibly others with syntax errors.
This user has been denied support. This user has been denied support.
All of those code changes are wrong... Undecided

Google SEO | Gravatar | Hooks | HTMLPurifier | Overview | Patches | PluginLibrary @ GitHub/frostschutz
Find all posts by this user
Quote this message in a reply
07-27-2011, 10:24 PM
Post: #9
Solved: 2 Years, 11 Months, 2 Weeks, 5 Days, 20 Hours, 43 Minutes, 38 Seconds ago Thanks..
(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..
Find all posts by this user
Quote this message in a reply
07-28-2011, 05:21 AM
Post: #10
Solved: 2 Years, 11 Months, 2 Weeks, 5 Days, 20 Hours, 43 Minutes, 38 Seconds ago RE: URGENT showthread.php, forumdisplay.php and possibly others with syntax errors.
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?
Visit this user's website Find all posts by this user
Quote this message in a reply
Jump to the post that solved this thread.
Post Reply 


Forum Jump:


User(s) browsing this thread: 1 Guest(s)

Contact Us | MyBB | Return to Top | Return to Content | Lite (Archive) Mode | RSS Syndication