miniBB Support Forums | 15 years on The Web
miniBB ®


 | Forums | Register | Reply | Search | Statistics | Manual |
Custom Tutorials and Modifications miniBB Support Forums / Custom Tutorials and Modifications /   

showing specific BB codes button only for certain users

Author USB2.0
#1 | Posted: 12 Jun 2007 23:01 
"sorry my bad english"

yeah! read the title... "how to show a specific buttom for cetain user?"

for example the IMAGE BUTTON show only for user id 7 and 16.

:S thx M)

Author Paul
Lead Developer
#2 | Posted: 13 Jun 2007 03:56 
That's simple. Instead of writing HTML code straight away in the template, you should put it in some variable in bb_plugins.php. This variable will have an empty value, if the user ID condition is not met; value of HTML code otherwise. Example below.

- bb_plugins.php:

if(in_array($user_id, array(7,16))){
<a href="JavaScript:paste_strinL('', 3, '[imgs='+prompt('URL:',''+'/img/!pix.gif')+']', prompt('{$l_promptAlt}','')+'[/imgs]', '')" onmouseover="window.status='{$l_bb_image}'; return true" onmouseout="window.status=''; return true"><img src="" style="width:23px;height:22px" alt="{$l_bb_image}" /></a> 
else $bbCodeImg='';

- templates/main_post_form.html:


I think you must tie up this solution also with one you have requested here. ;-) So certain users not only won't see the button, but also are prohibited use some functional code from bb_codes.php in general.

Author USB2.0
#3 | Posted: 13 Jun 2007 10:24 
thank you very much Paul, you are my God :D

Author Paul
Lead Developer
#4 | Posted: 13 Jun 2007 13:00 
Thanks :-)

I am just a regular human though. God is not a person ;-)

Custom Tutorials and Modifications miniBB Support Forums / Custom Tutorials and Modifications /
 showing specific BB codes button only for certain users
 Share Topic's Link

Your Reply Click this icon to move up to the quoted message

You are welcome to post anonymously, by entering a nickname with no password (if the similar Username has not been taken yet), or by leaving both fields empty. If you have a forums account, you can also sign in from this page without posting a message, or sign in and post at once.

Before posting, make sure your message is compliant with our forum posting rules. If not, it may be locked or deleted with no explanation.

miniBB Support Forums Powered by Forum Software miniBB ® Home  Features  Requirements  Demo  Download  Showcase  Gallery of Arts
Compiler  Premium Extensions  Premium Support  License  Contact Us
Proceed with the Captcha add-on: protect your miniBB-forums from the automated spam and flood.