Custom BBCodes [Deprecated]

Get help developing custom BBCodes or request one.
User avatar
noggin
Registered User
Posts: 38
Joined: Sat Jul 14, 2012 7:41 am

Re: Custom BBCodes

Post by noggin »

Mick wrote:
noggin wrote:My board doesn't provide or allow a 'links' or 'url' BBCode
What do you mean, they're part of a vanilla install? Please explain what you mean by 'allow'?
Please forgive me I am a stupid old man- I have just discovered that I can activate the url bbcode through the ACP /General/Post settings
#Darren
Registered User
Posts: 206
Joined: Mon Jun 05, 2006 5:18 pm

Re: Custom BBCodes

Post by #Darren »

bump
#Darren wrote:Hi all,

I just added the youtube tags (for full url), but seem to have some problems.

The url often has a different code in it depending how you access it. For instance I accessed a vid from a US website and then I accessed same vid from the side panel (which shows multiple vids) on the youtube site. Both these gave me different youtube url codes, and only one (from the external website) of the two worked.

Any advice welcome :)
User avatar
muggins
Registered User
Posts: 1183
Joined: Fri Feb 22, 2008 5:12 pm
Location: Texas
Name: Donovan

Re: Custom BBCodes

Post by muggins »

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>
This one?

The bit that says http://www.youtube.com/v/{SIMPLETEXT} is different in some URLs, right?

That's why I use the version that just uses the video ID. That doesn't work all the time, as when the video has the ?feature=embedded tag.

You just have to experiment, or create multiple bbCodes to allow for the different URL styles.
Muggins
User avatar
Lumpy Burgertushie
Registered User
Posts: 69228
Joined: Mon May 02, 2005 3:11 am

Re: Custom BBCodes

Post by Lumpy Burgertushie »

a custom bbcode is only going to work for the exact information to put in when you created it.

if you try to use a different url for example, then you can't expect it to work for that url.

as muggins said, you either have to create a different bbcode for every possible variation in youtube urls or simply always use the same one when posting a video.
(that would be my suggestion).


robert
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.
User avatar
muggins
Registered User
Posts: 1183
Joined: Fri Feb 22, 2008 5:12 pm
Location: Texas
Name: Donovan

Re: Custom BBCodes

Post by muggins »

Robert, I thought I had a lot of posts on my board. :o

I'm beginning to wonder if I've made some newbie mistake with my request for help.

Can anyone point me in the right direction?

Can I use inline JavaScript in a bbcode, or do I have to code the script in <head> and pass variables to the script? I'm not a programmer any more, but I can stomp around and look like one sometimes... :mrgreen:
Muggins
User avatar
Lumpy Burgertushie
Registered User
Posts: 69228
Joined: Mon May 02, 2005 3:11 am

Re: Custom BBCodes

Post by Lumpy Burgertushie »

muggins wrote:Robert, I thought I had a lot of posts on my board. :o
I don't have a life.
I'm beginning to wonder if I've made some newbie mistake with my request for help.

Can anyone point me in the right direction?

Can I use inline JavaScript in a bbcode, or do I have to code the script in <head> and pass variables to the script? I'm not a programmer any more, but I can stomp around and look like one sometimes... :mrgreen:
I am not sure what you are trying to accomplish with that javascript or why you want to create a bbcode for it.

bbcodes are usually used for things that you and/or your members would want to put in a post on a regular basis.

maybe if you explained better what this javascript is supposed to be for and why you want it as a bbcode somebody could help you figure out to get what you really want the final outcome to be.

robert
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.
User avatar
muggins
Registered User
Posts: 1183
Joined: Fri Feb 22, 2008 5:12 pm
Location: Texas
Name: Donovan

Re: Custom BBCodes

Post by muggins »

I thought I had, but it maybe it got lost in the other posts afterwards.

Here is my original request in full.

As a bbcode, it may be used sort of like a spoiler to announce an upcoming event, or as a way to test a prediction, maybe?

I did have something specific in mind a couple of weeks ago, but I'm old and I forget things. :mrgreen:
Muggins
User avatar
Lumpy Burgertushie
Registered User
Posts: 69228
Joined: Mon May 02, 2005 3:11 am

Re: Custom BBCodes

Post by Lumpy Burgertushie »

ok, from what I can see you were right in the first place when you posted this in the MOD request forum.

I can not see how this would work as a bbcode or why you would want it that way.

if the idea is to prepost and have it be submitted at a later date then a MOD would be the best way to do it.

luck,
robert
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.
Cery
Registered User
Posts: 3
Joined: Wed Jul 18, 2012 7:10 pm

Re: Custom BBCodes

Post by Cery »

Heya :)

I got a question. Is there any way to give a new BBCode a priority? Let's say i want to make a "Offtopic"-Code [ot][/ot] For this code i use a light grey colour. Works like a charm.

But now comes the clue. If i now want no mark something as offtopic that has a colour in it (e.g. red) it is still displayed as red.
Is there any way to ignore the "inner" colours and paint the wohle as OT marked part as the in [ot][/ot] defined light gray?

I hope i post this at the right Thread, if not so please move :)

Thanks for all the help
Best regards
~Ceryni
User avatar
Hippie459MN
Registered User
Posts: 966
Joined: Mon Oct 15, 2007 10:13 pm
Location: Minnesota, USA

Re: Custom BBCodes

Post by Hippie459MN »

Cery wrote:Heya :)

I got a question. Is there any way to give a new BBCode a priority? Let's say i want to make a "Offtopic"-Code [ot][/ot] For this code i use a light grey colour. Works like a charm.

But now comes the clue. If i now want no mark something as offtopic that has a colour in it (e.g. red) it is still displayed as red.
Is there any way to ignore the "inner" colours and paint the wohle as OT marked part as the in [ot][/ot] defined light gray?

I hope i post this at the right Thread, if not so please move :)

Thanks for all the help
Best regards
~Ceryni
Do you mean you want it to post like this...
this is on topic and this is off topic and now back on topic

If so, this BBCode does work inside the color tags and will over ride them using the color specified in the BBCode. This is using a light grey

BBCode usage

Code: Select all

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

Code: Select all

<font color="#808080">{TEXT}</font>
Help line

Code: Select all

[ot]Enter your Off-Topic text here[/ot]
Hope that is what your after.
Cery
Registered User
Posts: 3
Joined: Wed Jul 18, 2012 7:10 pm

Re: Custom BBCodes

Post by Cery »

I already got a Code for that. It works like a charm. but if i use it like:

[ot]I am a user writing Offtopic but there is this red word: Hello and this is all offtopic.[/ot]

then everything is displayed in the grey i want.. except the word "Hello" so i need a kind of priority for the OT for it being able to overwrite the . So the whole text turns light grey

In our Forum it does not overwrite it so far.
Code looks like this:

Code: Select all

[ot]{TEXT}[/ot]

Code: Select all

<span style="color: #C2C2C2;">Offtopic:</span>
<dl style="border : 1px dotted #C2C2C2; font-size : 0.9em; font-weight : normal; color : #C2C2C2;"><dt style="italic; color : #C2C2C2; padding : 1em><dd style="padding : 10em;">{TEXT}</dd></dl>
It actually adds a nice light grey dotted Frame and the heading "Offtopic" to the marked text :)
Pony99CA
Registered User
Posts: 4783
Joined: Thu Sep 30, 2004 3:13 pm
Location: Hollister, CA
Name: Steve

Re: Custom BBCodes

Post by Pony99CA »

Cery wrote:I already got a Code for that. It works like a charm. but if i use it like:

[ot]I am a user writing Offtopic but there is this red word: Hello and this is all offtopic.[/ot]

then everything is displayed in the grey i want.. except the word "Hello" so i need a kind of priority for the OT for it being able to overwrite the . So the whole text turns light grey

In our Forum it does not overwrite it so far.

The most recent definitions usually take precedence over earlier definitions. However, CSS has the !important attribute to override things, but that didn't work in the example that I tried. Maybe I'm not using it correctly, though. :?

Cery wrote:Code looks like this:

Code: Select all

[ot]{TEXT}[/ot]

Code: Select all

<span style="color: #C2C2C2;">Offtopic:</span>
<dl style="border : 1px dotted #C2C2C2; font-size : 0.9em; font-weight : normal; color : #C2C2C2;"><dt style="italic; color : #C2C2C2; padding : 1em><dd style="padding : 10em;">{TEXT}</dd></dl>
It actually adds a nice light grey dotted Frame and the heading "Offtopic" to the marked text :)
That code has problems, the biggest being that your DT tag is never closed. I would have expected your "Off-Topic" text to be there, but you put it before the DL for some reason. I suspect that if you close the DT properly (before the DD), you'll lose the color in the DD. You should probably apply that style to the DD tag, too.

Anyway, to work around this, you have two options:
  1. Remove the color tags manually from within the OT BBCode. Depending on how you use the OT BBCode and your board permissions, that should be sufficient.
  2. Change the background color instead of the text color (or just use the border like you do already). That will make the color of the text irrelevant.
Steve
Silicon Valley Pocket PC (http://www.svpocketpc.com)
Creator of manage_bots and spoof_user (ask me)
Need hosting for a small forum with full cPanel & MySQL access? Contact me or PM me.
User avatar
AmigoJack
Registered User
Posts: 6120
Joined: Tue Jun 15, 2010 11:33 am
Location: グリーン ヒル ゾーン

Re: Custom BBCodes

Post by AmigoJack »

Pony99CA wrote:CSS has the !important attribute to override things, but that didn't work
Inline styles can't overwrite other inline styles - that's only possible with a CSS rule. The following example is a kludge, as it "works" but invalidates the HTML (ideally you should edit one of your CSS files):

Custom BBCode:

Code: Select all

[forcecolor]{TEXT}[/forcecolor]
HTML replacement:

Code: Select all

<style type="text/css"> .forcecolor * { color: inherit !important } </style>
<span style="color: #FFF" class="forcecolor">{TEXT}</span>
  • "The problem is probably not my English but you do not want to understand correctly. ... We will not come anybody anyway, nevertheless, it's best to shit this." Affin, 2018-11-20
  • "But this shit is not here for you. You can follow with your. Maybe the question, instead, was for you, who know, so you shoved us how you are." axe70, 2020-10-10
  • "My reaction is not to everyone, especially to you." Raptiye, 2021-02-28
User avatar
HGN
Former Team Member
Posts: 4706
Joined: Wed Dec 03, 2008 1:53 pm
Location: The Netherlands
Name: Alfred

Re: Custom BBCodes

Post by HGN »

The suggestion from Pony99CA works fine for me with following HTML replacement:

Code: Select all

<span style="color: #C2C2C2;">Offtopic:</span>
<dl style="border : 1px dotted #C2C2C2; font-size : 0.9em; font-weight : normal; color : #C2C2C2 !important; "><dt style="italic; color : #C2C2C2; padding : 1em><dd style="padding : 10em;">{TEXT}</dd></dt></dl>
User avatar
AmigoJack
Registered User
Posts: 6120
Joined: Tue Jun 15, 2010 11:33 am
Location: グリーン ヒル ゾーン

Re: Custom BBCodes

Post by AmigoJack »

HGN wrote:The suggestion from Pony99CA works fine for me
Cery wrote:being able to overwrite the . So the whole text turns light grey
No.
  • "The problem is probably not my English but you do not want to understand correctly. ... We will not come anybody anyway, nevertheless, it's best to shit this." Affin, 2018-11-20
  • "But this shit is not here for you. You can follow with your. Maybe the question, instead, was for you, who know, so you shoved us how you are." axe70, 2020-10-10
  • "My reaction is not to everyone, especially to you." Raptiye, 2021-02-28

Return to “Custom BBCode Development and Requests”