How to add these Mycodes?

Socialize

Reputable
Joined
Jun 16, 2013
Messages
161
Reaction score
0
FP$
1,519
Code:
.info, .success, .warning, .error, .mes, .tips, .chat, .cnb {
    margin: 10px 0px;
    padding: 10px 10px 15px 50px;
    background-repeat: no-repeat;
    background-position: 10px center;
    border-radius: 4px 4px 4px;
}
.info {
    background-color: #d1e4f3;
    background-image: url("http://cdn1.iconfinder.com/data/icons/musthave/24/Information.png");
    color: #00529B;
    border: 1px solid #4d8fcb;
}
.success {
    background-color: #effeb9;
    background-image: url("http://cdn3.iconfinder.com/data/icons/fatcow/32x32_0020/accept.png");
    color: #4F8A10;
    border: 1px solid #9ac601;
}
.warning {
    background-color: #ffeaa9;
    background-image: url("http://cdn3.iconfinder.com/data/icons/fatcow/32x32_0400/error.png");
    color: #9F6000;
    border: 1px solid #f9b516;
}
.error {
    background-color: #fccac3;
    background-image: url("http://cdn1.iconfinder.com/data/icons/CrystalClear/32x32/actions/messagebox_critical.png");
    color: #D8000C;
    border: 1px solid #db3f23;
}
.mes {
    background-color: #F2F2F2;
    background-image: url("http://cdn2.iconfinder.com/data/icons/fugue/bonus/icons-32/mail.png");
    border: 1px solid #AAAAAA;
    color: #545454;
}
.tips {
    background-color: #FEEAC9;
    background-image: url("http://cdn5.iconfinder.com/data/icons/woocons1/Light%20Bulb%20On.png");
    border: 1px solid #D38E49;
    color: #bb640c;
}
.chat {
    background-color: #daecfb;
    background-image: url("http://cdn2.iconfinder.com/data/icons/drf/PNG/iChat.png");
    border: 1px solid #2078c9;
    color: #066ac4;
}
I already added these to my global css, but how do I the expression and html replacement to make sure the mycode is functional?
 
Can you give a little information on what you're trying to do? Specifically, things like what the BBCode should look like, and what your want the tag to look like ([this][/this]).
 
pandaa said:
Can you give a little information on what you're trying to do? Specifically, things like what the BBCode should look like, and what your want the tag to look like ([this][/this]).

This. What does this MyCode even supposed to do?
 
They display a colored border with a custom message like [info]test[/info] and suppose to display a blue border and a icon.
 
Once you have the CSS added into the global.css for that skin, go to your configuration -> MyCode part.

1- Give the MyCode a title so you know what it is. (There is an optional spot for a description too, it's a good idea to use this also to help keep things clear.)

2- Now for regular expression enter the name you want the code to be, with the brackets (escaped). So for example:
Code:
\[info\](.*?)\[/info\]
Note the \ before each bracket. This is called escaping. It's used to stop the parser/compiler from throwing errors when it encounters these brackets just tossed in. (If something doesn't work, check to ensure there are \ before each bracket in the regular expression section.)

The (.*?) part refers to the user entered data. In the next step it'll be referred to by another designation. Though they are not interchangeable. Only use the (.*?) for the regular expression section.

3- Next look at replacement and enter:
Code:
<div class="info">$1</div>
$1 refers to the text (pulled from the database) that the user entered. Everything else there is the HTML that will be substituted in by the parser when the person enters that MyCode and the page gets rendered.

4- Ensure the setting for your MyCode to be enabled is set to "Yes".

5- Then set the parse order to 1 higher than whatever your last MyCode is. (If you haven't created any mycodes... set it to 1, then when you make a new one set it to 2. Then 3 for the 3rd one, etc...)

6- Finally, click the save button.

7 (Optional) - It'd be a good idea at this point just to open a post and try entering the text/MyCode you just created then previewing it to see what happens. (Just to test what happens before spending a lot of time making some codes only to find they don't look/work how you want them to.) You don't have to actually submit the post though, simply previewing it should be more than sufficient to show you what will happen.

Now you have to repeat creating new MyCodes, but this time change "info" to the next one you want to add. (So replace info with success in both the regular expression part and the replacement part.)

So try that and let us know how it goes.
 
Thanks for the help! It worked and the additional information was really helpful and never knew the true meanings. It is highly important to know what your putting into when coding. Thank you so much again! 🙂
 
I'm going to archive this, let us know if you need any further help! 🙂
 
Back
Top Bottom