MyBB Community Forums

Full Version: Strange error: Cannot use [] for reading in functions_post.php
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Some of the users of the adsuite plugin reported a strange error to me...
Fatal error: Cannot use [] for reading in /forumdirectory/inc/functions_post.php(620) : eval()'d code on line 64

The plugin does not change anything in this file though...

Line 64 in functions_post.php is
$parser_options['allow_mycode'] = $mybb->settings['pmsallowmycode'];

Anybody having any ideas?

The error still exists after deactivating and uninstalling the plugin completely and removing it from the plugin folder.

It appears only when you try to view a thread.

Cut from the function inside the plugin:
function showpostads($post)
{
$post[$showad5] = "<div>$ad[$zufall]</div>";
}

It's just replacing a var in the template with different content in my opinion...

The plugin has been tested on 7 forums now - all successfully but two boards seem to have problems with it.
Code looks fine to me though...

Kind regards
Lennart Sauter
I used this, and its fine to me also
Issue has been fixed, was a small template problem (one var remained).

Kind regards
Lennart Sauter
Hi, I am getting this error now after I just installed the Adsuite addon.

Fatal error: Cannot use [] for reading in /home/jappleme/public_html/forum/inc/functions_post.php(645) : eval()'d code on line 64

this is line 62 to 70
case 2: // Private message
global $message, $pmid;
$parser_options['allow_html'] = $mybb->settings['pmsallowhtml'];
$parser_options['allow_mycode'] = $mybb->settings['pmsallowmycode'];
$parser_options['allow_smilies'] = $mybb->settings['pmsallowsmilies'];
$parser_options['allow_imgcode'] = $mybb->settings['pmsallowimgcode'];
$parser_options['allow_videocode'] = $mybb->settings['pmsallowvideocode'];
$parser_options['me_username'] = $post['username'];
$parser_options['filter_badwords'] = 1;

Any idea whats going on? Thank you!