Page 118 of 267

clickable anchor text box for url tag

Posted: Tue Jan 06, 2009 1:25 am
by elephantspike
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?

Re: Custom BBCodes

Posted: Thu Jan 08, 2009 8:39 pm
by Gunnar
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

Re: Custom BBCodes

Posted: Fri Jan 09, 2009 8:54 pm
by ValorSolo
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

Re: Custom BBCodes

Posted: Fri Jan 09, 2009 9:10 pm
by Brf
It should be {TEXT} not {text}

You also need that somewhere in your replacement code.

Re: Custom BBCodes

Posted: Fri Jan 09, 2009 9:17 pm
by ValorSolo
Brf wrote:It should be {TEXT} not {text}

You also need that somewhere in your replacement code.

Well that was simple, thanks.

Re: Custom BBCodes

Posted: Sat Jan 10, 2009 12:53 am
by DB Cooper
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:
I get to see the video in Preview
I get to see the video in Preview
Picture 8.png (13.24 KiB) Viewed 1321 times
...but once it's submitted I just see a text string:
http://uk.youtube.com/watch?v=goWsuJlHMC4

Meh!

Re: Custom BBCodes

Posted: Sat Jan 10, 2009 1:15 am
by DB Cooper
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.

Re: Can I use {URL} into JavaScrip?

Posted: Sat Jan 10, 2009 3:52 am
by Francisco.phpBB
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?

Re: Can I use {URL} into JavaScrip?

Posted: Sat Jan 10, 2009 6:21 am
by ric323
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=".

Re: Can I use {URL} into JavaScrip?

Posted: Sat Jan 10, 2009 8:19 am
by elephantspike
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.

Re: Custom BBCodes

Posted: Sat Jan 10, 2009 2:10 pm
by Francisco.phpBB
Thanks ric323, once again.
Francisco

Re: Yet another Youtube BBCode

Posted: Sat Jan 10, 2009 7:21 pm
by tzanampeths
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

Re: Custom BBCodes

Posted: Sun Jan 11, 2009 12:14 pm
by tonaldo
nice guys, thanks , very handy :)

Re: Custom BBCodes

Posted: Sun Jan 11, 2009 3:25 pm
by action_man
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 1460 times

Re: Custom BBCodes

Posted: Sun Jan 11, 2009 6:19 pm
by action_man
Ignore my last post please, just be a little dumb :( ...