PDA

View Full Version : $bbuserinfo in php dosn't work ><


drbuddha
03-03-2008, 09:17 PM
Hey all,

I'm trying to activate some php code in the plugin system and that dosn't seem to work :confused:

$selfbuddys = explode(' ', $vbulletin->userinfo['buddylist']);
$yourbuddys = explode(' ', $this->post['buddylist']);
(Hook: postbit_display_start)

The 2nd row works fine (somebody's buddys array). When I'm writing "$yourbuddys[0]" in the tamplate the output is the first userid of the array.

BUT if I writing "$selfbuddys[0]" in the tamplate, nothing!

* $bbuserinfo works! the output is an array of user id's.

[B]So, is there another way to write $bbuserinfo in php? or maybe the Hook is the problem.

If that's not clear, im new to all this php\plugs of vb, but im trying (:

nexialys
03-03-2008, 09:17 PM
vbuserinfo

drbuddha
03-03-2008, 09:21 PM
WOW.. that was quick!! :O
thanks for reply :)

hmm.. the "vbuserinfo" has to written with $this-> OR $vbulletin-> (or something else) before that?

Boofo
03-03-2008, 09:26 PM
vbuserinfo

When did they add that one? I have never heard of it before.

drbuddha
03-03-2008, 09:32 PM
When did they add that one? I have never heard of it before.

it also doesn't work, to me :(
with $this-> OR $vbulletin-> OR nothing of them.

Anybody know about something else? :erm:

Boofo
03-03-2008, 09:34 PM
Try this since it is the postbit:

$postuserinfo['buddylist']);

drbuddha
03-03-2008, 09:41 PM
I don't sure I understand where to put it (Postbit?), cause the problem is in the php code.
At the postbit I need only a var name ($selfbuddys[0]) to display the result (first buddy ID).

In the php code it doesn't seem to work too:
$selfbuddys = explode(' ', $postuserinfo['buddylist']);

Kirk Y
03-03-2008, 09:58 PM
Try globalizing $vbulletin.

global $vbulletin;

drbuddha
03-03-2008, 10:05 PM
huh?

Thanks but I don't understand you. what's the meaning of globalizing vbulletin?
what should I change in the code? :S

--------------- Added 1204589481 at 1204589481 ---------------

At vBulletin.com I was told that I should change the Hook (Now: postbit_display_start) and suggested to ask here for that.

Anybody? :\

(wooo.. that's "Auto-Merged DoublePost" is cool!)

shovel
03-03-2008, 10:39 PM
global $vbulletin;

drbuddha
03-03-2008, 10:50 PM
Ohhhhh!! Just to put that above the first code I posted up there! :D


~ The Penny Dropped ~


It WORKED!!
Thanks!! heepee!! =]

Boofo
03-03-2008, 10:59 PM
Duh! I should gave caught that. I was thinking template.

My coding days are coming to a close.

shovel
03-04-2008, 01:12 AM
Duh! I should gave caught that. I was thinking template.

My coding days are coming to a close.

Oh come on Boofo, these are the best times lol watching people learn to code.

Boofo
03-04-2008, 01:18 AM
True, but it brings out the stupidity in us older coders. ;)

Dismounted
03-04-2008, 04:05 AM
And the memories of getting down-and-dirty with "hacking".

Boofo
03-04-2008, 04:07 AM
LOL Ain't that the truth! ;)