The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
||||
|
||||
![]()
I have created plugin for the member_build_blocks_start hook and I need to use the UserID variable. I've tried a slew of things such as:
$user['userid'] $prepared[userid] $bbuserinfo[userid] And none of them work. What is the proper variable to use? Thanks. |
#2
|
|||
|
|||
![]() Quote:
You were missing the ' ' |
#3
|
||||
|
||||
![]()
For some reason, it's not working. Whenever I use that variable, the entire plugin just stops working.
I know for sure that it's this variable causing the problem because when I change it to something else or remove it, it works fine. I thought maybe I need to escape the single-quotes so I inserted backslashes before each one ($prepared[\'userid\']). The plugin worked when I did this, but the variable didn't parse. I simply gave "$prepared[\'userid\']" as the output. I don't know what the problem is. |
#4
|
|||
|
|||
![]()
I'm using it in a query like this
Code:
WHERE userid = '".$prepared['userid']."' |
#5
|
||||
|
||||
![]()
I'm not using it in a query; I'm using it in a plugin. I'm not sure if it makes a difference though...
![]() --------------- Added 12 Apr 2009 at 21:26 --------------- Okay, that isn't working either. Here's my plugin: Code:
$blocklist = array_merge($blocklist, array( 'licenses' => array( 'class' => 'licenses', 'title' => 'User Licenses', 'hook_location' => 'profile_left_last' ) )); class vB_ProfileBlock_licenses extends vB_ProfileBlock { var $template_name = 'memberinfo_block_licenses'; function confirm_empty_wrap() { return false; } function confirm_display() { return ($this->block_data['licenses'] != ''); } function prepare_output($id = '', $options = array()) { $this->block_data['licenses'] = '<iframe src="http://www.mydomain.net/admincp/vbma_admin.php?do=viewuserslicenses&userid=userIDhere" width="100%"></iframe>'; } } So now here is the list of things I've tried (in place of the red code): $user['userid'] $prepared[userid] $prepared['userid'] '".$prepared['userid']."' ... and none of them work. |
#6
|
|||
|
|||
![]()
Try this.
Code:
$blocklist = array_merge($blocklist, array( 'licenses' => array( 'class' => 'licenses', 'title' => 'User Licenses', 'hook_location' => 'profile_left_last' ) )); class vB_ProfileBlock_licenses extends vB_ProfileBlock { var $template_name = 'memberinfo_block_licenses'; function confirm_empty_wrap() { return false; } function confirm_display() { return ($this->block_data['licenses'] != ''); } function prepare_output($id = '', $options = array()) { $outdata = "<iframe src=\"http://www.mydomain.net/admincp/vbma_admin.php?do=viewuserslicenses&userid=\".$prepared['userid']."\" width=\"100%\"></iframe>"; $this->block_data['licenses'] = $outdata; } } |
#7
|
||||
|
||||
![]()
Nope, no dice. Have no clue what the problem is
![]() The tab doesn't even appear with this code. |
#8
|
|||
|
|||
![]()
Does the iframe page exist or did you change the URL in my code? The tab won't display if theres no data assigned to the variable.
|
#9
|
||||
|
||||
![]() Quote:
In other words, if I place nothing after userid=, it works. If I put a number in there such as '1', it works. Apparently, we haven't found the right variable for the userId. |
#10
|
|||
|
|||
![]() Quote:
Code:
$usersid = $prepared['userid']; Also try adding the following the the function as well: Code:
global $vbulletin, $prepare; |
![]() |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|