By using VBCodeImplemented simple text Layout
Cause: This is not available in version 1.1.4, and the famous UBB hack home in China adds a lot of UBB Code (VB Code) for text layout ).
Advantage: only a few lines are required.
Disadvantage: Nesting is required, so if the user does not write well, it will affect the style of other content in the post, and even affect the entire topic.
Self-evaluation: in fact, this is only to implement more HTML code in the form of VB Code, in order to let people learn how to typeset WEB text from another perspective, instead of learning html, for security.
Step: open global. php and find"
Function bbcodeparse2 ($ bbcode, $ forumid = 0, $ allowsmilie = 1 ){
", The proper location before [Code] and other hack, such as"
// Execute reference reply
$ Bbcode = eregi_replace ("Quote \]", "quote]", $ bbcode); // lowercase
$ Bbcode = str_replace ("[quote] RN", "<BLOCKQUOTE> <smallfont> reference: </smallfont> <HR>", $ bbcode );
$ Bbcode = str_replace ("[quote]", "<BLOCKQUOTE> <smallfont> reference: </smallfont> <HR>", $ bbcode );
$ Bbcode = str_replace ("[/quote] RN", "<HR> </BLOCKQUOTE>", $ bbcode );
$ Bbcode = str_replace ("[/quote]", "<HR> </BLOCKQUOTE>", $ bbcode );
", Add"
// Hack color, Font, size, style, center
$ Bbcode = eregi_replace ("\ [color = ["] {0, 1} (# [a-z0-9-] {6}) ["] {0, 1} \]", "<font color = \ 1>", $ bbcode); // [color =]
$ Bbcode = eregi_replace ("\ [/color \]", "</font>", $ bbcode); // [/color];
$ Bbcode = eregi_replace ("\ [size = ["] {0, 1} ([0-9] {1}) ["] {0, 1} \]", "<font size = \ 1>", $ bbcode); // [size =]
$ Bbcode = eregi_replace ("\ [/size \]", "</font>", $ bbcode); // [/size]
$ Bbcode = eregi_replace ("\ [font = ["] {0, 1} ([^ \ [] *) ["] {0, 1} \]", "<font face =" \ 1 ">", $ bbcode); // [font =]
$ Bbcode = eregi_replace ("\ [/font \]", "</font>", $ bbcode); // [/font]
$ Bbcode = eregi_replace ("\ [Style = ["] {0, 1} ([^ \ [] *) ["] {0, 1} \]", "<span style =" \ 1 ">", $ bbcode); // [Style =]
$ Bbcode = eregi_replace ("\ [/style \]", "</span>", $ bbcode); // [/style]
$ Bbcode = eregi_replace ("\ [center \]", "<p align = center>", $ bbcode); // [center =]
$ Bbcode = eregi_replace ("\ [/center \]", "</P>", $ bbcode); // [/center]
// End hack color size style
.
Examples can be referred:
Prohibit Javascript
Cause: VBulletin does not take any special treatment on JavaScript scripts. Therefore, if HTML code is opened on the forum, it may be attacked by alert or window. Open.
Step: open global. php and find"
If ($ dohtml = 0 ){
// Delete HTML code
$ Bbcode = str_replace ("&", "&", $ bbcode );
$ Bbcode = str_replace ("<", "<", $ bbcode );
$ Bbcode = str_replace (">", ">", $ bbcode );
}
", Before the last curly braces, add"
} Else {
$ Bbcode = eregi_replace ("<([/] {0, 1} script [^ <] *)>", "<\ 1>", $ bbcode );
", Complete!
[This article is copyrighted by the author and osuo. If you need to reprint it, please indicate the author and its source]