|
[Tutorial] 7 Custom MyCodes for your forum
|
|
05-12-2009, 03:58 AM
(This post was last modified: 05-17-2009 04:43 PM by Nunymare.)
Post: #1
|
|||
|
|||
|
[Tutorial] 7 Custom MyCodes for your forum
You can view working examples at this thread, on my forum.
7 Custom MyCodes for your Forum Hey guys, me again, and this time I'm here to show you how to add a couple new custom Mycodes to your forum. Ones I'll teach you to add will be:
-------------- 1. Marquee Regular expression: Code: \[marquee\](.*?)\[/marquee\]Replacement: Code: <marquee>$1</marquee>2. Hilighted Text *Users will have to specify a hex code for the hilight color desired Regular expression: Code: \[hilight color=(.*?)\](.*?)\[/hilight\]Replacement: Code: <span style="background-color:#$1;">$2</span>3. Module *This will create a 'module', following your forum theme. Regular expression: Code: \[module title=(.*?)\](.*?)\[/module\]Replacement: Code: <table border="0" cellspacing="{$theme['borderwidth']}" cellpadding="{$theme['tablespace']}" class="tborder">4. Fieldset Regular Expression: Code: \[fieldset title=(.*?)\](.*?)\[/fieldset\]Replacement: Code: <fieldset class="bbfieldset"><legend class="bblegend"><span style="color:#2222ac;">$1</span></legend>$2</fieldset>5. Custom spacing in between text Regular expression: Code: \[spacing pixels=(.*?)\](.*?)\[/spacing\]Replacement: Code: <span style="letter-spacing:$1px;">$2</span>6. Small Capital Letters Text Regular Expression: Code: \[smallcaps\](.*?)\[/smallcaps\]Replacement: Code: <span style="font-variant:small-caps;" >$1</span>7. Image Text Background Regular Expression: Code: \[textbg img=(.*?)\](.*?)\[/textbg\]Replacement: Code: <span style="background-image:url('$1')" >$2</span>---------- Usage: Marquee: Code: [marquee]Text[/marquee]Module: Code: [module title=Title for your module]Content here[/module]Fieldset: Code: [fieldset title=Title for your fieldset]Content here[/fieldset]Custom spacing in between text: Code: [spacing pixels=Pixels you want in between letters]Text[/spacing]Image Text Background (hilighted text, just with a bg image) Code: [textbg img=URL TO YOUR IMAGE]Text Here.[/textbg]You can view working examples at this thread, on my forum. Thank you. |
|||
|
05-12-2009, 05:50 AM
Post: #2
|
|||
|
|||
|
RE: [Tutorial] 7 Custom MyCodes for yourr forum
Great Job! I might use some of these!
Joshua Mayer Ex-MyBB Support Team |
|||
|
05-12-2009, 11:23 AM
Post: #3
|
|||
|
|||
|
RE: [Tutorial] 7 Custom MyCodes for yourr forum
I've seen a number of MyCodes where "(.*?)" expression is used. I thought it'd be about time that I suggest trying to avoid that expression where possible, as this may allow users to perform some minor HTML injection (HTML tags are automatically converted to their entities and Javascript is automatically stripped out, so luckily this isn't that big an issue).
Suggestions: Number fields, use "([0-9]+)" General CSS fields (may not apply to everything), use "([0-9a-zA-Z\-_ ]+)" Hope that helps. If you wish to contact me, you can do so at MyBB Hacks. |
|||
|
05-12-2009, 10:34 PM
Post: #4
|
|||
|
|||
|
RE: [Tutorial] 7 Custom MyCodes for yourr forum
Anyone try this yet?
|
|||
|
05-14-2009, 08:20 AM
Post: #5
|
|||
|
|||
|
RE: [Tutorial] 7 Custom MyCodes for yourr forum
all of these is bad
and doesn't work \[marquee\](.*?)\[/marquee\] must be \[marquee\](*.?)\[/marquee\] and alot of bugs but extra good thing for a n00b oo sorry for newbie ![]() you must learn "regulair expression" befor Best Regards http://www.safadsoft.com 1.4.4 |
|||
|
05-14-2009, 01:16 PM
Post: #6
|
|||
|
|||
|
RE: [Tutorial] 7 Custom MyCodes for yourr forum
Excuse me, they DO work, if you've checked my forum.
I just copy pasted the codes, simply. |
|||
|
05-17-2009, 04:43 PM
Post: #7
|
|||
|
|||
| RE: [Tutorial] 7 Custom MyCodes for yourr forum | |||
|
05-17-2009, 05:12 PM
(This post was last modified: 05-17-2009 05:13 PM by aglioeolio.)
Post: #8
|
|||
|
|||
|
RE: [Tutorial] 7 Custom MyCodes for yourr forum
Thanks for this Tut, nunymare, it´s very usefull
(05-12-2009 11:23 AM)Yumi Wrote: I've seen a number of MyCodes where "(.*?)" expression is used. I thought it'd be about time that I suggest trying to avoid that expression where possible, as this may allow users to perform some minor HTML injection (HTML tags are automatically converted to their entities and Javascript is automatically stripped out, so luckily this isn't that big an issue). Thanks for the Tip Yumi ![]() I´ve got some mycode and they all still used (.*?) []s, Claudio Tutorial: Jquery (by google API) with mybb (Prototype) Distinction between Paid/Free Plugins Threads |
|||
|
05-26-2009, 04:45 AM
Post: #9
|
|||
|
|||
|
RE: [Tutorial] 7 Custom MyCodes for your forum
Thanks!
|
|||
|
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 1 Guest(s)
Search
Member List
Calendar
Help







