vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   $bbuserinfo in php dosn't work >< (https://vborg.vbsupport.ru/showthread.php?t=172011)

drbuddha 03-03-2008 09:17 PM

$bbuserinfo in php dosn't work ><
 
Hey all,

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

PHP Code:

$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[buddylist] works! the output is an array of user id's.

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

Quote:

Originally Posted by nexialys (Post 1456264)
vbuserinfo

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

drbuddha 03-03-2008 09:32 PM

Quote:

Originally Posted by Boofo (Post 1456275)
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:
PHP Code:

$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 [DATE]1204589481[/DATE] at [TIME]1204589481[/TIME] ---------------

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

PHP Code:

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

Quote:

Originally Posted by Boofo (Post 1456325)
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! ;)


All times are GMT. The time now is 04:54 PM.

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.01139 seconds
  • Memory Usage 1,747KB
  • 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
  • (16)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