|
My Custom MyCodes
|
|
03-23-2007, 12:25 PM
(This post was last modified: 03-23-2007 12:27 PM by Yumi.)
Post: #1
|
|||
|
|||
|
My Custom MyCodes
My site is pretty much bloated with useless MyCodes... *sigh*
Oh well, I've decided to post them here, if anyone finds them useful Most are quite useless and very simple, but meh.(Note, I'm sorda lazy, so I've just put the Regular expression followed by the replacement for each tag) Background Color of Text PHP Code: \[bg=([a-zA-Z]*|\#?[0-9a-fA-F]{6})\](.*?)\[/bg\] PHP Code: <SPAN STYLE="background-color: $1">$2</SPAN> Background Picture of Text PHP Code: \[bgimg=([^"'[]+?)\](.*?)\[/bgimg\] PHP Code: <SPAN STYLE="background-image: url('$1')">$2</SPAN> Embedded Webpage (note that I have three versions of this - you could probably make a "neater" version by editing the parser; also note that I suggest you change the image it points to) PHP Code: \[page\]([^"[]+?)\[/page\] PHP Code: <small><i><a href="$1" title="Link to the original flash object">Object Link</a></i></small>PHP Code: \[page=([0-9]{1,3})x([0-9]{1,3})\]([^"[]+?)\[/page\] PHP Code: <small><i><a href="$3" title="Link to the original flash object">Object Link</a></i></small>PHP Code: \[page=(x|)([0-9]{1,3})\]([^"[]+?)\[/page\] PHP Code: <small><i><a href="$3" title="Link to the original flash object">Object Link</a></i></small>Fieldset PHP Code: \[fieldset\](.*?)\[/fieldset\] PHP Code: <FIELDSET>$1</FIELDSET> PHP Code: \[fieldset=([a-zA-Z]*|\#?[0-9a-fA-F]{6})\](.*?)\[/fieldset\] PHP Code: <FIELDSET STYLE="background-color: $1">$2</FIELDSET> PHP Code: \[legend\](.*?)\[/legend\] PHP Code: <LEGEND>$1</LEGEND> Flash Object (note that this is loaded through DHTML to prevent possible exploitation via Flash; also, please change the URL of the icon) PHP Code: \[flash\]([^"[]+?)\[/flash\] PHP Code: <small><i><a href="$1" title="Link to the original flash object">Object Link</a></i></small>PHP Code: \[flash=([0-9]{1,3})x([0-9]{1,3})\]([^"[]+?)\[/flash\] PHP Code: <small><i><a href="$3" title="Link to the original flash object">Object Link</a></i></small>Google Video PHP Code: \[gvid\]http\://video\.google\.com/videoplay\?docid=([^"[]+?)\[/gvid\] PHP Code: <SMALL STYLE="margin-top: -100"><I><A HREF="http://video.google.com/videoplay?docid=$1">Source: Google Video</A></I></SMALL>Indent PHP Code: \[indent\](.*?)\[/indent\] PHP Code: <DIV STYLE="margin-left: 15px">$1</DIV> Link in new window PHP Code: \[popup=([^"'\\[]+?)\](.*?)\[/popup\] PHP Code: <A HREF="javascript:window.open('$1',0,'toolbars=0,location=0,status=0,resizable=1,scrollbars=1');void(0);">$2</A> List (images as items) PHP Code: \[list=http://([^"'[]+?)\](.*?)\[/list\] PHP Code: <UL STYLE="list-style-image: url('http://$1')">$2</UL> PHP Code: \[\*\] PHP Code: <LI> Overline PHP Code: \[o\](.*?)\[/o\] PHP Code: <SPAN STYLE="text-decoration: overline">$1</SPAN> Small caps PHP Code: \[sc\](.*?)\[/sc\] PHP Code: <SPAN STYLE="font-variant: small-caps">$1</SPAN> Sound (embedded link) PHP Code: \[sound=([^"'\\[]+?)\](.*?)\[/sound\] PHP Code: <span><a href="javascript:void(0);" onClick="this.parentNode.getElementsByTagName('span')[0].innerHTML='<embed src=\'$1\' hidden=true autostart=true loop=false style=\'visibility: hidden; visible: hide; width:1;height:1;position:absolute\'>';" TITLE="Click to play sound"><img src="images/smilies/sound.gif" style="padding-top: 2px; vertical-align: top" border=0 /> $2</A><span STYLE="visibility: hidden; visible: hide;height:1;width:1;overflow:hidden"></span></span> Spoiler PHP Code: \[spoiler\](.*?)\[/spoiler\] PHP Code: <div><div style="margin-bottom:2px; font-size: 12px"><b>Spoiler</b>: <input type="button" value="Show" style="width:45px;font-size:10px;margin:0px;padding:0px;" 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.innerText = ''; this.value = 'Hide'; } else { this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display = 'none'; this.innerText = ''; this.value = 'Show'; }">PHP Code: \[spoiler=(.*?)\](.*?)\[/spoiler\] PHP Code: <div><div style="margin-bottom:2px; font-size: 12px"><b>Spoiler</b> for <i>$1</i>: <input type="button" value="Show" style="width:45px;font-size:10px;margin:0px;padding:0px;" 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.innerText = ''; this.value = 'Hide'; } else { this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display = 'none'; this.innerText = ''; this.value = 'Show'; }">Subscript PHP Code: \[sub\](.*?)\[/sub\] PHP Code: <SUB>$1</SUB> Superscript PHP Code: \[sup\](.*?)\[/sup\] PHP Code: <SUP>$1</SUP> Tables PHP Code: \[table\](.*?)\[/table\] PHP Code: <TABLE STYLE="border-style: ridge; border-width: 1px; padding: 5 5 5 5; margin: 5 0 5 5" ALIGN="center" CELLSPACING=0 CELLPADDING=4 BORDER=0>$1</TABLE> PHP Code: \[tr\](.*?)\[/tr\] PHP Code: <TR><TH STYLE="height:1px; padding: 0 0 0 0; margin: 0 0 0 0" COLSPAN=100 CLASS="trow_sep"></TH></TR><TR>$1</TR> PHP Code: \[tr=([a-zA-Z]*|\#?[0-9a-fA-F]{6})\](.*?)\[/tr\] PHP Code: <TR><TH STYLE="height:1px; padding: 0 0 0 0; margin: 0 0 0 0; background-color: $1" COLSPAN=100 CLASS="trow_sep"></TH></TR><TR>$2</TR> PHP Code: \[td\](.*?)\[/td\] PHP Code: <TD>$1</TD> PHP Code: \[td=([a-zA-Z]*|\#?[0-9a-fA-F]{6})\](.*?)\[/td\] PHP Code: <TD BGCOLOR="$1">$2</TD> PHP Code: \[td span=([^" []+?)\](.*?)\[/td\] PHP Code: <TD COLSPAN="$1">$2</TD> PHP Code: \[td=([a-zA-Z]*|\#?[0-9a-fA-F]{6}) span=([0-9]+?)\](.*?)\[/td\] PHP Code: <TD BGCOLOR="$1" COLSPAN="$2">$3</TD> Tooltip PHP Code: <TD BGCOLOR="$1" COLSPAN="$2">$3</TD> PHP Code: <SPAN TITLE="$1">$2</SPAN> Youtube PHP Code: \[youtube\]http\://(www\.|)youtube\.com/watch\?v=([^"'[]+?)\[/youtube\] PHP Code: <SMALL STYLE="margin-top: -100"><I><A HREF="http://www.youtube.com/watch?v=$2">Source: YouTube</A></I></SMALL>Hope someone finds this useful
|
|||
|
03-23-2007, 01:09 PM
Post: #2
|
|||
|
|||
|
RE: My Custom MyCodes
Just wanted to let you know, but your regex syntax is flawed. For example this is what it should be for subscript:
Code: \[sub\](.*?)\[sub\]¡Mi ombligo esta en llamas! |
|||
|
03-23-2007, 06:01 PM
Post: #3
|
|||
|
|||
|
RE: My Custom MyCodes
Apart from the above mentioned flaws in the regex, you have most of your html tags in uppercase when the standard is lowercase...
You also seem to switch between the old html tag attributes and CSS stylings quite randomly... The "bgcolor" attribute for example, should be a css style: Code: background-color:Code: background: |
|||
|
03-23-2007, 08:01 PM
Post: #4
|
|||
|
|||
|
RE: My Custom MyCodes
Cool thanks
![]() |
|||
|
03-24-2007, 12:34 AM
Post: #5
|
|||
|
|||
RE: My Custom MyCodes
DrPoodle Wrote:you have most of your html tags in uppercase when the standard is lowercase...Big deal.... It's not like it's going to effect the output any. ![]() But you got a nice list, and I have some on my localhost, that I've never released... Dr Small |
|||
|
03-24-2007, 12:56 AM
Post: #6
|
|||
|
|||
RE: My Custom MyCodes
The Wicked Flea Wrote:Just wanted to let you know, but your regex syntax is flawed. For example this is what it should be for subscript:Really? Wow, thanks. I'm sorda new to all this, so thanks for your input! So, basically, you can't use an end-tag? DrPoodle Wrote:Apart from the above mentioned flaws in the regex, you have most of your html tags in uppercase when the standard is lowercase...Yeah. Actually, I was taught to use uppercase, so I'm sorda used to using uppercase. DrPoodle Wrote:You also seem to switch between the old html tag attributes and CSS stylings quite randomly...Yeah probably. I'm not very consistent >_> Made them at different times. Thanks everyone for their input!
|
|||
|
03-24-2007, 12:58 AM
(This post was last modified: 03-24-2007 01:00 AM by Dr Small.)
Post: #7
|
|||
|
|||
RE: My Custom MyCodes
Quote:So, basically, you can't use an end-tag?No. You missed the "/" in front of the expressions on your MyCode. You can have end tags, but it is almost always necessary to have the complete expression, or something'll go wrong. Dr Small |
|||
|
03-24-2007, 01:07 AM
Post: #8
|
|||
|
|||
RE: My Custom MyCodes
Dr Small Wrote:*checks code*Quote:So, basically, you can't use an end-tag?No. You missed the "/" in front of the expressions on your MyCode. You can have end tags, but it is almost always necessary to have the complete expression, or something'll go wrong. ZOMG, the glitch in the MyBB parser!!! If I edit the post, it's there (you may have trouble quoting it, but if you do, you'll see the \ characters there). I made a suggestion to fix that bug ![]() http://community.mybboard.net/showthread...#pid117712 |
|||
|
03-24-2007, 01:14 AM
Post: #9
|
|||
|
|||
|
RE: My Custom MyCodes
Lowercase is the proper way and "xhtml valid". Otherwise you will be producing invalid xhtml and it's looked down upon.
|
|||
|
03-24-2007, 01:20 AM
Post: #10
|
|||
|
|||
RE: My Custom MyCodes
Tikitiki Wrote:Lowercase is the proper way and "xhtml valid". Otherwise you will be producing invalid xhtml and it's looked down upon.Oh okay. Didn't know that >_> Thanks for the info! |
|||
|
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 1 Guest(s)
Search
Member List
Calendar
Help



Most are quite useless and very simple, but meh.



![[Image: jag100sigaf5.jpg]](http://img59.imageshack.us/img59/8623/jag100sigaf5.jpg)

