![]() |
Help with hiding postbit buttons from guests
1 Attachment(s)
I added 2 plugins to add a "Send PM" button and a "Add Friend" button to the bottom of the postbit. The only problem is, they are visible to everyone, including users not logged in. The other default buttons are only visible to Logged-In users, so it looks weird to see only the 2 buttons visible.
Here is my code for the "Add Friend" button: Plugin PHP Code Code:
Here is my code for the "Send PM" button: Plugin PHP Code Code:
The uploaded attachment is a screenshot of the postbit buttons from Guest View. |
I believe a way to check if the user is logged in is to check if the $vbulletin->userinfo['userid'] variable is set
|
Quote:
I tried that, but nothing happens. |
Can you copypaste the code here?
|
Quote:
I tried this: Code:
|
We want to see the code with your added condition that you tried.
Also, what hook locations? What was the result? What is the full code (your's don't have closing "if" tags)? Can you explain exactly what your code is supposed to do? |
Quote:
Here is a screenshot of the plugin I created. The plugin just adds an "Add Friend" button at the bottom of the postbit, right next to the "Edit Post" and "Quote" buttons: https://vborg.vbsupport.ru/external/2014/07/33.png Here is an image of the plugin being rendered on the postbit: https://vborg.vbsupport.ru/external/2014/07/34.png I just need to know how to get the buttons to show only to "Registered Users". Right now everyone can see the button, including Guests. As you can see in the second screenshot, just the 2 buttons are being shown, and not the rest. Thats because the other buttons are the default buttons, and they only show up if the User is Logged-In. --------------- Added [DATE]1405653842[/DATE] at [TIME]1405653842[/TIME] --------------- Never mind. I found out a way to do this. I disabled the plugins I created, and just put the code directly into the template. Right before the "Edit Post" button is rendered, I added this code for the PM and Add Friend buttons: Code:
Anyways, Thank you everyone for trying to help me!! I greatly appreciate your time! |
All times are GMT. The time now is 04:16 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:
|