miniBB ®
 
miniBB Community Forum
 | Forums | File Bank | Sign Up | Reply | Search | Statistics | Manual |
Private Messaging addon for miniBB Allow your miniBB-forums members communicate with each other tet-a-tet with the Private Messaging add-on!
Custom Tutorials and Modifications miniBB Community Forum / Custom Tutorials and Modifications /
Short link for this topic:

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
CEO
#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
CEO
#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 Community Forum / 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

» Username  » Password 
You are welcome to post anonymously by entering a nickname with no password (if that nickname has not been taken by another member) or by leaving both fields empty. If you have a forums membership 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 Community Forum Powered by Free Forum Software miniBB ® Features  Requirements  Demo  Download  Showcase  Gallery of Arts
Compiler  Premium Extensions  Premium Support  License  Contacts