Bug strange php error at top of thread (only on first page of the thread)

Status
Not open for further replies.

Jeremy

Customer
this is at the very top of the page on one page of one thread:

screenshot20110113at458.png


http://www.belltreeforums.com/showthread.php?56768-The-quot-Temporary-Shoutbox-quot-thread
 
When you hard refresh, does it go away?

If not, edit (forum)/dbtech/credits/credits_core.php and find

PHP:
$charge = array_keys(unserialize($post['chargecontent']));

directly above that line, put

PHP:
var_dump($post['chargecontent']); exit;

then reload the thread again - the page will be blank with some output at the top.

copy and paste here that output, and then remove the line you just added. we will continue there.
 
Oh, a hard refresh like that. My bad. XD (Command+Shift+R for Mac)

Anyway, this is what it said:

string(110) "a:1:{s:32:"1dd9afc6e42bdb02c2d7528a5c1a87d2";a:2:{i:0;s:38:"mod note: sorry, glitch, had to delete";i:1;d:5;}}"
 
Hm, that looks okay. Can you put the line back, only this time without the exit; at the end. Should show the the normal page with some output at the top - paste all of that output here.
 
string(110) "a:1:{s:32:"1dd9afc6e42bdb02c2d7528a5c1a87d2";a:2:{i:0;s:38:"mod note: sorry, glitch, had to delete";i:1;d:5;}}" string(2) "N;"
Warning: array_keys() [function.array-keys]: The first argument should be an array in [path]/dbtech/credits/credits_core.php on line 679

Warning: array_merge() [function.array-merge]: Argument #2 is not an array in [path]/dbtech/credits/credits_core.php on line 681
 
There was one. I deleted it because I figured it might be that. But the error stayed.

it was charge = 5 with "._." inside it

test:
[charge=5]._.[/charge]
 
lol, well that worked here. anyway, to fix:

find in (forum)/dbtech/credits/credits_core.php file:

PHP:
    function cache_charge()
    {    //build charge info for later
        global $post, $vbulletin, $chargeown, $chargelook;

        if ($post['chargecontent'])
        {    //charge content saved
            $charge = array_keys(unserialize($post['chargecontent']));
            if ($vbulletin->userinfo['userid'] == $post['userid'])  $chargeown = ( $chargeown ? array_merge($chargeown, $charge) : $charge  );
            else $chargelook = ( $chargelook ? array_merge($chargelook, $charge) : $charge );
        }
    }

replace with

PHP:
    function cache_charge()
    {    //build charge info for later
        global $post, $vbulletin, $chargeown, $chargelook;

        if ($post['chargecontent'] AND is_array($content = unserialize($post['chargecontent'])))
        {    //charge content saved
            $charge = array_keys($content);//sometime wasnt array
            if ($vbulletin->userinfo['userid'] == $post['userid']) $chargeown = ( $chargeown ? array_merge($chargeown, $charge) : $charge );
            else $chargelook = ( $chargelook ? array_merge($chargelook, $charge) : $charge );
        }
    }
 
OK, I'll try that in a minute. So is this a permanent fix?

And will you include the fix in the file for everyone on the next version? (otherwise I would lose it when uploading the new one?)
 
Status
Not open for further replies.

Similar threads

Legacy vBCredits II Deluxe

vBulletin 3.8.x vBulletin 4.x.x
Seller
DragonByte Technologies
Release date
Last update
Total downloads
846
Customer rating
0.00 star(s) 0 ratings
Back
Top