miniBB ® miniBB®
miniBB Support Forums
 | 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
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="{$main_url}/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 Top

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

 Short link for this topic:

 ?
Only registered users are allowed to post here. Please, enter your username/password details upon posting a message, or register first.


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 ® Features  Requirements  Demo  Download  Showcase  Gallery of Arts
Compiler  Premium Extensions  Premium Support  License  Contacts
Try the Captcha add-on: protect your miniBB-forums from the automated spam and flood.
Captcha Addon for miniBB