Using HTML to create custom BB Codes.
If you do not have HTML enabled on your board, then you must create a custom BB code to be able to use HTML formatting. This is because most HTML formatting codes do not come as a default BB code.
In this post:
- Strike-through Code
- Spoiler Code
- Create link to profile
- Moderator/Administrator Notes
~~~~~~~~~~~~~~~
Strike-Through Code
In this example, we will be demonstrating how to create a Strike-through BB code.
This code can normally be applied via HTML with this code:
HTML Code:
<strike>Text here</strike>
To do this, go to:
AdminCP -> Custom BB Codes -> Add New BB Code
Enter this information in the boxes:
Title: Strike or Strikethrough (whatever you wish to call it).
Tag: strike
Replacement: <strike>{param}</strike>
Example: [strike]Test[/strike]
Description: {optional text you desire}
Use Option: No
Button Image: Path to the image to be displayed on the toolbar when making a post (optional).
Now you should be able to make a post on your forum, and use this code:
Code:
[strike]Text here[/strike]
Many other HTML formatting codes can be implemented with this method.
~~~~~~~~~~~~~~~
Spoiler Tag:
It may seem like it's not possible to use the Spoiler tagin vBulletin, but you can do so using the method above, but filling in this information:
Title: Spoiler
Tag: spoil
Replacement:
HTML Code:
<div id="spoiler"><div><input type="button" value="Show Spoiler!" style="width:100px;font-size:12px;margin:10px;padding:0px;" onclick="if (this.parentNode.parentNode.getElementsByTagName('div')['show'].style.display != '') { this.parentNode.parentNode.getElementsByTagName('div')['show'].style.display = ''; this.parentNode.parentNode.getElementsByTagName('div')['hide'].style.display = 'none'; this.innerText = ''; this.value = 'Hide Spoiler!'; } else { this.parentNode.parentNode.getElementsByTagName('div')['show'].style.display = 'none'; this.parentNode.parentNode.getElementsByTagName('div')['hide'].style.display = ''; this.innerText = ''; this.value = 'Show Spoiler!'; }" /> <div id="show" style="background-image:url(http://img37.picoodle.com/img/img37/5/11/7/f_backgroundm_872c796.png); display: none; background-color:transparent; background-repeat:repeat; margin: 0px;border-style:solid;border-width:1px; padding: 4px; width:98%"> {param}</div> <div id="hide"></div></div></div>
Use Option: No
~~~~~~~~~~~~~~~
Automatic Link to profile
A member recently asked how to do this, so I will just post it here too.
What this does is allows you to enter "[profile]USERNAME[/profile]" and it will automatically become a link to the profile of USERNAME.
Using the above method, enter this information:
Title: Profile
BB Code Tag Name: profile
Replacement: <a href="www.yoursite.com/member.php?username={param}">{param}</a>
Example: [profile]Nick[/profile]
Use Option: "No"
Remove tag if empty: Yes.
In my example, since I used "profile" as my BB Code Tag Name, then in a post I would use "[profile]Nick[/profile]" and the outcome would be a link to my profile.
You can change that to whatever you desire, though.
~~~~~~~~~~~~~~~
Distinguish Moderator/Administrator Notes in a thread.
See my Template Modification at vBulletin.org to know how to make Moderator/Administrator notes stand out in a thread, here: