![]() |
How to check in sidebar (forum blocks) if user is logged in?
How can I check in the forum blocks that are displayed in the new sidebar whether a user is logged in, and display different content accordingly?
I tried the old... Code:
// IF THE USER IS LOGGED IN |
in php, you use $vbulletin->userinfo, not $bbuserinfo. And, in the blocks it *may* be vB::$vbulletin->userinfo.
|
Thanks - the following worked:
Code:
if (vB::$vbulletin->userinfo[userid]) |
echo is the culprit. Look at the template the output is going to and the name of the variable you should be using is in there (I can't remember it - it might be $output, but may be something else).
To find the template to modify, do this - vboptions > General Settings > Add Template Name in HTML Comments > set to Yes . Then go back to your page and view the source code and you will see the name of the template called around your part of the code. |
The template is block_html and in that template I found the following variable: {vb:raw content}
I was not sure how to modify that variable though. Then I found this, and it seems to work: Code:
if (vB::$vbulletin->userinfo[userid]) |
All times are GMT. The time now is 07:05 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:
|