News:

SMF 2.1.4 has been released! Take it for a spin! Read more.

Main Menu

New row bbc

Started by MarkoWeb, April 06, 2007, 07:36:43 AM

Previous topic - Next topic

MarkoWeb

How to create new row with bbc buttons,
Something like on picture.


Daniel15

Do you want your own custom BBCode buttons in the new row? If so, I believe the Custom BBCode mod works quite well for  this :)

Or, do you want to move some of the existing buttons into that row? If so, what buttons would you like to put there?
Daniel15, former Customisation team member, resigned due to lack of time. I still love everyone here :D.
Go to smfshop.com for SMFshop support, do NOT email or PM me!

MarkoWeb

I want some new bbc buttons... but i don't want to install some mod

Kindred

why do you not want to install a mod?   The mod does just what you are asking for.
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

MarkoWeb

That is not that what I searching for.
Mode buttons put into the same line.
I need that they be in next line, like is picture showing

Daniel15

#5
QuoteI want some new bbc buttons... but i don't want to install some mod
OK, well, the BBCode buttons are defined in Themes/default/Post.template.php:

// The below array makes it dead easy to add images to this page. Add it to the array and everything else is done for you!
$context['bbc_tags'] = array();
$context['bbc_tags'][] = array(
'bold' => array('code' => 'b', 'before' => '[b]', 'after' => '[/b]', 'description' => $txt[253]),
'italicize' => array('code' => 'i', 'before' => '[i]', 'after' => '[/i]', 'description' => $txt[254]),
'underline' => array('code' => 'u', 'before' => '[u]', 'after' => '[/u]', 'description' => $txt[255]),
'strike' => array('code' => 's', 'before' => '[s]', 'after' => '[/s]', 'description' => $txt[441]),
array(),
'glow' => array('code' => 'glow', 'before' => '[glow=red,2,300]', 'after' => '[/glow]', 'description' => $txt[442]),
'shadow' => array('code' => 'shadow', 'before' => '[shadow=red,left]', 'after' => '[/shadow]', 'description' => $txt[443]),
'move' => array('code' => 'move', 'before' => '[move]', 'after' => '[/move]', 'description' => $txt[439]),
array(),
'pre' => array('code' => 'pre', 'before' => '[pre]', 'after' => '[/pre]', 'description' => $txt[444]),
'left' => array('code' => 'left', 'before' => '[left]', 'after' => '[/left]', 'description' => $txt[445]),
'center' => array('code' => 'center', 'before' => '[center]', 'after' => '[/center]', 'description' => $txt[256]),
'right' => array('code' => 'right', 'before' => '[right]', 'after' => '[/right]', 'description' => $txt[446]),
array(),
'hr' => array('code' => 'hr', 'before' => '[hr]', 'description' => $txt[531]),
array(),
'size' => array('code' => 'size', 'before' => '[size=10pt]', 'after' => '[/size]', 'description' => $txt[532]),
'face' => array('code' => 'font', 'before' => '[font=Verdana]', 'after' => '[/font]', 'description' => $txt[533]),
);
$context['bbc_tags'][] = array(
'flash' => array('code' => 'flash', 'before' => '[flash=200,200]', 'after' => '[/flash]', 'description' => $txt[433]),
'img' => array('code' => 'img', 'before' => '[img]', 'after' => '[/img]', 'description' => $txt[435]),
'url' => array('code' => 'url', 'before' => '[url]', 'after' => '[/url]', 'description' => $txt[257]),
'email' => array('code' => 'email', 'before' => '[email]', 'after' => '[/email]', 'description' => $txt[258]),
'ftp' => array('code' => 'ftp', 'before' => '[ftp]', 'after' => '[/ftp]', 'description' => $txt[434]),
array(),
'table' => array('code' => 'table', 'before' => '[table]', 'after' => '[/table]', 'description' => $txt[436]),
'tr' => array('code' => 'td', 'before' => '[tr]', 'after' => '[/tr]', 'description' => $txt[449]),
'td' => array('code' => 'td', 'before' => '[td]', 'after' => '[/td]', 'description' => $txt[437]),
array(),
'sup' => array('code' => 'sup', 'before' => '[sup]', 'after' => '[/sup]', 'description' => $txt[447]),
'sub' => array('code' => 'sub', 'before' => '[sub]', 'after' => '[/sub]', 'description' => $txt[448]),
'tele' => array('code' => 'tt', 'before' => '[tt]', 'after' => '[/tt]', 'description' => $txt[440]),
array(),
'code' => array('code' => 'code', 'before' => '[code]', 'after' => '[/ code]', 'description' => $txt[259]),
'quote' => array('code' => 'quote', 'before' => '[quote]', 'after' => '[/quote]', 'description' => $txt[260]),
array(),
'list' => array('code' => 'list', 'before' => '[list]\n[list][li]', 'after' => '[/li][/list]\n[list][li][/li][/list]\n[/list]', 'description' => $txt[261]),
);



To add your own BBCode buttons on their own row, add something like this below the bit I pasted above:

$context['bbc_tags'][] = array(
'test' => array('code' => 'test', 'before' => 'Before', 'after' => 'After', 'description' => 'Just an example'),
'test2' => array('code' => 'test2', 'before' => '[test2]', 'after' => '[/test2]', 'description' => 'Test BBCode 1'),
);

These are just test values, and but they should be self-explanatory.

However, this just adds the BBCode button. If you add a BBCode that's already built-in to SMF, it will work fine, however, a custom one won't (such as the [test2][/test2] above). To add your own custom one, you'll need to edit Sources/Subs.php. The BBCodes are defined under this like:

$codes = array(

. There's a huge comment above that line that explains what everything does.

Hope this helps :)

EDIT: If you want to move some of the existing buttons into a new row, you'd cut them from their existing place, and paste them into a new section (replace test and test2 in the example I posted above)[/code]
Daniel15, former Customisation team member, resigned due to lack of time. I still love everyone here :D.
Go to smfshop.com for SMFshop support, do NOT email or PM me!

MarkoWeb

That doesn't work, can't create button

That mode, you gave me, does it put buttons in quick reply, or just in reply?

Kindred

there ar eno buttons in quick reply...   Quick reply is QUICK...  not exta junk cluttering up the screen.

The code that Daniel posted will affect the REPLY and POST screens...
the mod that was posted above will add new BBC codes...
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

Jack_Elixir

where is above code in 2.0.9 ? it's not in Post.template

Branko.

Sources/Subs-Editor.php
find
// The below array makes it dead easy to add images to this control. Add it to the array and everything else is done for you!
Please note that looks different..
Strong people don't put others down, they lift them up.
A clever person solves a problem. A wise person avoids it.

Jack_Elixir

any way to put one or two BB code buttons in quick reply


2.0.9 default theme

Branko.

It is possible, but not easy.  :D
Why not put whole WYSIWYG editor using a modification WYSIWYG Quick Reply v2 ? Look for features in the description of this modification. Perhaps more convenient for you?
Strong people don't put others down, they lift them up.
A clever person solves a problem. A wise person avoids it.

Jack_Elixir

this mod is good but shows all button and also TINYPIC  abd it's too much, i just need one IMG BB Code button , please guide if we can do it

Branko.

Sorry, no way. Anyway with Quick-Reply you can still use bulletin board code as you would in a normal post.
Strong people don't put others down, they lift them up.
A clever person solves a problem. A wise person avoids it.

Kindred

Also, given the fact that you have removed the copyright info for smf as well as every mod gat you have installed, I think that mod authors will be unlikely to provide you with support or customization by your request...
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

Advertisement: