Page 1 of 267

Custom BBCodes [Deprecated]

Posted: Tue Sep 11, 2007 3:34 am
by Marshalrusty
This topic is now deprecated. Please create your own topics in this forum if you need assistance.


Below are the popular custom BBCodes that are frequently asked for on this board. All in one place with descriptions and screenshots for your convenience :)

To use any of the following custom BBCodes, navigate to the Posting => BBCodes section of the phpBB3 administration panel and click the "Add a new BBCode" button. Enter the respective code from below into the "BBCode usage" and "HTML replacement" boxes.

Index Youtube (embed video in post)
  • Using the full URI
    • Description: Allows you to embed Youtube videos in your posts using the full URI of the video.
      Demo:
      Image

      BBCode usage:

      Code: Select all

      [youtube]http://www.youtube.com/watch?v={SIMPLETEXT}[/youtube]
      HTML Replacement:

      Code: Select all

      <object width="425" height="350"><param name="movie" value="http://www.youtube.com/v/{SIMPLETEXT}"></param><param name="wmode" value="transparent"></param><embed src="http://www.youtube.com/v/{SIMPLETEXT}" type="application/x-shockwave-flash" wmode="transparent" width="425" height="350"></embed></object>
    Using only the video ID
    • Description: Allows you to embed Youtube videos in your posts using only the video id.
      Demo:
      Image

      BBCode usage:

      Code: Select all

      [youtube]{SIMPLETEXT}[/youtube]
      HTML Replacement:

      Code: Select all

      <object width="425" height="350"><param name="movie" value="http://www.youtube.com/v/{SIMPLETEXT}"></param><param name="wmode" value="transparent"></param><embed src="http://www.youtube.com/v/{SIMPLETEXT}" type="application/x-shockwave-flash" wmode="transparent" width="425" height="350"></embed></object>
Google Video (embed video in post)
  • Using the full URI
    • Description: Allows you to embed Google videos in your posts using the full URI of the video.
      Demo:
      Image

      BBCode usage:

      Code: Select all

      [googlevid]http://video.google.com/videoplay?docid=-{NUMBER}[/googlevid]
      HTML Replacement:

      Code: Select all

      <embed style="width:400px; height:326px;" id="VideoPlayback" type="application/x-shockwave-flash" src="http://video.google.com/googleplayer.swf?docId={NUMBER}&hl=en" flashvars=""></embed>
    Using only the video ID
    • Description: Allows you to embed Google videos in your posts using only the video id.
      Demo:
      Image

      BBCode usage:

      Code: Select all

      [googlevid]{NUMBER}[/googlevid]
      HTML Replacement:

      Code: Select all

      <embed style="width:400px; height:326px;" id="VideoPlayback" type="application/x-shockwave-flash" src="http://video.google.com/googleplayer.swf?docId={NUMBER}&hl=en" flashvars=""></embed>
Align (left, center, right)
  • Description: Allows you to align text/images to the left/right/center.
    Demo:
    Image

    Center
    • BBCode usage:

      Code: Select all

      [center]{TEXT}[/center]
      HTML Replacement:

      Code: Select all

      <div align="center">{TEXT}</div>
    Right
    • BBCode usage:

      Code: Select all

      [right]{TEXT}[/right]
      HTML Replacement:

      Code: Select all

      <div align="right">{TEXT}</div>
    Left
    • BBCode usage:

      Code: Select all

      [left]{TEXT}[/left]
      HTML Replacement:

      Code: Select all

      <div align="left">{TEXT}</div>
      Hint: Unless you use a RTL (right to left) language, everything will align to the left by default anyway.
Horizontal rule
  • Description: Inserts a horizontal rule (line) into a post.
    Demo:
    Image

    BBCode usage:

    Code: Select all

    [hr]{IDENTIFIER}[/hr]
    HTML Replacement:

    Code: Select all

    <hr title="{IDENTIFIER}" />
Spoiler
  • Description: Adds a black background color to the text between the tags, making it unreadable unless higlighted. Unlike the other methods of going about this, this code does not use Javascript (which some users disable) and is therefore, at least in my opinion, the best way to do it.
    Demo:
    Image

    BBCode usage:

    Code: Select all

    [spoiler]{TEXT}[/spoiler]
    HTML Replacement:

    Code: Select all

    <span style="background:#000000">{TEXT}</span>
To be added soon:
- background color
- <strike>
- <sub>
- <sup>
- rtl text
- font
- etc.

If you have any suggestions or find an error in the above article, please do not hesitate to PM me.

For more BBCodes see this knowledge base article: Adding Custom BBCodes in phpBB3

Re: Custom BBCodes

Posted: Tue Sep 11, 2007 7:04 am
by dumdum1974
Maybe this is stupid question :lol: but I tought:
Is it possible to have media media player embedded in forum lets say like you have external link for your movie than you add BBcode and player starting like with those 2 of google and youtube?

btw: GREAT POST M8 ;)

Re: Custom BBCodes

Posted: Tue Sep 11, 2007 1:21 pm
by RedTrinity
[Edit: ric323. Please see the reply from Marshalrusty a few more posts down. The listed bbcodes ARE correct.]

Marshalrusty, I think the You Tube codes are mixed up?

[youtube]http://youtube.com/watch?v={TEXT}[/youtube] = option using just video ID

[youtube]{TEXT}[/youtube] = option using full URL

Just thought I would let you know as you appear to have them back to front ;)

Otherwise this is a fantastic thread, thanks for the assistance with BBCodes!

Re: Custom BBCodes

Posted: Tue Sep 11, 2007 2:42 pm
by jnhrtmn
Is it possible to indent the first line of a paragraph with a custom bbcode?

Re: Custom BBCodes Indented Paragraphs

Posted: Tue Sep 11, 2007 4:40 pm
by jnhrtmn
I figured out a way to indent the first line of a paragraph. In the Posting/bbcodes panel:

Code: Select all

[Tab]{TEXT}[/Tab]

Code: Select all

<span style="margin-left: {TEXT}px;"></span>
You get this,
[Tab][/Tab]
Enter a number between them that will be a margin measured in pixels.
[Tab]35[/Tab] Creates a normal indent. I'm not sure about other browsers' style issues (other than IE).

Re: Custom BBCodes

Posted: Tue Sep 11, 2007 10:09 pm
by Marshalrusty
RedTrinity wrote:Marshalrusty, I think the You Tube codes are mixed up?

[youtube]http://youtube.com/watch?v={TEXT}[/youtube] = option using just video ID

[youtube]{TEXT}[/youtube] = option using full URL

Just thought I would let you know as you appear to have them back to front ;)
I believe you are mistaken :)

Note my HTML replacement.
jnhrtmn wrote:I figured out a way to indent the first line of a paragraph. In the Posting/bbcodes panel:

Code: Select all

[Tab]{TEXT}[/Tab]

Code: Select all

<span style="margin-left: {TEXT}px;"></span>
You get this,
[Tab][/Tab]
Enter a number between them that will be a margin measured in pixels.
[Tab]35[/Tab] Creates a normal indent. I'm not sure about other browsers' style issues (other than IE).
If you're going to do that, then change the {TEXT} to {NUMBER}. It's a good idea to keep tags as tight as possible.

Re: Custom BBCodes

Posted: Wed Sep 12, 2007 1:19 am
by N.emesis
Ive added the BBcode but nothing happens when i post. I dont see the video.

I used this:

Code: Select all

[youtube]http://youtube.com/watch?v={SIMPLETEXT}[/youtube]
And this for the html right:

Code: Select all

<object width="425" height="350"><param name="movie" value="http://www.youtube.com/v/{SIMPLETEXT}"></param><param name="wmode" value="transparent"></param><embed src="http://www.youtube.com/v/{TEXT}" type="application/x-shockwave-flash" wmode="transparent" width="425" height="350"></embed></object>

Well ive done that and nothing happens. One note to is the video still able to work when the url changes to htt://nl.youtube.com/watch?v=32DF3e3 Because its automatically being added by youtube because i live in The Netherlands.

so what could possibly been wrong?

Re: Custom BBCodes

Posted: Wed Sep 12, 2007 1:22 am
by N.emesis
I found the problem that was causing that it was this:

Code: Select all

[youtube]http://youtube.com/watch?v={SIMPLETEXT}[/youtube]

The SIMPLETEXT code was somehow not the good one and i changed it to:

Code: Select all

[youtube]http://youtube.com/watch?v={TEXT}[/youtube]

So works perfectly,good job for these mods keep up the good work.

Re: Custom BBCodes

Posted: Wed Sep 12, 2007 2:11 am
by Marshalrusty
There was an error in the above code. I had accidentally left {TEXT} in one place and put {SIMPLETEXT] in another. Please grab the updated code above.

Re: Custom BBCodes

Posted: Wed Sep 12, 2007 2:31 am
by kidgeon
First off, beautiful post :) Just one note, at first I couldnt get the youtube url code to work, but after adding the "www" in the code it made the difference.

[youtube]http://youtube.com/watch?v={SIMPLETEXT}[/youtube]

I changed it to

[youtube]http://www.youtube.com/watch?v={SIMPLETEXT}[/youtube]


Thanks a million

Re: Custom BBCodes

Posted: Wed Sep 12, 2007 4:49 am
by N.emesis
Marshalrusty,

one question i got is when im viewing a video on youtube and click and copy the wacth link this is included:

Code: Select all

http://nl.youtube.com/watch?v=0BDyqwwEdt4

You see the nl is being included so you have to manually remove it when you try let it work so it be like this:

Code: Select all

http://youtube.com/watch?v=0BDyqwwEdt4

Is there a way to add some thing in the code without having to remove the nl ?

Re: Custom BBCodes

Posted: Wed Sep 12, 2007 5:05 am
by Marshalrusty
Depending on the domain name you enter to view Youtube, it will show videos using a different subdomain (http://www.youtube.com, uk.youtube.com, etc.). In this case, the BBCode would only work with the domain that you configure. So if you have http://www.youtube.com, then everyone would need to change the URI to that to get it to work.

If you have an international site where people might be viewing Youtube from different domains, then you might want to use the second method that only asks for the id: http://www.phpbb.com/community/viewtopi ... 6#youtube2

Re: Custom BBCodes

Posted: Wed Sep 12, 2007 11:06 pm
by Brian_RTL
Great job getting these all in one locatinon Marshalrusty! I'm bookmarking this thread.

Does anyone else need a non-breaking space (&nbsp;)? That's the only other BBCode I've added.

I've been messing around with adding form tags with BBCode. Has great scorn already been heaped on this idea in a different thread that someone could point me to? I assume the security risks might be too high, even in a private forum but it would be nice to have a simpler creation method for small forms.

Re: Custom BBCodes

Posted: Fri Sep 14, 2007 12:53 am
by Gunnar
i reccomend updating the first post with all fixes and such


MSN Soapbox:

BBCode usage:

Code: Select all

[soapbox]http://soapbox.msn.com/video.aspx?vid={SIMPLETEXT}[/soapbox]
HTML Replacement:

Code: Select all

<embed src="http://images.soapbox.msn.com/flash/soapbox1_1.swf" quality="high" width="432" height="364" wmode="transparent" type="application/x-shockwave-flash" pluginspage="http://macromedia.com/go/getflashplayer" flashvars="c=v&v={SIMPLETEXT}" ></embed>

Re: Custom BBCodes

Posted: Fri Sep 14, 2007 12:55 am
by the_nanobreaker
Thanx to all.