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 » Sun Jul 15, 2012 2:10 pm

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 » Mon Jul 16, 2012 12:13 pm

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
Contact:

Re: Custom BBCodes

Post by muggins » Mon Jul 16, 2012 1:27 pm

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: 64475
Joined: Mon May 02, 2005 3:11 am
Contact:

Re: Custom BBCodes

Post by Lumpy Burgertushie » Mon Jul 16, 2012 3:48 pm

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
I am available for custom work on a donation basis. Please send me a PM with your needs.

Premium phpBB 3.2 Styles by PlanetStyles.net

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

Re: Custom BBCodes

Post by muggins » Mon Jul 16, 2012 9:20 pm

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: 64475
Joined: Mon May 02, 2005 3:11 am
Contact:

Re: Custom BBCodes

Post by Lumpy Burgertushie » Mon Jul 16, 2012 9:57 pm

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
I am available for custom work on a donation basis. Please send me a PM with your needs.

Premium phpBB 3.2 Styles by PlanetStyles.net

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

Re: Custom BBCodes

Post by muggins » Mon Jul 16, 2012 10:06 pm

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: 64475
Joined: Mon May 02, 2005 3:11 am
Contact:

Re: Custom BBCodes

Post by Lumpy Burgertushie » Tue Jul 17, 2012 12:27 am

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
I am available for custom work on a donation basis. Please send me a PM with your needs.

Premium phpBB 3.2 Styles by PlanetStyles.net

Cery
Registered User
Posts: 3
Joined: Wed Jul 18, 2012 7:10 pm

Re: Custom BBCodes

Post by Cery » Wed Jul 18, 2012 7:18 pm

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: 882
Joined: Mon Oct 15, 2007 10:13 pm
Location: Minnesota, USA
Contact:

Re: Custom BBCodes

Post by Hippie459MN » Wed Jul 18, 2012 10:44 pm

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 » Thu Jul 19, 2012 1:02 am

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 :)

User avatar
Pony99CA
Registered User
Posts: 4783
Joined: Thu Sep 30, 2004 3:13 pm
Location: Hollister, CA
Name: Steve
Contact:

Re: Custom BBCodes

Post by Pony99CA » Thu Jul 19, 2012 2:15 am

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: 5214
Joined: Tue Jun 15, 2010 11:33 am
Location: グリーン ヒル ゾーン
Contact:

Re: Custom BBCodes

Post by AmigoJack » Thu Jul 19, 2012 7:14 am

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 worst thing about censorship is ███████████

User avatar
HGN
Former Team Member
Posts: 4706
Joined: Wed Dec 03, 2008 1:53 pm
Location: The Netherlands
Name: Alfred
Contact:

Re: Custom BBCodes

Post by HGN » Thu Jul 19, 2012 7:17 am

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: 5214
Joined: Tue Jun 15, 2010 11:33 am
Location: グリーン ヒル ゾーン
Contact:

Re: Custom BBCodes

Post by AmigoJack » Thu Jul 19, 2012 9:44 am

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 worst thing about censorship is ███████████

Locked

Return to “Custom BBCode Development and Requests”

Who is online

Users browsing this forum: No registered users and 10 guests