2012-09-08, 07:45 PM
2012-09-08, 11:57 PM
You can create your own MyCodes, overwriting the default ones. The replacement will be the mycode it self:
Regular Expression:
Replacement:
That should do it.
Regular Expression:
\[img\](.*?)\[\/img\]
Replacement:
[img]$1[/img]
That should do it.
2012-09-09, 10:50 AM
Yes I thought that, but I wanted to know if there was a file or something that had all the default ones in it...
2012-09-09, 10:13 PM
Right, maybe a core edit suits it better, open ./inc/class_parser.php, find:
Remove the ones you don't want or create new mycodes for them. There may be some issues if you choose to remove them all.
$standard_mycode['b']['regex'] = "#\[b\](.*?)\[/b\]#si";
$standard_mycode['b']['replacement'] = "<span style=\"font-weight: bold;\">$1</span>";
$standard_mycode['u']['regex'] = "#\[u\](.*?)\[/u\]#si";
$standard_mycode['u']['replacement'] = "<span style=\"text-decoration: underline;\">$1</span>";
$standard_mycode['i']['regex'] = "#\[i\](.*?)\[/i\]#si";
$standard_mycode['i']['replacement'] = "<span style=\"font-style: italic;\">$1</span>";
$standard_mycode['s']['regex'] = "#\[s\](.*?)\[/s\]#si";
$standard_mycode['s']['replacement'] = "<del>$1</del>";
$standard_mycode['copy']['regex'] = "#\(c\)#i";
$standard_mycode['copy']['replacement'] = "©";
$standard_mycode['tm']['regex'] = "#\(tm\)#i";
$standard_mycode['tm']['replacement'] = "™";
$standard_mycode['reg']['regex'] = "#\(r\)#i";
$standard_mycode['reg']['replacement'] = "®";
$standard_mycode['url_simple']['regex'] = "#\[url\]([a-z]+?://)([^\r\n\"<]+?)\[/url\]#sei";
$standard_mycode['url_simple']['replacement'] = "\$this->mycode_parse_url(\"$1$2\")";
$standard_mycode['url_simple2']['regex'] = "#\[url\]([^\r\n\"<]+?)\[/url\]#ei";
$standard_mycode['url_simple2']['replacement'] = "\$this->mycode_parse_url(\"$1\")";
$standard_mycode['url_complex']['regex'] = "#\[url=([a-z]+?://)([^\r\n\"<]+?)\](.+?)\[/url\]#esi";
$standard_mycode['url_complex']['replacement'] = "\$this->mycode_parse_url(\"$1$2\", \"$3\")";
$standard_mycode['url_complex2']['regex'] = "#\[url=([^\r\n\"<&\(\)]+?)\](.+?)\[/url\]#esi";
$standard_mycode['url_complex2']['replacement'] = "\$this->mycode_parse_url(\"$1\", \"$2\")";
$standard_mycode['email_simple']['regex'] = "#\[email\](.*?)\[/email\]#ei";
$standard_mycode['email_simple']['replacement'] = "\$this->mycode_parse_email(\"$1\")";
$standard_mycode['email_complex']['regex'] = "#\[email=(.*?)\](.*?)\[/email\]#ei";
$standard_mycode['email_complex']['replacement'] = "\$this->mycode_parse_email(\"$1\", \"$2\")";
$standard_mycode['hr']['regex'] = "#\[hr\]#si";
$standard_mycode['hr']['replacement'] = "<hr />";
$nestable_mycode['color']['regex'] = "#\[color=([a-zA-Z]*|\#?[0-9a-fA-F]{6})](.*?)\[/color\]#si";
$nestable_mycode['color']['replacement'] = "<span style=\"color: $1;\">$2</span>";
$nestable_mycode['size']['regex'] = "#\[size=(xx-small|x-small|small|medium|large|x-large|xx-large)\](.*?)\[/size\]#si";
$nestable_mycode['size']['replacement'] = "<span style=\"font-size: $1;\">$2</span>";
$nestable_mycode['size_int']['regex'] = "#\[size=([0-9\+\-]+?)\](.*?)\[/size\]#esi";
$nestable_mycode['size_int']['replacement'] = "\$this->mycode_handle_size(\"$1\", \"$2\")";
$nestable_mycode['font']['regex'] = "#\[font=([a-z ]+?)\](.+?)\[/font\]#si";
$nestable_mycode['font']['replacement'] = "<span style=\"font-family: $1;\">$2</span>";
$nestable_mycode['align']['regex'] = "#\[align=(left|center|right|justify)\](.*?)\[/align\]#si";
$nestable_mycode['align']['replacement'] = "<div style=\"text-align: $1;\">$2</div>";
Remove the ones you don't want or create new mycodes for them. There may be some issues if you choose to remove them all.
2012-09-15, 11:56 AM
Thank you very much