VBulletin hack -- two hack about typographical layout

Source: Internet
Author: User
Tags bbcode vbulletin

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]

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.