VBulletinHACK ---- two HACK about typographical layout

Source: Internet
Author: User
Tags bbcode
The reason for simple text layout implemented by vB code: This is not found in version 1.1.4, the famous UBBHACK home in China has added a lot of UBB code (vB code) for text formatting ). 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 just to put more HTML code in the form of vB code "simple text layout implemented by vB code"
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 ("

Reference content

Rn ","

Reference: ", $ Bbcode );
$ Bbcode = str_replace ("[quote]","
Reference: ", $ Bbcode );
$ Bbcode = str_replace ("

Rn ","
", $ Bbcode );
$ Bbcode = str_replace ("[/quote]","
", $ Bbcode );
", Add"
// Hack color, font, size, style, center
$ Bbcode = eregi_replace ("\ {} (# [a-z0-9-] {6}) ["] {0, 1} \] "," ", $ bbcode ); // [color =]
$ Bbcode = eregi_replace ("\ [/color \]", "", $ bbcode );//;
$ Bbcode = eregi_replace ("\ {0, 1} ([0-9] {1}) ["] {0, 1} \] "," ", $ bbcode ); // [size =]
$ Bbcode = eregi_replace ("\ [/size \]", "", $ bbcode );//
$ Bbcode = eregi_replace ("\ [font = ["] {0, 1} ([^ \ [] *) ["] {0, 1} \]", "", $ bbcode); // [font =]
$ Bbcode = eregi_replace ("\ [/font \]", "", $ bbcode); // [/font]
$ Bbcode = eregi_replace ("\ [style = ["] {0, 1} ([^ \ [] *) ["] {0, 1} \]", "", $ bbcode); // [style =]
$ Bbcode = eregi_replace ("\ [/style \]", "", $ bbcode); // [/style]
$ Bbcode = eregi_replace ("\ [center \]","

", $ Bbcode); // [center =]
$ Bbcode = eregi_replace ("\ [/center \]","

", $ 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]

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.