Custom BBCodes [Deprecated]

Get help developing custom BBCodes or request one.
User avatar
elephantspike
Registered User
Posts: 192
Joined: Thu Oct 13, 2005 6:08 am
Location: Fort Lauderdale, FL
Contact:

clickable anchor text box for url tag

Post by elephantspike » Tue Jan 06, 2009 1:25 am

I know how to format it manually to add clickable text links instead of showing the whole url, i.e.

[url=http://www.somesite.com/file.php?abunch ... awholeline]A Short Clickable Link[/url]

But on my phpbb2 site I had a bb code MOD that made a console pop-up when you click the url bb button and you enter the url and then it prompts you to enter the text link and it formats the BBcode for you.

Anyone know the one I'm talking about?

Is there something like that for phpBB3 yet?

Gunnar
Registered User
Posts: 55
Joined: Sun Sep 09, 2007 11:54 am

Re: Custom BBCodes

Post by Gunnar » Thu Jan 08, 2009 8:39 pm

Proper way of embeding videos:

Image

Usage:

Code: Select all

[youtube]http://www.youtube.com/watch?v={SIMPLETEXT}[/youtube]
HTML replacement: (i know it's a lot)

Code: Select all

<div style="width: 430px; text-align: center; padding: 3px; background-color: #FFFFFF; border: 1px solid #d8d8d8; font-size: 1em;">
	<div style="text-transform: uppercase; border-bottom: 1px solid #CCCCCC; margin-bottom: 3px; font-size: 0.8em; font-weight: bold; display: block;">
		<span 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.innerHTML = '<b>Youtube Video:  </b><a href=\'#\' onClick=\'return false;\'>hide</a>'; } else { this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display = 'none'; this.innerHTML = '<b>Youtube Video:  </b><a href=\'#\' onClick=\'return false;\'>show</a>'; }" />
			<b>Youtube Video:  </b>
			<a href="#" onClick="return false;">show</a>
		</span>
	</div>
	<div class="quotecontent">
		<div style="display: none;">
			<object width="425" height="350"><param name="movie" value="http://www.youtube.com/v/{SIMPLETEXT}&autoplay=1"></param><param name="wmode" value="transparent"></param><embed src="http://www.youtube.com/v/{SIMPLETEXT}&autoplay=1" type="application/x-shockwave-flash" wmode="transparent" width="425" height="350"></embed></object>
		</div>
	</div>
</div>
Help Line:

Code: Select all

[youtube]http://www.youtube.com/watch?v=vtE6VKSiVkA[/youtube]
enjoy,

P.s. this code can be used for anything, just add it after <div style="display: none;"> and before the </div> and it will be hidden in there, just remember to replace YouTube Video: with what you are using.

p.s.2. code adapted from this: http://www.icyphoenix.com/viewtopic.php?t=4043

EDIT: HTML Replacement updated a tiny tiny bit - 10. Jan 2009
Last edited by Gunnar on Sat Jan 10, 2009 1:43 am, edited 1 time in total.

ValorSolo
Registered User
Posts: 84
Joined: Mon Nov 13, 2006 9:54 am
Contact:

Re: Custom BBCodes

Post by ValorSolo » Fri Jan 09, 2009 8:54 pm

Can anyone see what is wrong with this code.
HTML

Code: Select all


<div class="top-head-right"><img src="http://valorsolo.com/styles/prosilver/theme/images/top-right.png" alt="" /></div><div class="top-head-left"><img src="http://valorsolo.com/styles/prosilver/theme/images/top-left.png" alt="" /></div><div class="top-head-bg"><ul class="topiclist"><li class="header"><dl><dt>Info</dt></dl></li></ul></div><div style="border: red solid 1px; padding: 10px;"><p>{text}</p></div><div class="bottom-head-right"><img src="http://valorsolo.com/styles/prosilver/theme/images/bottom-right.png" alt="" /></div><div class="bottom-head-left"><img src="http://valorsolo.com/styles/prosilver/theme/images/bottom-left.png" alt="" /></div><div class="bottom-head-bg"></div>
BBCode

Code: Select all

[info]{text}[/info]
This is what it should look like.
I use the same code in bbcode.html for my code box and also my quote box.
Both of those work good.
But this one displays as typed. example:

Code: Select all

[info]just put anything here[/info]
Image

User avatar
Brf
Support Team Member
Support Team Member
Posts: 51726
Joined: Tue May 10, 2005 7:47 pm
Location: {postrow.POSTER_FROM}
Contact:

Re: Custom BBCodes

Post by Brf » Fri Jan 09, 2009 9:10 pm

It should be {TEXT} not {text}

You also need that somewhere in your replacement code.

ValorSolo
Registered User
Posts: 84
Joined: Mon Nov 13, 2006 9:54 am
Contact:

Re: Custom BBCodes

Post by ValorSolo » Fri Jan 09, 2009 9:17 pm

Brf wrote:It should be {TEXT} not {text}

You also need that somewhere in your replacement code.

Well that was simple, thanks.

User avatar
DB Cooper
Registered User
Posts: 40
Joined: Mon May 21, 2007 9:14 pm
Location: North of Boston

Re: Custom BBCodes

Post by DB Cooper » Sat Jan 10, 2009 12:53 am

YouTube changed from WWW to UK, so I changed the codes for my BB code button, and the video show/hide thing shows up in preview, but once I submit, it's just text.

Yipes!

Here's what I have:

BB Code Usage:

Code: Select all

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

Code: Select all

<div style="padding: 3px; background-color: #FFFFFF; border: 1px solid #d8d8d8; font-size: 1em;">
   <div style="text-transform: uppercase; border-bottom: 1px solid #CCCCCC; margin-bottom: 3px; font-size: 0.8em; font-weight: bold; display: block;">
      <span 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.innerHTML = '<b>Youtube Video:  </b><a href=\'#\' onClick=\'return false;\'>hide</a>'; } else { this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display = 'none'; this.innerHTML = '<b>Youtube Video:  </b><a href=\'#\' onClick=\'return false;\'>show</a>'; }" />
         <b>Youtube Video:  </b>
         <a href="#" onClick="return false;">show</a>
      </span>
   </div>
   <div class="quotecontent">
      <div style="display: none;">
         <object width="425" height="350"><param name="movie" value="http://uk.youtube.com/v/{SIMPLETEXT}&autoplay=1"></param><param name="wmode" value="transparent"></param><embed src="http://uk.youtube.com/v/{SIMPLETEXT}&autoplay=1" type="application/x-shockwave-flash" wmode="transparent" width="425" height="350"></embed></object>
      </div>
   </div>
</div>
If I put the entire URI in between the tags, I can view the video in preivew:
Picture 8.png
I get to see the video in Preview
Picture 8.png (13.24 KiB) Viewed 919 times
...but once it's submitted I just see a text string:
http://uk.youtube.com/watch?v=goWsuJlHMC4

Meh!
Life is Grand.
DB-Cooper.com

User avatar
DB Cooper
Registered User
Posts: 40
Joined: Mon May 21, 2007 9:14 pm
Location: North of Boston

Re: Custom BBCodes

Post by DB Cooper » Sat Jan 10, 2009 1:15 am

Well, dang. Now that I've gone back to the message board, it's working.

http://www.vo-bb.com/eggman/phpBB3/view ... hp?f=2&t=3

Can't complain!!

This is my test forum, to debug as much stuff as I can before I convert my old phpBB2 forum over.
Last edited by DB Cooper on Sat Jan 10, 2009 2:48 pm, edited 1 time in total.
Life is Grand.
DB-Cooper.com

Francisco.phpBB
Registered User
Posts: 235
Joined: Fri Dec 03, 2004 2:21 pm
Location: ßrazil (UTC -3)

Re: Can I use {URL} into JavaScrip?

Post by Francisco.phpBB » Sat Jan 10, 2009 3:52 am

ric323 wrote:
Francisco.phpBB wrote:What means, this Custom BBCodes rule?

Code: Select all

{URL} A valid URL using any protocol (http, ftp, etc… cannot be used for javascript exploits). If none is given, "http://" is prefixed to the string.
Can I use {URL} into JavaScript?
No. The comment is saying that only a genuine URL will be accepted. It specifically stops any javascript from running, as people can use that to try to break into your board.
Thank You ric323
URL standard BBCode has 2 forms: {URL} or {TEXT}
How can I construct a BBCode like this, with 2 forms, without JavaScript?

User avatar
ric323
Former Team Member
Posts: 22909
Joined: Tue Feb 06, 2007 12:33 am
Location: Melbourne, Australia
Name: Ric
Contact:

Re: Can I use {URL} into JavaScrip?

Post by ric323 » Sat Jan 10, 2009 6:21 am

Francisco.phpBB wrote:...
URL standard BBCode has 2 forms: {URL} or {TEXT}
How can I construct a BBCode like this, with 2 forms, without JavaScript?
As far as phpBB is concerned, they are two different bbcodes.
Enter definitions for each, and you will have one for: "url", and another for "url=".
The Knowledge Base contains solutions to many common problems!
How to fix "Doesn't have a default value" and "Incorrect string value: xxx for column 'post_text' " errors.
How to do a clean re-install of the latest phpBB3 version.
Problems with permissions? Read phpBB3 Permissions

User avatar
elephantspike
Registered User
Posts: 192
Joined: Thu Oct 13, 2005 6:08 am
Location: Fort Lauderdale, FL
Contact:

Re: Can I use {URL} into JavaScrip?

Post by elephantspike » Sat Jan 10, 2009 8:19 am

ric323 wrote:
Francisco.phpBB wrote:...
URL standard BBCode has 2 forms: {URL} or {TEXT}
How can I construct a BBCode like this, with 2 forms, without JavaScript?
As far as phpBB is concerned, they are two different bbcodes.
Enter definitions for each, and you will have one for: "url", and another for "url=".

Aha! That answers my question as well.

Thank you.

Francisco.phpBB
Registered User
Posts: 235
Joined: Fri Dec 03, 2004 2:21 pm
Location: ßrazil (UTC -3)

Re: Custom BBCodes

Post by Francisco.phpBB » Sat Jan 10, 2009 2:10 pm

Thanks ric323, once again.
Francisco

tzanampeths
Registered User
Posts: 4
Joined: Mon Dec 08, 2008 11:24 pm

Re: Yet another Youtube BBCode

Post by tzanampeths » Sat Jan 10, 2009 7:21 pm

nicholas.alipaz wrote:
tzanampeths wrote:
nicholas.alipaz wrote:...
FWIW I use the following that also seems to work ok:

Code: Select all

[youtube]{TEXT1}watch?v={IDENTIFIER}{TEXT2}[/youtube]

Code: Select all

<object width="425" height="350">
	<param name="movie" value="{TEXT1}v/{IDENTIFIER}"></param>
	<embed src="{TEXT1}v/{IDENTIFIER}" type="application/x-shockwave-flash" width="425" height="350"></embed>
</object><br />
<a href="{TEXT1}watch?v={IDENTIFIER}{TEXT2}" target="_blank"></a><br />
All the best,

Takis
Thanks for the info, but how does this {IDENTIFIER} code work. I have never seen this code used in custom bbcodes.

Does the user have to specify anything other than the url? Additionally, does it allow for any version of the url to be posted? The IDENTIFIER thing seems as though it could simplify the code I posted a bit if I used it and it works sort of like you posted. Thanks.
Sorry for the late reply...

The url versions tested are:
http://www.youtube.com/watch?v=E6jxlkff ... re=related
and
http://www.youtube.com/watch?v=E6jxlkffMcA

The {IDENTIFIER} does not match the &. {TEXT2} is actually optional. Obviously it doesn't have to be "http://www.youtube.com", {TEXT1} will match everything up to "watch?v=".

Hope this helps

Takis

tonaldo
Registered User
Posts: 2
Joined: Sun Jan 11, 2009 12:11 pm

Re: Custom BBCodes

Post by tonaldo » Sun Jan 11, 2009 12:14 pm

nice guys, thanks , very handy :)

action_man
Registered User
Posts: 656
Joined: Wed May 22, 2002 10:15 am
Location: England Nr Europe
Contact:

Re: Custom BBCodes

Post by action_man » Sun Jan 11, 2009 3:25 pm

I have added a few new BBcodes, but now there nearly at the edge of the page, so what i would like to know is, how do i get to start a new line ?, and place the new BBcodes there ...
Untitled-1.jpg
Untitled-1.jpg (61.37 KiB) Viewed 982 times

action_man
Registered User
Posts: 656
Joined: Wed May 22, 2002 10:15 am
Location: England Nr Europe
Contact:

Re: Custom BBCodes

Post by action_man » Sun Jan 11, 2009 6:19 pm

Ignore my last post please, just be a little dumb :( ...

Locked

Return to “Custom BBCode Development and Requests”