1 (edited by axelnormand 2007-03-20 10:46)

Topic: Cannot use string offset as an array

hiya,
i've just moved hosting companies so had to copy the punbb db accross.

It was on mysql 4.1 now on mysql 5. PHP was 4.4 now 5.2.  Was Apache, now Apache 2. both times on linux.

Now when try to view posts i get this message, but not all the time....

Fatal error: Cannot use string offset as an array in /home/axelnormand/webapps/htdocs/punbb/include/functions.php on line 1153

EDIT: line 1153 is....

$pun_user['read_topics']['t'][$topic_id] = time();

the bit of code surrounding that is

    function mark_topic_read($topic_id, $forum_id, $last_post) {

    global $db, $pun_user;
    
    if (topic_is_new($topic_id, $forum_id, $last_post)) {
        $pun_user['read_topics']['t'][$topic_id] = time();
        $db->query('UPDATE '.$db->prefix.'users SET read_topics=\''.$db->escape(serialize($pun_user['read_topics'])).'\' WHERE id='.$pun_user['id']) or error('Unable to update read-topic data', __FILE__, __LINE__, $db->error());
    }
}

Any ideas?

many thanks, punbb is great BTW!

alex

Re: Cannot use string offset as an array

There's no line 1153 in a default PunBB setup: you'll need to copy/paste your line

Re: Cannot use string offset as an array

thanks, i've updated my original post above

Re: Cannot use string offset as an array

hmm more investingation reveleas that the mark_topic_read is part of the Mark topics as read plugin.... i shall investigate further