News:

Bored?  Looking to kill some time?  Want to chat with other SMF users?  Join us in IRC chat or Discord

Main Menu

BBC Code button only for some membergroup?

Started by edi67, October 23, 2008, 02:53:00 PM

Previous topic - Next topic

edi67

How i could create one BBC code button visible only for certain membergroup?

thx
CrazyZone - My SMF Forum


From the difficult the hardening of the man you can see

ccbtimewiz


edi67

Quote from: ccbtimewiz on October 23, 2008, 03:09:09 PM
Just the button or the function itself?

Well just button for now, the function already exist but is hidden for all

is possible to have the function too only for certain usergroup?
CrazyZone - My SMF Forum


From the difficult the hardening of the man you can see

ディン1031

#3
First search in Subs-Editor.php for


'hr' => array('code' => 'hr', 'before' => '[hr]', 'description' => $txt['horizontal_rule']),
);


add after


//Okay now Add some Custom Group related buttons ;D
global $user_info;
// Show the toggle?
if ($user_info['is_admin'] || in_array(2, $user_info['groups']))
{
$context['bbc_tags'][1][] = array();
$context['bbc_tags'][1]['mycodename'] = array('code' => 'tt', 'before' => '[tt]', 'after' => '[/tt]', 'description' => $txt['teletype']);
}


This add to the second line add the end a small space an this new button (Before the remover and the the toggle button)

each line

$context['bbc_tags'][1]['mycodename'] = array('code' => 'tt', 'before' => '[tt]', 'after' => '[/tt]', 'description' => $txt['teletype']);

is a new button.

Short description:

The mycodename will be the image name mycodename.gif. That file need to be stored into the bbc folder of the default theme image folder or the current theme image folder depend on the theme ;).


'code' => 'tt',

This is the name of the bbc.


'before' => '[tt]',

this is the name of the start tag


'after' => '[/tt]',

this is the name of the end tag, if you only need start tag don't insert that.

If you mark something in the post the before and after will be put before and after the select.


'description' => $txt['teletype']

That what is say a description, you can use string here if you don't like to create the $txt string :x.

Bye
DIN1031
Support only via MOD Thread! NO PM Support!
My Forum: ayu][kult Forum
My Mods: My Small Mod Collection
My Parser: DIN1031's ModParser
Current Info: More away the next days, because i've to much work to do :x

edi67

Hey DIN you know that i appreace a lot your time spent with me ;) thx very much your help work perfectly :) great DIN
CrazyZone - My SMF Forum


From the difficult the hardening of the man you can see

Advertisement: