BB Button Code

BB Button Code 1.3.2

No permission to download
This add-on is not affiliated with XenForo Ltd.

OVERVIEW


This add on adds a new BBCode that allows you to create buttons.

The buttons can be used anywhere that accepts BBCode input including XenPorta and many other add-ons.

button_xf.webp


For example, the above button is created with the following BB Code

Code:
[button="size='extralarge' text='XenForo' desc='The best forum software' style='gradient' new='yes' bgcolor='#A12621' textcolor='white'"] http://www.xenforo.com [/button]

Here's the full available syntax:

[button="
bgcolor='#FF8411|#555|red|black|#1A1A1A'
style='gradient|[B]normal[/B]'
text='BIG BUTTONS'
desc='I like big buttons and I cannot lie'
title='SEO Friendly Title'
size='small|[B]medium[/B]|large|extralarge'
textcolor='black|#555|#FFFFFF|red'
new='yes|[B]no[/B]'
width='400px'
nofollow='yes|[B]no[/B]'
margin='none|[B]narrow[/B]|medium|wide|extrawide'
"] http://www.valvetime.net [/button]

As you can see you can literally create a button or set of buttons with as many different styles as you like. Each option changes a certain part of the HTML code or CSS.

The options in bold above are those which are default if they aren't specified.

You can configure text or bg colours with any hex value or otherwise compatible CSS value such as red, white, black etc. including RGB syntax.

IMPORTANT NOTE REGARDING URLS

XenForo quite helpfully automatically parses URLs for you and at this moment in time there isn't a definitive fix for this problem with regards to BBCode. There is an add on here which does fix this problem, but it doesn't work with XenPorta. So I've decided it shouldn't be a requirement to use this add on. And instead I have implemented a different workaround.

Note the syntax above. There must always be a space before and after the URL. This ensures that when the URL is parsed, it doesn't mess up the rest of the button code.

My code then strips out the autoparsed URL tags before building the HTML code.

PERMISSIONS

Currently this BB Code can be used by anyone on your forums. However, the help code for this BB Code is by default hidden from all but moderators and admins. Permissions may be looked at in a future version.

SPECIAL THANKS

To yavuz who requested this add on and for helping me to bug test it :)
Author
Chris D
Downloads
162
Views
1,554
First release
Last update

Ratings

5.00 star(s) 3 ratings

More resources from Chris D

Latest updates

  1. Fixes a few undefined errors

    Fixes a bunch of potential "undefined" exception errors.

Latest reviews

I was bugging the person in charge of visual things in our forum for a button so that people would be more interested in clicking the Podcast. This is exactly what I needed. Thank you!
Thank you for keeping the addon up to date Chris.
Thank YOU! GOOD!
A good addition to my current BBCODE set. Excellent work Yorick, thanks for all your hard work :)
Chris D
Chris D
Thank you yavuz :)
Top Bottom