Creating Custom MyCode
#1
Creating Custom MyCode is quite easy once you understand how it works. Here's a quick overview on how to make Custom MyCode:

First, go to your Admin CP and then to the Message Filters, Custom MyCode, and to Add MyCode.
  • MyCode title
    • That's just the name of the MyCode, fairly simple.

  • MyCode description
    • A basic description of what the MyCode is for; what it does.

  • Regular expression
    • This gets a bit more complicated. On the page, we are given this example:

      \[b\](.*?)\[/b\]

      You need to have the \ before the [ and ] so it will work properly. If you imagine it without the \ it looks very basic:

      [b](.*?)[/b]

      Of course, you will still need the \ back in there for it to work properly without errors, but you can add those back later before you submit it.

    • I believe (I'm not an expert on this, but it's worked for me so far) that you put the (.*?) each time you want a variable - something the user fills in when using the MyCode. So, for instance, we could have this:

      \[a\ href=(.*?) title=(.*?)\](.*?)\[/a\]

      Which would be essentially just like the links in HTML. Now, let's look at the next option:

  • Replacement
    • This is what you want the MyCode to be once the user enters it in. So, for our previous example of the links, you would enter in this:

      <a href="$1" title="$2">$3</a>

    • Basically, all you do is for each (.*?) you put in previously, you put in an incremented variable (such as $1, $2, and $3). It's actually quite simple to understand once you get the hang of it!

  • Activate MyCode
    • This lets you turn it off without deleting it.

Note: If a user is to, for instance, not enter the title in the example above, the MyCode will not work - so if you would want something where users do not have to enter said details, then you should create multiple versions of the same thing, with/without the options.
jsoltesz.com - MyBB lead designer & team member since 2006
Reply


Messages In This Thread
Creating Custom MyCode - by Justin - 2006-09-06, 12:08 AM
RE: Creating Custom MyCode - by sunspark - 2006-09-06, 01:19 AM
RE: Creating Custom MyCode - by Justin - 2006-09-06, 01:22 AM
RE: Creating Custom MyCode - by Snake - 2006-09-06, 01:43 AM
RE: Creating Custom MyCode - by asmilewyt - 2006-09-06, 11:42 AM
RE: Creating Custom MyCode - by Xniver - 2006-09-06, 12:27 PM
RE: Creating Custom MyCode - by asmilewyt - 2006-09-06, 12:56 PM
RE: Creating Custom MyCode - by Xniver - 2006-09-06, 02:12 PM
RE: Creating Custom MyCode - by asmilewyt - 2006-09-06, 02:21 PM
RE: Creating Custom MyCode - by asmilewyt - 2006-09-06, 02:29 PM
RE: Creating Custom MyCode - by Netrosis - 2006-09-06, 02:40 PM
RE: Creating Custom MyCode - by Xniver - 2006-09-06, 03:07 PM
RE: Creating Custom MyCode - by Aweb - 2006-09-06, 04:16 PM
RE: Creating Custom MyCode - by Ozidave - 2006-09-14, 12:00 PM
RE: Creating Custom MyCode - by Galen - 2006-09-12, 06:53 AM
RE: Creating Custom MyCode - by Galen - 2006-09-13, 03:33 AM
RE: Creating Custom MyCode - by WDZ - 2006-09-13, 04:59 AM
RE: Creating Custom MyCode - by Galen - 2006-09-13, 07:09 AM
RE: Creating Custom MyCode - by Chris Boulton - 2006-09-13, 11:32 AM
RE: Creating Custom MyCode - by Galen - 2006-09-13, 06:46 PM
RE: Creating Custom MyCode - by shrek - 2006-09-15, 01:32 PM
RE: Creating Custom MyCode - by Ryan Gordon - 2006-09-15, 02:54 PM
RE: Creating Custom MyCode - by shrek - 2006-09-15, 04:02 PM
RE: Creating Custom MyCode - by Ryan Gordon - 2006-09-15, 10:49 PM
RE: Creating Custom MyCode - by Martin M. - 2006-09-15, 10:58 PM
RE: Creating Custom MyCode - by shrek - 2006-09-16, 03:49 AM
RE: Creating Custom MyCode - by Martin M. - 2006-09-16, 04:03 AM
RE: Creating Custom MyCode - by shrek - 2006-09-16, 04:14 AM
RE: Creating Custom MyCode - by Martin M. - 2006-09-16, 04:27 AM
RE: Creating Custom MyCode - by shrek - 2006-09-16, 04:31 AM
RE: Creating Custom MyCode - by xiaozhu - 2006-09-16, 05:09 AM
RE: Creating Custom MyCode - by shrek - 2006-09-16, 05:48 AM
RE: Creating Custom MyCode - by Martin M. - 2006-09-16, 11:55 AM
RE: Creating Custom MyCode - by WDZ - 2006-09-17, 04:51 AM
RE: Creating Custom MyCode - by imei - 2006-09-27, 01:55 AM
RE: Creating Custom MyCode - by imei - 2006-09-27, 02:06 AM
RE: Creating Custom MyCode - by Chris Boulton - 2006-09-27, 04:47 PM
RE: Creating Custom MyCode - by TheCaptain - 2007-04-20, 06:59 PM
RE: Creating Custom MyCode - by richjohnny - 2007-04-28, 03:56 AM
RE: Creating Custom MyCode - by skilly - 2007-05-16, 06:15 PM
RE: Creating Custom MyCode - by LeX- - 2007-05-16, 07:23 PM
RE: Creating Custom MyCode - by skilly - 2007-05-16, 07:59 PM
RE: Creating Custom MyCode - by ostaki - 2007-05-17, 07:19 PM
RE: Creating Custom MyCode - by ajsuk - 2007-09-09, 10:17 PM
RE: Creating Custom MyCode - by ajsuk - 2007-09-15, 10:09 PM
RE: Creating Custom MyCode - by simonc - 2008-05-20, 09:21 PM
RE: Creating Custom MyCode - by Rob1991 - 2008-06-18, 11:39 PM
RE: Creating Custom MyCode - by LeX- - 2008-06-20, 04:25 PM
RE: Creating Custom MyCode - by Rob1991 - 2008-06-20, 04:27 PM
RE: Creating Custom MyCode - by LeX- - 2008-06-20, 04:54 PM
RE: Creating Custom MyCode - by Rob1991 - 2008-06-20, 05:09 PM
RE: Creating Custom MyCode - by LeX- - 2008-06-20, 05:15 PM
RE: Creating Custom MyCode - by Rob1991 - 2008-06-20, 05:15 PM
RE: Creating Custom MyCode - by LeX- - 2008-06-20, 05:28 PM
RE: Creating Custom MyCode - by Rob1991 - 2008-06-20, 07:12 PM
RE: Creating Custom MyCode - by Rob1991 - 2008-06-28, 08:54 AM
RE: Creating Custom MyCode - by Rob1991 - 2008-06-24, 09:16 AM
RE: Creating Custom MyCode - by Eric - 2008-06-24, 07:20 PM
RE: Creating Custom MyCode - by MrD. - 2008-06-26, 03:19 PM
RE: Creating Custom MyCode - by aglioeolio - 2008-06-27, 11:40 PM
RE: Creating Custom MyCode - by TStarGermany - 2008-07-03, 06:24 PM
RE: Creating Custom MyCode - by lifeguard - 2008-07-06, 11:28 AM
RE: Creating Custom MyCode - by LeX- - 2008-07-06, 11:30 AM
RE: Creating Custom MyCode - by Azagthoth - 2008-08-08, 06:57 AM
RE: Creating Custom MyCode - by lifeguard - 2008-07-06, 11:33 AM
RE: Creating Custom MyCode - by ChiNko5 - 2008-08-13, 08:58 PM
RE: Creating Custom MyCode - by primster7 - 2008-08-08, 06:05 AM
RE: Creating Custom MyCode - by imei - 2008-08-09, 02:32 PM
RE: Creating Custom MyCode - by primster7 - 2008-08-09, 03:28 PM
RE: Creating Custom MyCode - by LeX- - 2008-08-09, 03:19 PM
RE: Creating Custom MyCode - by Ddraiggoch06 - 2008-08-09, 10:34 PM
RE: Creating Custom MyCode - by primster7 - 2008-08-13, 08:54 PM
RE: Creating Custom MyCode - by imei - 2008-08-14, 06:35 PM
RE: Creating Custom MyCode - by primster7 - 2008-08-14, 06:42 PM
RE: Creating Custom MyCode - by seeker - 2008-10-20, 10:10 PM
RE: Creating Custom MyCode - by GraphiX2004 - 2009-09-05, 03:05 AM
RE: Creating Custom MyCode - by Will P - 2010-01-12, 04:31 PM
RE: Creating Custom MyCode - by Yumi - 2010-04-27, 10:30 AM
RE: Creating Custom MyCode - by VAPOR - 2010-10-26, 11:42 PM
RE: Creating Custom MyCode - by sledger - 2011-09-23, 09:32 PM
RE: Creating Custom MyCode - by x-Treme - 2011-09-23, 10:43 PM
RE: Creating Custom MyCode - by sledger - 2011-09-23, 11:29 PM
RE: Creating Custom MyCode - by x-Treme - 2011-09-23, 11:30 PM
RE: Creating Custom MyCode - by sledger - 2011-09-24, 12:01 AM
RE: Creating Custom MyCode - by x-Treme - 2011-09-24, 12:15 AM

Forum Jump:


Users browsing this thread: 1 Guest(s)