Welcome Guest[3.149.235.171], connected from
Comprehensive Guide On Developing MyCodes
|
Post: #1
|
|||
|
|||
Comprehensive Guide On Developing MyCodes
Hello MyBBCodes.com user
We are here with a new and very important tutorial. Its about MyCodes developing. What Are MyCodes: ---------------- MyCodes are an HTML codes that are really important in forum. There importance ranges from decorating to enhancing your forum. What Should I Know Before: ------------------- Before starting mycode to develop, you should be able to know as much basics of HTML, CSS etc. so that you will code your own mycodes without any hasle. The good resources for learning HTML and CSS are these; http://www.w3schools.com/html http://www.w3schools.com/css Our First MyCode: ---------------- We have a code that outputs the text as shown below; ---------- ---------- The code is this; Code:[Highlight] <table border="1" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#FF0000" width="100%"> We have here different things that can be alter and change to some different values and accordingly, the output will also be different. These things are; 1. Table Border 2. Table Width 3. Text 4. Text Align 5. Text Size 6. Text Color In the picture above, we have change all these six things to make our MyCode a more enhanced and better look. You can however change only text aswell, only text + text size OR can change text + text size + text color etc. etc. Lets Start Coding: ---------------- Go to Admin Control Panel > Configuration > MyCode (Select the button from left) > Add New MyCode. ------------ ------------ There you see page something like this; ------------ ------------ Lets first know about what are the meanings of headings written their; #-> Title: Its your MyCode Name #-> Short Description: As name identifies, its your MyCode Description in brief #-> Regular Expression: In different words, It is an HTML embed code. All your codes (HTML OR Video code) will be embed in between these tags. Its syntax is like this; Code:[Highlight] \[TAG\](.*?)\[/TAG\] Code:[Highlight] [TAG]YOUR TEXT[/TAG] ------------ ------------ Code:[Highlight] You must make sure the regular expression is valid and safe—no validation is performed. It is really important; because it replaces HTML code, and giving the right to users to use HTML in their posts is nothing more then a RISK. Therefore, you should use it with extreme focusing it in your mind, and use the (.*?) in a correct way. If it is used with perfect code (.*?) then no fear It will not provide any hacker to gain access. #-> Replacement: It replaces the tags of Regular Expression with the HTML code. #-> Enabled: Offcourse , after adding all the inputs in their relevant boxes, You should enabled it to work properly. #-> Parse Order: Give value what ever you want: 1, or 2, or 3, etc. etc. BUT remember, MyCodes will be parsed in ascending order relative to other MyCodes. #-> Test Value: Enter Regular Expression tags to test the MyCode that you have just created. #-> HTML Result: When you hit the Test MyCode Button, after entering the MyCode's Tags, the HTML result will be shown in this box. #-> Actual Result: This area shows the actual result when the HTML is rendered. Most Important Things: ------------------ As we have noticed that there are two most important things when creating MyCode; these are Regular Expression and Replacement. So now we will take a deep look in only these two things. Replacement: -------------- We are discussing Replacement first. As we have noticed in this Guide that Replacement is an HTML code that needs to be change when Regular Expression's (.*?) is called. In the example given above we have this HTML Code. Code:[Highlight] <table border="1" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#FF0000" width="100%"> What we have to change, its upto you, lets assume that we wants to change these 6 things; 1. Table Border 2. Table Width 3. Text 4. Text Align 5. Text Size 6. Text Color Lets locate them first in the above mentioned Replacement (HTML) code. To locate and change it to in such a way so as to ensure that regular Expression will parse it correctly. To change it, we have to add (.*?) in all the areas where we want to change the values. For example, if we want to change above mentioned six things, we have to insert (.*?) in all their places. The HTML Code after editing will be something like this; Code:[Highlight] <table border="$1" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#FF0000" width="$2%"> YUP.. we insert $1, $2, $3, $4, $5, $6 ... To understand this, you must have to know that; (.*?) = $some_value OR you can say; (.*?) = $1 $some_value is a variable that stores the values of (.*?) in Replacement Code. In the code above, where we have to change the values, we add this variable in ascending oreder. Regular Expression: --------------- As we have learned that we use Code:[Highlight] \[TAG\](.*?)\[/TAG\] for Replacing the tags, BUT you should must know that what we have written. (.*?) = $1 Taking this into consideration, we have to use our Regular Expression Tags (.*?) as much as we have used $variables in our Replacement Code. That's , when we have to ask , in above mentioned Replacement Code, to add Regular Expression's (.*?) in TAGS, we will add this in the following format; \[TAG=(.*?),(.*?),(.*?),(.*?),(.*?)\](.*?)\[/TAG\] You noticed that we use 5 (.*?) inside the TAGS and one (.*?) in between the TAGS. Also we add commas in between the (.*?) ------------- ------------- How To Write Our Code: ------------------ [TAG=border,width,align,size,color]YOUR TEXT[/TAG] You can change the word TAG whatever you want BUT be sure to edit this in Regular Expression First. The output of our newly made MyCode will be something like this; ---------- ---------- You can use / make your own MyCode as long as you follow these simple steps. ----------- ----------- --- Enjoy...! |
|||
Post: #2
|
|||
|
|||
RE: Comprehensive Guide On Developing MyCodes
Thanks for this, I was always wonders how to make them.
|
|||
1 member(s) viewed this thread in the last 365 days :
|
Yeke |
« Next Oldest | Next Newest »
|
WWWHostingServer.com
|
||||||
|
||||||
|
Possibly Related Threads... | |||||
Thread: | Author | Replies: | Views: | Last Post | |
[Tut] How to Add your MyCodes to the Editor Bar? | shinekwt | 6 | 9,834 |
08-08-2011 09:09 AM Last Post: _Un!corn |
|
|
|
|
Powered By MyBB, © 2002-2024 MyBB Group. Golden Crown - Designed and Published by ghazal & exdiogene of MyBBCodes. Hosting provided by WWWHostingServer.com |