vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   Warning: array_merge() ERROR (https://vborg.vbsupport.ru/showthread.php?t=91871)

tscbh 07-09-2005 10:38 AM

Warning: array_merge() ERROR
 
I read through some of the similar error message from this forum, but I got a very weird problem. Yes, I am using vb 3.0.7 and running php5 under windows. The actually error message was:

Quote:

Warning: array_merge() [function.array-merge]: Argument #2 is not an array in \online.php on line 285;
When I first view who's online page, there is no error. 60 seconds later when WOL auto refresh I got that error message. Could any one tell me how I can fix this.

I follow the suggestion from Xenon(busy admin) https://vborg.vbsupport.ru/showthrea...28%29+Argument

I put the following section of code on online.php before global.php is called, but I still get the same error message:

Quote:

// ################### PRE-CACHE TEMPLATES AND DATA ######################
// get special phrase groups
$phrasegroups = array();

// get special data templates from the datastore
$specialtemplates = array();

// pre-cache templates used by all actions
$globaltemplates = array();

// pre-cache templates used by specific actions
$actiontemplates = array();
If anyone have any suggestion, please let me know.
Thanks in advance.

Xenon 07-09-2005 11:58 AM

can you post some lines around 285

it just means that ther secund argument isn't an array, maybe you ahve installed an hack, and the hack author didn't initialize the variables properly

tscbh 07-09-2005 12:06 PM

Here are the line around 285 on the online.php file:

PHP Code:

if (!$foundviewer AND $bbuserinfo['userid'] AND ($who == '' OR $who == 'members'))
// Viewing user did not show up so fake him
    
$userinfo["$bbuserinfo[userid]"] = $bbuserinfo;
    
$userinfo["$bbuserinfo[userid]"]['location'] = '/online.php';
    
$userinfo["$bbuserinfo[userid]"]['host'] = IPADDRESS;
    
$userinfo["$bbuserinfo[userid]"]['lastactivity'] = TIMENOW;
    
$userinfo["$bbuserinfo[userid]"]['joingroupid'] = iif($bbuserinfo['displaygroupid'] == 0$bbuserinfo['usergroupid'], $bbuserinfo['displaygroupid']);
    
$userinfo["$bbuserinfo[userid]"]['musername'] = fetch_musername($userinfo["$bbuserinfo[userid]"], 'joingroupid');
    
$userinfo["$bbuserinfo[userid]"]['hidden'] = iif($bbuserinfo['invisible'], '*');
    
$userinfo["$bbuserinfo[userid]"]['invisible'] = 0;

[
285]    $userinfo[$bbuserinfo['userid']] = array_merge($userinfo["$bbuserinfo[userid]"] , construct_im_icons($userinfo["$bbuserinfo[userid]"]));
    if (
$vboptions['WOLresolve'] AND ($permissions['wolpermissions'] & CANWHOSONLINEIP))
    {
        
$userinfo[$bbuserinfo['userid']]['host'] = @gethostbyaddr($userinfo["$bbuserinfo[userid]"]['host']);
    }



I installed, vbStatistic, vbAdvance, referral statistic, ushop & ucash, paypal reoccuring payment. I am not sure if I got too much hacks installed!

Anyway, thanks for your help Xenon.

Xenon 07-09-2005 12:13 PM

PHP Code:

$userinfo[$bbuserinfo['userid']] = array_merge($userinfo["$bbuserinfo[userid]"] , construct_im_icons($userinfo["$bbuserinfo[userid]"])); 

the array_merge is wrong here. construct_im_icons() doesn't return an array.

change the line into
PHP Code:

construct_im_icons($userinfo); 

that should work then

tscbh 07-09-2005 12:19 PM

Thanks so much Xenon, that's the quickest response I ever get. But I still get the same problem. I change to
Quote:

$userinfo[$bbuserinfo['userid']] = array_merge($userinfo["$bbuserinfo[userid]"] , construct_im_icons($userinfo));
as you told me. It didn't work. Same problem!

Xenon 07-09-2005 12:26 PM

you missunderstood my post.

you have to replace the complete line, not just that part ;)


All times are GMT. The time now is 10:03 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01177 seconds
  • Memory Usage 1,746KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (3)bbcode_php_printable
  • (3)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (6)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete