MyBB Community Forums

Full Version: MyCode Tutorial
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
How to create your own MyCode

To create your own MyCode you will need basic knowledge in HTML

Let's start.

Go to create a new MyCode in the Admin CP.

Now you will see six fields of options.

Title
Here you insert the name of your new MyCode

Short Description
Information about your MyCode

Regular Expression
This is where you decide how your MyCode should be used

Replacement
And this is what happens when you type the Regular Expression

Enabled?
On / Off Switch

Parse Order
In what order your MyCode will be displayed



First you need to think of the Regular Expression.

If you want to use a single tag without have to end it like [help] you type
\[help\]

If you want to use a double tag, with ending it like [help]Content[/help] you type
\[help\](.*?)\[/help\]

The (.*?) is the definition of what the Replacement will find. The first (.*?) is $1, and the second (.*?) is $2 and so on.

Now for your Replacement.

Let's say you want users to see this when people type [help]Content[/help]

This user has requested assistance : Content.

Then you will have to type this into the regular expression.

<bold>This user has requested assistance</bold> : <font color="red">$1</font>

See that I put the $1 there? It defines the first (.*?) used in the Regular Expression.

This is just something really simple that you could do.

This tutorial was written by Clone

Thanks
Awesome tutorial dude, this is making me want to focus on making MyCodes!
I want to mycode Display in posting page,just a you click a icon or text and its automatically insert in your post...
like a when we click a center button its add own code in post.
thanks for This Great Tuturial...