Custom BBCodes [Deprecated]

Get help developing custom BBCodes or request one.
Locked
User avatar
davaguco
Registered User
Posts: 179
Joined: Thu Jul 28, 2005 5:57 pm
Location: España
Name: DAVID AGULLO
Contact:

Re: Custom BBCodes

Post by davaguco »

Christian Ankerstjerne wrote:To the moderators: I'm not sure where to post this - if this is wrong, feel free to move it to a more appropriate section.

I know that there's a custom BBCode table tutorial out there, but I thought I'd share my take on it anyway.

Custom BBCode
BBCode usage lines

Code: Select all

[table]{TEXT}[/table]
[trow]{TEXT}[/trow]
[theader]{TEXT}[/theader]
[tmultiheader={NUMBER}]{TEXT}[/tmultiheader]
[tcell]{TEXT}[/tcell]
[tmulticell={NUMBER}]{TEXT}[/tmulticell]
HTML replacement lines

Code: Select all

<table class="customtable">{TEXT}</table>
<tr>{TEXT}</tr>
<th>{TEXT}</th>
<th colspan="{NUMBER}">{TEXT}</th>
<td>{TEXT}</td>
<td colspan="{NUMBER}">{TEXT}</td>
Suggested help lines (optional)

Code: Select all

Creates a table
Table row (only for use inside a [table])
Table header (only for use inside a [trow])
Table header, spanning over multiple columns (only for use inside a [trow])
Table cell (only for use inside a [trow])
Table cell, spanning over multiple columns (only for use inside a [trow])
CSS for style sheet (optional)

Code: Select all

table.customtable {
  border-collapse: collapse;
}

table.customtable td, table.customtable th {
  border: 1px solid #000000;
}

table.customtable td[colspan], table.customtable th[colspan] {
  text-align: center;
}
Sample usage
BBCode

Code: Select all

[table]
  [trow]
    [tmultiheader=4]Table example[/tmultiheader]
  [/trow]
  [trow]
    [theader]Table header 1[/theader]
    [tcell]Table cell 1[/tcell]
    [tcell]Table cell 2[/tcell]
    [tcell]Table cell 3[/tcell]
  [/trow]
  [trow]
    [theader]Table header 2[/theader]
    [tmulticell=2]Table cell 4[/tmulticell]
    [tcell]Table cell 5[/tcell]
  [/trow]
[/table]
Visual rendering

Code: Select all

+------------------------------------------------------------+
|                       Table example                        |
+---------------+--------------+--------------+--------------+
|Table header 1 | Table cell 1 | Table cell 2 | Table cell 3 |
+---------------+--------------+--------------+--------------+
|Table header 2 |         Table cell 4        | Table cell 5 |
+---------------+-----------------------------+--------------+
Notes
You might want to style the tables further, above I have only included the style for centering cells spanning more than one cell width (this won't work with IE6, though, but you can add an additional class and CSS declaration to take care of that), as well as added a border (I made it black in the example, change to suit your forum's style).

I didn't include the THEAD and TBODY elements, since few users would know how to use them properly anyway. I didn't use TR, TH and TD for the BBCode, as I figure the names I've used would be easier to understand for the users who is not familiar with HTML. Also, this allows for easier coding of cells spanning more than one cell width (the other solution I've seen made the COLSPAN-declaration mandatory for all cells, resulting in a lot of verbose output (i.e. TD COLSPAN="1").

Feel free to use this BBCode on your forum.
I cant make this work on my forum, it says something about an invalid form being used for my BBCode.
David.
English-Spanish Mod Translator. Send me a PM if you need anything translated (usually free unless you need a fixed finishing date).
bpx
Registered User
Posts: 40
Joined: Wed Jan 02, 2008 11:53 am

Re: Custom BBCodes

Post by bpx »

I have enabled the [flash] bbcode. How can I post .swf with peram name?
example:

Code: Select all

<param name=bgcolor value=#DFEEF5>
319
Registered User
Posts: 144
Joined: Fri Dec 21, 2007 12:47 am
Contact:

Re: Custom BBCodes

Post by 319 »

BBCOdes
bpx
Registered User
Posts: 40
Joined: Wed Jan 02, 2008 11:53 am

Re: Custom BBCodes

Post by bpx »

Er, how exactly with BBCodes?

thanks for help
MarcioFs
Registered User
Posts: 2
Joined: Tue Jan 08, 2008 9:27 pm

Re: Custom BBCodes

Post by MarcioFs »

Hi all,


I need a help

In my old forum (phpbb2.x), before migration to olympus, when a put one image into a post, using Image

I know that I can create bbcode, for that, but, my question is:

How can I change defaul [img] tag , to do this as a default tag?

In old forum, the defaul tag without a box and buttom was [img2].

Is there a mod to do this? or not?

Sorry for my english.

Thansk for all.
killer-kurt
Registered User
Posts: 37
Joined: Tue Jan 01, 2008 10:50 pm

Re: Custom BBCodes

Post by killer-kurt »

There i was looking at another forum looking at a mod to do the alignment for text and images. Then! i come across all this LOL thanks for that!
User avatar
ThunderCrew
Registered User
Posts: 1438
Joined: Sat Jun 30, 2007 6:26 pm
Location: Ill, Usa
Contact:

Re: Custom BBCodes

Post by ThunderCrew »

After reading every single post for 11 pages, looking for some useful codes to use or to learn from,
I myself got tired of reading the many "you tube isnt working posts". Number 1 it will work IF you
use the proper coding and proper url specific text as described by the many replies.

NOW, for my 2 cents :roll: there is not really any need to add the youtube bbcode. As youtube videos
are converted to flash I merley embed the video url into a flash tag VIA the installed bbcode flash in phpbb3
like so

Code: Select all

[flash=400,400]http://www.youtube.com/v/tgsHV9FEJdU&rel=1[/flash]
and VIOLA it works
same as the youtube custom bbcode tag :ugeek: Simply by grabbing the movie value url from the given embed code.

Ok back to page number 12 of my reading.

P.S. I have not tried it with google video etc because I've never tried those other sites.
But, if they are similar may work the same :idea:
Ugg im a t0tal newb again ...... 2 years off cant remember jack ... time to get to it
User avatar
ThunderCrew
Registered User
Posts: 1438
Joined: Sat Jun 30, 2007 6:26 pm
Location: Ill, Usa
Contact:

Re: Custom BBCodes

Post by ThunderCrew »

topdown wrote:
crackerboy wrote:How can i make a BBCode where the post si so long that it is usefull with a text saying Read More?
Spoiler to show and hide a large post inside a quote style box

BBCode usage box

Code: Select all

[spoiler]{TEXT}[/spoiler]
HTML replacement box

Code: Select all

<div style="margin:20px; margin-top:5px"><div class="quotetitle"><b>READ MORE:</b> <input type="button" value="Show" style="width:45px;font-size:10px;margin:0px;padding:0px;" onclick="if (this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display != '') { this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display = '';        this.innerText = ''; this.value = 'Hide'; } else { this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display = 'none'; this.innerText = ''; this.value = 'Show'; }" /></div><div class="quotecontent"><div style="display: none;">{TEXT}</div></div></div>
You want to be sure that there are no spaces in the HTML replacement text.

Help line box

Code: Select all

Show and Hide a large post
Kudos :D very nice
Ugg im a t0tal newb again ...... 2 years off cant remember jack ... time to get to it
User avatar
ThunderCrew
Registered User
Posts: 1438
Joined: Sat Jun 30, 2007 6:26 pm
Location: Ill, Usa
Contact:

Re: Custom BBCodes

Post by ThunderCrew »

crystalsc wrote:Hello. I'm new here. I have read through all 28 pages but this thread can be a bit confusing, especially with all the different versions of one code. So sorry if I am asking something that seems obvious to someone else.

I would like a code for something similar to the spoiler box where it says "show" and "hide" EXCEPT instead of it saying "spoiler", I want it to say "NOT WORK SAFE". This would be helpful for when people want to post mature content without linking off-site. Is there such a code in existence or is there one that can be easily modified?

Also, am I to understand that there are currently no codes for superscript and subscript or tables?

(and just as a bonus, does anyone remember if there was anything that was like a block quote with a different color background - to save me from having to dig back through 28 pages?)

Thanks for any and all help!!
Didnt see a reply to this one, so I'll do it ,since its simple :arrow:
Just change the word in the code for spoiler from show hide to what you want.
IE: in the line of code look for "SHOW" edit it to "MATURE" or whatever you want.

PS as far as the rest of your question they are in this thread backlogged some pages.
I just read through 28 pages so far. :oops:
Ugg im a t0tal newb again ...... 2 years off cant remember jack ... time to get to it
User avatar
chengdu
Registered User
Posts: 62
Joined: Sun Jan 06, 2008 4:12 am

Re: Custom BBCodes

Post by chengdu »

i have added the youtube code as instructed but cannot work......
http://www.spicycity.cn - The Most Dynamic English Online Community in Chengdu and Chongqing, China
CadiZ
Registered User
Posts: 3
Joined: Tue Dec 11, 2007 10:05 pm

Re: Custom BBCodes

Post by CadiZ »

Hi all, I have implemented different video embedded on phpbb3, I come across a problem I would like to get help with. If the google video has a positive number, there is no problem, but if it shows a negative one, the video won't display. This is the code:

BBCode usage:
[Googlevideo]{NUMBER}[/Googlevideo]

HTML replacement:
<embed style="width:400px; height:326px;" id="VideoPlayback" type="application/x-shockwave-flash" src="http://video.google.com/googleplayer.sw ... BER}&hl=en" flashvars=""></embed>

Help line:
Usage [Googlevideo]Numbers[/Googlevideo]

Thank you in advance.
User avatar
Sr X
Registered User
Posts: 202
Joined: Wed Feb 07, 2007 9:25 am

Re: Custom BBCodes

Post by Sr X »

i want a bbcode (valid with w3c xhtml 1.0 Strict) to align the images and floating, wrap the text around the image.

i have found tow differents bbcodes to this, what is the better? or what is the better way to this? thanks.
oso96_2000 wrote: BBCode:

Code: Select all

[fimg={IDENTIFIER}]{URL}[/fimg]
HTML Replacement:

Code: Select all

<img src="{URL}" alt="{URL}" style="float: {IDENTIFIER}" />
This way i can use [fimg=left]http://image.png[/fimg] to float the image to the left
This way i can use [fimg=right]http://image.png[/fimg] to float the image to the right
nicholasalipaz wrote:Wrap Image

Code: Select all

[imgwrap={TEXT1}]{TEXT2}[/imgwrap]

Code: Select all

<div style="float:{TEXT1};margin: 2px 2px 6px 6px;"><img src="{TEXT2}"></div>

Code: Select all

Wrap Image: [imgwrap=left|right]URL[/imgwrap]
sweetthdevil
Registered User
Posts: 18
Joined: Sun Nov 07, 2004 7:53 pm

Re: Custom BBCodes

Post by sweetthdevil »

Great, i personally took the number 2...
User avatar
libralion
Registered User
Posts: 387
Joined: Tue May 13, 2003 9:25 am

Re: Custom BBCodes

Post by libralion »

ThunderCrew wrote:After reading every single post for 11 pages, looking for some useful codes to use or to learn from,
I myself got tired of reading the many "you tube isnt working posts". Number 1 it will work IF you
use the proper coding and proper url specific text as described by the many replies.

NOW, for my 2 cents :roll: there is not really any need to add the youtube bbcode. As youtube videos
are converted to flash I merley embed the video url into a flash tag VIA the installed bbcode flash in phpbb3
like so

Code: Select all

[flash=400,400]http://www.youtube.com/v/tgsHV9FEJdU&rel=1[/flash]
and VIOLA it works
same as the youtube custom bbcode tag :ugeek: Simply by grabbing the movie value url from the given embed code.

Ok back to page number 12 of my reading.

P.S. I have not tried it with google video etc because I've never tried those other sites.
But, if they are similar may work the same :idea:
Hi Thundercrew,

I had troubles with the BBcode for youtube and photobucket also. Some links did work and others didnot. I tried your flashcode and indeed it works like a charm. Thanks! The strange thing however is, that if you use the default phpBB3 flashcode it doesnot work. You have to add the 400,400 part in the beginning and can change that of course to whatever format you want.
What I also found is that this flashcode of you works with photobucket files. The normal photobucket code also gave me problems with some files. If you choose the embedcode with Photobucket and take out the http bit and paste that between the flashcode from above it works.
So I am gonna use this code from now on and see if all files can be played through it.
Is there anywhere that you can change the default Flashcode? Then I can add the 400, 400 part and everybody on my forum can use this code.

Johanna
Last edited by libralion on Fri Jan 11, 2008 5:36 pm, edited 1 time in total.
CadiZ
Registered User
Posts: 3
Joined: Tue Dec 11, 2007 10:05 pm

Re: Custom BBCodes

Post by CadiZ »

CadiZ wrote:Hi all, I have implemented different video embedded on phpbb3, I come across a problem I would like to get help with. If the google video has a positive number, there is no problem, but if it shows a negative one, the video won't display. This is the code:

BBCode usage:
[Googlevideo]{NUMBER}[/Googlevideo]

HTML replacement:
<embed style="width:400px; height:326px;" id="VideoPlayback" type="application/x-shockwave-flash" src="http://video.google.com/googleplayer.sw ... BER}&hl=en" flashvars=""></embed>

Help line:
Usage [Googlevideo]Numbers[/Googlevideo]

Thank you in advance.
Ok, I have sorted it out now just replace the variable NUMBER by SIMPLETEXT, reason being:

{SIMPLETEXT} Characters from the latin alphabet (A-Z), numbers, spaces, commas, dots, minus, plus, hyphen and underscore

{NUMBER} Any series of digits

Well, the minus sign seems not to be accepted by NUMBER but is by SIMPLETEXT, so let it be it.
Locked

Return to “Custom BBCode Development and Requests”