miniBB ® 

miniBB

®
Support Forums
  
 | Start | Register | Search | Statistics | File Bank | Manual |
Custom Tutorials and Modifications miniBB Support Forums / Custom Tutorials and Modifications /  
 

showing specific BB codes button only for certain users

 
Author USB2.0
Guest
#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))){
$bbCodeImg=<<<out
<a href="JavaScript:paste_strinL('', 3, '[imgs='+prompt('URL:','{$main_url}'+'/img/!pix.gif')+']', prompt('{$l_promptAlt}','')+'[/imgs]', '')" onmouseover="window.status='{$l_bb_image}'; return true" onmouseout="window.status=''; return true"><img src="https://www.minibb.com/forums/img/button_image.gif" style="width:23px;height:22px" alt="{$l_bb_image}" /></a> 
out;
}
else $bbCodeImg='';

- templates/main_post_form.html:

{$bbCodeImg}

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
Guest
#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


  ?
Post as a Guest, leaving the Password field blank. You could also enter a Guest name, if it's not taken by a member yet. Sign-in and post at once, or just sign-in, bypassing the message's text.


Before posting, make sure your message is compliant with forum rules; otherwise it could be locked or removed 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 Private Messaging add-on: allow your miniBB-forums members to communicate with each other.


  ⇑