Page 24 of 267

Re: Custom BBCodes

Posted: Thu Dec 20, 2007 7:22 pm
by salty78
Resized Image BBCode

Code: Select all

[image]{URL}[/image]

Code: Select all

<a href="{URL}" <img src="{URL}" height="150" width="150" /></a>

Re: Custom BBCodes

Posted: Thu Dec 20, 2007 7:58 pm
by jwilmes6996
Noxwizard wrote:It's probably this part:

Code: Select all

<object width="425" height="350"><param 
<object type="application/x-shockwave-flash" ...
You've got an open <param> tag which is absorbing the object tag. Firefox is probably making an assumption and fixing it, while IE is showing what you actually gave it.
Thank you soooo much! I can't tell you how many times I must have over looked that! Once again, THANKS! :mrgreen:

Re: Custom BBCodes

Posted: Fri Dec 21, 2007 3:24 pm
by iturnl
1. Just wondering how you would go about removing the default [img] tag.

I would like to prevent people from using the [img] tag to link images on a specialized forum and have instead allowed them to upload images as attachments to insert them. The reason is to try to prevent (future) broken links and also to force the images to come from the fast server rather than have them linked from various (often slow) other sites.

I have tried to comment out various likes in bbcodes.php to no avail.

2. Also, is it possible to adjust the img tag only accept local url's .. this may infact be better than the above solution as it would still allow those with access to upload images via ftp and then link to them.

ie.

BBCode usage:
[img]{LOCAL_URL}[/img]

HTML replacement:
<img src="{LOCAL_URL}" />

If someone could indicate how to do both that would be fantastic :D

Re: Custom BBCodes

Posted: Fri Dec 21, 2007 4:05 pm
by oso96_2000
Feaelin wrote:I've been wondering why you can't use <span> with filters. Wrapping it inside of a table means that the 'glow' text isn't inline with the rest of the text (table generates a new line at the end). In theory, an HTML replace of:

Code: Select all

<span style="filter:glow(color={COLOR}, strength=3)">{TEXT}</span>
Should work, but it doesn't. At a guess, something inherited from the theme is interfering with correct operation of 'filter' in the span?
Still can't figure out why this didn't work with a span, or even with a div.. it only works with table. That's strange, because the same code is output from a phpBB2 and the glow/shadow works, but in phpBB3 doesn't x.x.. someone has an idea?

Re: Custom BBCodes

Posted: Fri Dec 21, 2007 7:45 pm
by Yago Gonzalez
Spoiler BBcode advanced

here´s my demo of the Spoiler bbcode ive created:

http://www.elinformadordigital.es/foros ... t=4&p=6#p6

Hi! im from spain and ive creted a better Spoiler BBcode that woks perfectly with phpbb3:

BBcode use:

Code: Select all

[spoiler]{TEXT}[/spoiler]
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>Spoiler: </b><a href=\'#\' onClick=\'return false;\'>Ocultar</a>'; } else { this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display = 'none'; this.innerHTML = '<b>Spoiler: </b><a href=\'#\' onClick=\'return false;\'>Mostrar</a>'; }" /><b>Spoiler: </b><a href="#" onClick="return false;">show</a></span></div><div class="quotecontent"><div style="display: none;">{TEXT}</div></div></div>
Text line Help:

Show our hide text-

Hope you like it! im sure it will work

Re: Custom BBCodes

Posted: Sat Dec 22, 2007 8:47 am
by LuntiX
Xbox 360 Gamertag Code (My Way)

Alright, I used the code from MyGamerCard.net and made this little code for myself from it.

MyGamerCard.net (How to use)

Code: Select all

[360gamercard=theme]gamertag[/360gamercard]
Example:

Code: Select all

[360gamercard=gel]LuntiX[/360gamercard]
Now for the actual stuff you do in the ACP

BBcode Usage:

Code: Select all

[360gamercard={TEXT2}]{TEXT1}[/360gamercard]
HTML Replacement:

Code: Select all

<a href="http://profile.mygamercard.net/{TEXT1}">
<img src="http://card.mygamercard.net/{TEXT2}/{TEXT1}.png" border=0>
</a>
I know this may seem pointless because MyGamerCard.net gives you the BBCode but with my way it uses up less space in the post.

[edit]
imeem
BBCode Usage:

Code: Select all

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

Code: Select all

<object width="300" height="80"><param name="movie" value="http://media.imeem.com/m/{TEXT}/aus=false/"></param><param name="wmode" value="transparent"></param><embed src="http://media.imeem.com/m/{TEXT}/aus=false/" type="application/x-shockwave-flash" width="300" height="80" wmode="transparent"></embed></object>
How to use:

Code: Select all

[imeem]Clu3XCGXB0[/imeem]
*I got Clu3XCGXB0 from the embed code of the original song. See below.
<object width="300" height="80"><param name="movie" value="http://media.imeem.com/m/Clu3XCGXB0/aus=false/"></param><param name="wmode" value="transparent"></param><embed src="http://media.imeem.com/m/Clu3XCGXB0/aus=false/" type="application/x-shockwave-flash" width="300" height="80" wmode="transparent"></embed></object>

Re: Custom BBCodes

Posted: Sat Dec 22, 2007 2:34 pm
by Jephth
The YouTube one works but the Google one doesn't. Any ideas why?

Re: Custom BBCodes

Posted: Sat Dec 22, 2007 3:33 pm
by Jephth
I altered the given code slightly by adding {SIMPLETEXT} to the language paramaters and now it works.

If you have a similar problem use the following codes:

Code: Select all

[Googlevid]http://video.google.com/videoplay?docid=-{NUMBER}&hl={SIMPLETEXT}[/Googlevid]
and:

Code: Select all

<embed style="width:400px; height:326px;" id="VideoPlayback" type="application/x-shockwave-flash" src="http://video.google.com/googleplayer.swf?docId=-{NUMBER}&hl={SIMPLETEXT}" flashvars=""></embed>
NOTE: There is a "-" before {NUMBER}.

Cheers, guys.

Re: Custom BBCodes

Posted: Sat Dec 22, 2007 6:19 pm
by ship9
Please help I am looking to see if i can add videos from cnn like we can from youtube . if so what is the BBCode usage and the HTML replacement.
thank you so much for the help.
David

Re: Custom BBCodes

Posted: Sat Dec 22, 2007 8:49 pm
by 360eirelive
anyone got a custom bbcode so i can embed Gamespot movies into my forums? I have searched but not getting any results!
Thanks in advance

Re: Custom BBCodes

Posted: Sun Dec 23, 2007 12:48 am
by Kennin
In the BBCode Usage form, you can define how you want your users to use the BBCode. Let's say you want to create a new font BBCode that will let your users pick a font to use for their text. An example of what to put under BBCode Usage would be [font={FONTNAME}]{TEXT}[/font] This would make a new [font] BBCode, and will allow the user to pick what font face they want for the text. The user's text is represented by TEXT,while FONTNAME represents whatever font name the user types in.

In the HTML Replacementform, you can define what HTML code your new BBCode will use to actually format the text. In the case of making a new [font] BBCode, try <span style="font-family: {FONTNAME}">{TEXT}<span> This HTML code will be used to actually format the user's text.
As far as I understand... I did exactly this.
Let me describe what I EXACTLY did.

I went to the ACP.
Just to make sure, the top corner says:
Administration Control Panel
Admin index • Board index
So... I guess this is okay.

Then I clicked the tab "POSTING" in the top tab bar.

Next I clicked in the left navbar the entry "BBCODES".

In the first and second frame on the right hand, I copied the exact code, as shown in the Documentation, item "3.4.1. BBCodes".
In exact words, I literally copy-pasted these strings:
[font={FONTNAME}]{TEXT}[/font]
and
<span style="font-family: {FONTNAME}">{TEXT}<span>
Well... this does not work, unfortunately!
Am I supposed to replace {FONTNAME} with the fontnames I want enabled and make a list of all possible choices? Or why doesn't it work?
And... is there a possibility to make a drop down menu in order to get a selection list instead of an empty "[font=]" tag?

Please forgive me if this seems to be a stupid question. I am aware of that.
Please forgive me if this question hasn't been posted yet. I searched, but I did not find it. The amount of information here is so overwhelmingly huge, I could not filter out the correct information I needed.
I used the search function to my best understandings and received 100+ pages of results...

Re: Custom BBCodes

Posted: Sun Dec 23, 2007 12:00 pm
by iturnl
Kennin .. no expert here, but I can help you a bit .. hopefully a working answer to your problem is at the end of this post .. I didn't have time to test it .. between here and there is a bit to make heads and tails of it .. you were on the right track, just missing a few bits.

* A few problems I can see. You need to use {TEXT} or {TEXT1} or {SIMPLETEXT} .. you cannot define your own .. {FONTNAME} is invalid.
* You should use {SIMPLETEXT} in HTML to keep it safe .. I believe using {TEXT} is safe between the <span> and the </span>
* You need to close your <span> with </span> .. you missed the / on the closing brace.
* You need to put quote marks ' ' around the font name variable in case it contains a space .. attached relevant info below.
* The dropdown list is not possible except in a complicated way with a fair amount of php code. If you only use a few fonts you could create a few different tags for a specific font .. ie.

Code: Select all

[font_arial]{TEXT}[/font_arial] .. <span style="font-family: 'Arial', serif">{TEXT}</span>
Useful info:
Please note that only tokens listed below are able to be used within custom BBCodes.
{TEXT} Any text, including foreign characters, numbers, etc… You should not use this token in HTML tags. Instead try to use IDENTIFIER or SIMPLETEXT.
{SIMPLETEXT} Characters from the latin alphabet (A-Z), numbers, spaces, commas, dots, minus, plus, hyphen and underscore
{IDENTIFIER} Characters from the latin alphabet (A-Z), numbers, hyphen and underscore
... etc
and regarding using multiple tokens of the same type:
Tokens are placeholders for user input. The input will be validated only if it matches the corresponding definition. If needed, you can number them by adding a number as the last character between the braces, e.g. {TEXT1}, {TEXT2}.
and finally regarding the use of the style="font-family attribute (specifying generic-family and quotes to allow space in the font name):
5.2.2 'font-family'

Value: [[<family-name> | <generic-family>],]* [<family-name> | <generic-family>]
Initial: UA specific, Applies to: all elements, Inherited: yes, Percentage values: N/A

The value is a prioritized list of font family names and/or generic family names. Unlike most other CSS1 properties, values are separated by a comma to indicate that they are alternatives:
BODY { font-family: gill, helvetica, sans-serif }

There are two types of list values:
<family-name>
The name of a font family of choice. In the last example, "gill" and "helvetica" are font families.
<generic-family>
In the example above, the last value is a generic family name. The following generic families are defined:
* 'serif' (e.g. Times)
* 'sans-serif' (e.g. Helvetica)
* 'cursive' (e.g. Zapf-Chancery)
* 'fantasy' (e.g. Western)
* 'monospace' (e.g. Courier)

Style sheet designers are encouraged to offer a generic font family as a last alternative.

Font names containing whitespace should be quoted:
BODY { font-family: "new century schoolbook", serif }
<BODY STYLE="font-family: 'My own font', fantasy">

If quoting is omitted, any whitespace characters before and after the font name are ignored and any sequence of whitespace characters inside the font name is converted to a single space.
Thus I propose the following custom bbcode (feel free to alter the generic-style .. set to serif):

BBCode usage

Code: Select all

[font={SIMPLETEXT}]{TEXT}[/font]
HTML replacement

Code: Select all

<span style="font-family: '{SIMPLETEXT}', serif">{TEXT}</span>
Help line

Code: Select all

[font=FONT_NAME]TEXT[/font]

Re: Custom BBCodes

Posted: Sun Dec 23, 2007 1:51 pm
by Kennin
Thank you very much!
The problem is solved now!

Re: Custom BBCodes

Posted: Sun Dec 23, 2007 2:28 pm
by FaresNB
Hi

how can I make the birthday profile field is required on registration ???

and is there any way to control the other profile field just like how I control the custom one which i creat ?? :roll:

Re: Custom BBCodes

Posted: Sun Dec 23, 2007 3:56 pm
by babywhiz
shadow07 wrote:Basically like this

[video]{TEXT}[/video]


<embed FlashVars='videoId={TEXT}' src='http://www.thedailyshow.com/sitewide/vi ... /swf.jhtml' quality='high' bgcolor='#cccccc' width='332' height='316' name='comedy_central_player' align='middle' allowScriptAccess='always' allownetworking='external' type='application/x-shockwave-flash' pluginspage='http://www.macromedia.com/go/getflashplayer'></embed>


Basically for text put the video id number

this should work, im nt sure hw that site works, nvr used it
:D

Thank you soooo much!