Custom BBCodes [Deprecated]

Get help developing custom BBCodes or request one.
sakm
Registered User
Posts: 652
Joined: Sun Jan 21, 2007 8:14 pm
Location: Hull, uk
Name: Stu
Contact:

Re: Custom BBCodes

Post by sakm »

i have got a problem with the spoiler BBcode

when a member uses it everything that is written in the post in the spoiler out the spoiler and even their signiture all the text is made bigger :? any ideas ???

here is the spoiler code

Code: Select all

[spoiler]{TEXT}[/spoiler]

Code: Select all

</span>
    <div class="spoiltitle"><input class="spoilbtn" type="button" value="Show Spoiler" onClick="javascript: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 Spoiler'; } else { this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display = 'none'; this.innerText = ''; this.value = 'Show Spoiler'; }" onfocus="this.blur();">
    </div>
    <div class="spoildiv">
    <div style="display: none;">{TEXT}</div>
    </div>
    <span class="postbody">
thanks stu
nicholas.alipaz
Registered User
Posts: 91
Joined: Fri Jun 15, 2007 12:43 pm
Location: Los Angeles, CA

Re: Custom BBCodes

Post by nicholas.alipaz »

ulong wrote:Is it possible to replace [you] with /you ?
I mean without closing tag/bbcode, just only openning tag [you]
Only if you have access to make an edit within your database.

let me know.
nicholas.alipaz
Registered User
Posts: 91
Joined: Fri Jun 15, 2007 12:43 pm
Location: Los Angeles, CA

Re: Custom BBCodes

Post by nicholas.alipaz »

faqbch99 wrote:I am trying to create a simple clickable image..


Defined in ACP as:
[imglink={text1}]{text2}[/imglink]

<a href="{text1}"><img src="{text2}" border="0" /></a>


I enter this in a post and the post displays the text below, not the image or link.


[imglink=http://www.renegadereefers.org]http://www.renegadereefers.org/images/s ... gblack.gif[/imglink]


Please help..
CAPITALIZE the parts that say {text#}, I think that will fix it.
User avatar
wordeebird
Registered User
Posts: 141
Joined: Fri Dec 10, 2004 7:46 pm
Location: earth, most times
Contact:

Re: Custom BBCodes

Post by wordeebird »

Any thoughts on embedding an mp4 that I'm hosting myself? I still can't figure it out...
sakm
Registered User
Posts: 652
Joined: Sun Jan 21, 2007 8:14 pm
Location: Hull, uk
Name: Stu
Contact:

Re: Custom BBCodes

Post by sakm »

sakm wrote:i have got a problem with the spoiler BBcode

when a member uses it everything that is written in the post in the spoiler out the spoiler and even their signiture all the text is made bigger :? any ideas ???

here is the spoiler code

Code: Select all

[spoiler]{TEXT}[/spoiler]

Code: Select all

</span>
    <div class="spoiltitle"><input class="spoilbtn" type="button" value="Show Spoiler" onClick="javascript: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 Spoiler'; } else { this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display = 'none'; this.innerText = ''; this.value = 'Show Spoiler'; }" onfocus="this.blur();">
    </div>
    <div class="spoildiv">
    <div style="display: none;">{TEXT}</div>
    </div>
    <span class="postbody">
thanks stu
anyone ?? :)
Elyaradine
Registered User
Posts: 22
Joined: Tue Nov 13, 2007 11:00 am
Location: South Africa
Contact:

Re: Custom BBCodes

Post by Elyaradine »

Hi there. :)

Photobucket automatically generates thumbnails for the images you upload, and prefixes the file name with a "th_". Photobucket can automatically generate the thumbnail links for forums for you, but a lot of people don't seem to have that set, and they post large versions of images instead.

The Problem: The BBCode below works sometimes, but not all of the time, and I can't figure out why.

BBCode:

Code: Select all

[pb]{URL}/{IDENTIFIER1}.{IDENTIFIER2}[/pb]
HTML Replacement:

Code: Select all

<a class="postlink" href="{URL}/{IDENTIFIER1}.{IDENTIFIER2}"><img src="{URL}/th_{IDENTIFIER1}.{IDENTIFIER2}" /></a>
This example works:

Code: Select all

[pb]http://i166.photobucket.com/albums/u89/Elyaradine/beans.jpg[/pb]
This example does NOT work:

Code: Select all

[pb]http://i97.photobucket.com/albums/l224/AmandaLemmer/candlecopy.jpg[/pb]
Furthermore, if I include both of the examples above (i.e. one working, and one not working) in the same post, the post comes up blank. I've tested this on a vanilla install. :shock:

Any help would be greatly appreciated.
User avatar
Lumpy Burgertushie
Registered User
Posts: 68556
Joined: Mon May 02, 2005 3:11 am
Contact:

Re: Custom BBCodes

Post by Lumpy Burgertushie »

for one thing th_candlecopy.jpg does not exist at photobucket.


robert
I'm baaaaaccckkkk. still doing work on donation basis. PM your needs.

Premium phpBB 3.3 Styles by PlanetStyles.net

I am pleased to announce that I have completed the first item on my bucket list. I have the bucket.
-Kenichi-
Registered User
Posts: 20
Joined: Thu Oct 23, 2008 9:36 am

Re: Custom BBCodes

Post by -Kenichi- »

Hi,

It has already been ask several times, but I could find it in these topics.
What's the bbcode for [you]?
I really want that one.

You can also answer me by a pm if you want.

Thanx.
Kenichi
Elyaradine
Registered User
Posts: 22
Joined: Tue Nov 13, 2007 11:00 am
Location: South Africa
Contact:

Re: Custom BBCodes

Post by Elyaradine »

Lumpy Burgertushie wrote:for one thing th_candlecopy.jpg does not exist at photobucket.


robert
It does, from what I can see. :? Unless what I'm seeing is a cached image, which it shouldn't be.

This is what should appear:
Image
molgan
Registered User
Posts: 86
Joined: Tue Dec 18, 2007 5:41 pm

Re: Yet another Youtube BBCode

Post by molgan »

nicholas.alipaz wrote:I have seen tons of threads and code for posting youtube videos via bbcode. None of the ones I have ever seen seemed satisfactory.

I wrote one of my own, the bbcode is as simple as it can get and the code will accept any form of youtube url accept the actual embed code.

here it is:

For the BBCode the user may do any of the following and the video will be embedded properly:

Code: Select all

[youtube]http://xxx.youtube.com/watch?v=xxxxxxxxxx[/youtube]

Code: Select all

[youtube]http://xxx.youtube.com/v/xxxxxxxxxx[/youtube]

Code: Select all

[youtube]xxxxxxxxxx[/youtube]
Where: xxx stands for the subdomain (www, or alternate) and xxxxxxxxxx is the id of the video.

Her is what you put in your ACP:

BBCode usage

Code: Select all

[youtube]{TEXT}[/youtube]
HTML replacement

Code: Select all

<script type="text/javascript">
function ytubeGo() {
var ytubeVal = "{TEXT}";
  if(ytubeVal.match("watch")) { //http://www.youtube.com/watch?v=xxxxxxxxxx
    var ytubeId = ytubeVal.indexOf("v=");
    ytubeId = ytubeId+2;
    ytubeId = ytubeVal.slice(ytubeId);
    var doMain = ytubeVal.indexOf("watch");
    doMain = ytubeVal.slice(0,doMain);
    document.write("<object width=\"425\" height=\"344\"><param name=\"movie\" value=\""+doMain+"v/"+ytubeId+"&hl=en&fs=1\"></param><param name=\"allowFullScreen\" value=\"true\"></param><param name=\"allowscriptaccess\" value=\"always\"></param><embed src=\""+doMain+"v/"+ytubeId+"&hl=en&fs=1\" type=\"application/x-shockwave-flash\" allowscriptaccess=\"always\" allowfullscreen=\"true\" width=\"425\" height=\"344\"></embed></object>");
  }
  else if (ytubeVal.match("v/")) { //http://www.youtube.com/v/xxxxxxxxxx
    var ytubeId = ytubeVal.indexOf("v/");
    ytubeId = ytubeId+2;
    ytubeId = ytubeVal.slice(ytubeId);
    var doMain = ytubeVal.indexOf("v/");
    doMain = ytubeVal.slice(0,doMain);
    document.write("<object width=\"425\" height=\"344\"><param name=\"movie\" value=\""+doMain+"v/"+ytubeId+"&hl=en&fs=1\"></param><param name=\"allowFullScreen\" value=\"true\"></param><param name=\"allowscriptaccess\" value=\"always\"></param><embed src=\""+doMain+"v/"+ytubeId+"&hl=en&fs=1\" type=\"application/x-shockwave-flash\" allowscriptaccess=\"always\" allowfullscreen=\"true\" width=\"425\" height=\"344\"></embed></object>");
  }
  else { //just the id xxxxxxxxx
    ytubeId = ytubeVal;
    document.write("<object width=\"425\" height=\"344\"><param name=\"movie\" value=\"http://www.youtube.com/v/"+ytubeId+"&hl=en&fs=1\"></param><param name=\"allowFullScreen\" value=\"true\"></param><param name=\"allowscriptaccess\" value=\"always\"></param><embed src=\"http://www.youtube.com/v/"+ytubeId+"&hl=en&fs=1\" type=\"application/x-shockwave-flash\" allowscriptaccess=\"always\" allowfullscreen=\"true\" width=\"425\" height=\"344\"></embed></object>");
  }
}
ytubeGo();
</script>
Help line
Place the video's url between the tags, doesn't really matter which format, we'll take care of the rest
I hope someone can get some use out of that.
Great !
BUt I can´t get this to work with subdomains ex.
[youtube]http://se.youtube.com/watch?v=xxxxxxxx[/youtube]
nicholas.alipaz
Registered User
Posts: 91
Joined: Fri Jun 15, 2007 12:43 pm
Location: Los Angeles, CA

Re: Yet another Youtube BBCode

Post by nicholas.alipaz »

molgan wrote:
nicholas.alipaz wrote:....
Great !
BUt I can´t get this to work with subdomains ex.
[youtube]http://se.youtube.com/watch?v=xxxxxxxx[/youtube]
I tried an url from that domain. it is working on my site. Could you provide a copy/paste of what you have in your bbcode tag in the ACP?

Additionally, you need to be sure you have javascript enabled in your browser. If your browser blocks scripts you won't be able to see the video.
nicholas.alipaz
Registered User
Posts: 91
Joined: Fri Jun 15, 2007 12:43 pm
Location: Los Angeles, CA

Re: Custom BBCodes

Post by nicholas.alipaz »

sakm wrote:
sakm wrote:i have got a problem with the spoiler BBcode
...
thanks stu
anyone ?? :)
If a user is experiencing an issue with that spoiler, it is most likely because their browser blocks javascript. It works fine the way you posted it.

The only alternative would be to use a css spoiler rather than javascript. But someone would need to right one. I think I wrote one, but it doesn't do exactly what that one does.
nicholas.alipaz
Registered User
Posts: 91
Joined: Fri Jun 15, 2007 12:43 pm
Location: Los Angeles, CA

Re: Custom BBCodes

Post by nicholas.alipaz »

-Kenichi- wrote:Hi,

It has already been ask several times, but I could find it in these topics.
What's the bbcode for [you]?
I really want that one.

You can also answer me by a pm if you want.

Thanx.
Kenichi
I can't find it in here either. I wrote my own, but it requires one addition to your overall_header.html file

Here it is:
  • OPEN /styles/<yourstyle>/template/overall_header.html

    FIND

    Code: Select all

    <div id="page-body">
    ADD AFTER

    Code: Select all

    <span id="phpbb3uname" style="display:none;">{S_USERNAME}</span>
    Save, close, upload to server, Go to ACP -> Styles -> Templates and refresh your templates

    Go to ACP -> Posting and add new bbcode:
    BBCode usage

    Code: Select all

    [you]{TEXT}[/you]
    HTML replacement

    Code: Select all

    <script type="text/javascript">
    var uname=document.getElementById("phpbb3uname").innerHTML;
    document.write(uname);
    </script>
It works, but it requires the user to allow javascript.
Elyaradine
Registered User
Posts: 22
Joined: Tue Nov 13, 2007 11:00 am
Location: South Africa
Contact:

Re: Custom BBCodes

Post by Elyaradine »

nicholas.alipaz wrote:The only alternative would be to use a css spoiler rather than javascript. But someone would need to right one. I think I wrote one, but it doesn't do exactly what that one does.
I use a CSS one on my site. Less fuss, and very easy, but it (obviously) won't hide text if the person has CSS disabled.

BBCode:

Code: Select all

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

Code: Select all

<span style="background:#000000; color:#000000">{TEXT}</span>
sakm
Registered User
Posts: 652
Joined: Sun Jan 21, 2007 8:14 pm
Location: Hull, uk
Name: Stu
Contact:

Re: Custom BBCodes

Post by sakm »

nicholas.alipaz wrote:
sakm wrote:
sakm wrote:i have got a problem with the spoiler BBcode
...
thanks stu
anyone ?? :)
If a user is experiencing an issue with that spoiler, it is most likely because their browser blocks javascript. It works fine the way you posted it.

The only alternative would be to use a css spoiler rather than javascript. But someone would need to right one. I think I wrote one, but it doesn't do exactly what that one does.

when any member uses it his/her text in the post is made bigger not just for him everyone can see that no matter what browser they are using
Locked

Return to “Custom BBCode Development and Requests”