![]() |
Custom Banned Reason Template
1 Attachment(s)
Custom Banned Reason Template
How can I pull the banned reason message that we type into the vbAdminCP when we ban a member? I am trying to create a custom page that has the info but the calls for that phrase show blank when I make my own template for it. Code:
<!-- BANNED REASON --> I want to be able to use the info in my attached image in my own template. |
Where is your template used? I'm asking because you can't necessarily just use a phrase in your template and have the reason filled in. You would need to have code (like in a plugin) read the reason from the database first. The exception might be if your template happens to be used in a place where it's already been read (like if you're just trying to replace the standard error message template).
But maybe you already know all that - in that case, check out the function print_no_permission() in includes/functions.php. |
I plan to use it in a vbadvanced cmps block. I want to pull the banned reason to show inside a vba block. Other VB phrases seem easy to pull but this one is proving to be difficult. :(
|
Oh...In that case you did understand all that and I didn't understand the question. Sorry.
|
Oh im with you I just am lost as to how to get the message to show in a vba block. I am gonna need some help with this one.
|
...but I think I might know what the problem is: that phrase is in a phrase group that isn't loaded. The error message functions call function fetch_phrase() in includes/functions_misc.php to load it when needed.
|
You I found that out and do not how to proceed. I am guessing I am going to have to code my own plug-in??? to pull the data from the database in a similar manner that is done in the functions.php
I was hoping there was another easier way... |
Well, you didn't ask but I thought I'd do it anyway:
PHP Code:
I tried this using the global_start hook, I don't know if it's the best hook to use but none of the vba_ hooks I tried worked. |
Thanks for the help... what am I to do with your code exactly to be able to create a vba block?
|
It depends on what kind of vBa module you're working with. It looks like you wanted to use it in a template, so you could create a new plugin with hook location "global_start" and use the above code (remember to select "Yes" to make it active), then put $bbuserinfo[banned_reason_text] in the template where you want the text to appear (it will be blank if the user isn't banned).
If you were making a php-type module you could use the above code directly in the module instead of creating a plugin. |
All times are GMT. The time now is 11:12 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 | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|