![]() |
Variable for userid
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. |
Quote:
You were missing the ' ' |
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. |
I'm using it in a query like this
Code:
WHERE userid = '".$prepared['userid']."' |
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... :confused:
--------------- Added 12 Apr 2009 at 21:26 --------------- Okay, that isn't working either. Here's my plugin: Code:
$blocklist = array_merge($blocklist, array( 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. |
Try this.
Code:
$blocklist = array_merge($blocklist, array( |
Nope, no dice. Have no clue what the problem is :(
The tab doesn't even appear with this code. |
Quote:
|
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. |
Quote:
Code:
$usersid = $prepared['userid']; Also try adding the following the the function as well: Code:
global $vbulletin, $prepare; |
I'm not sure what you mean... :confused: Where do I place those?
Please forgive my ignorance in this field. |
Code:
$blocklist = array_merge($blocklist, array( |
Success!!!!
Thank you SO VERY MUCH. I really appreciate it. :cool: |
Quote:
|
All times are GMT. The time now is 02:38 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 | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|