VBulletin HACK----Two HACK on typography

Source: Internet
Author: User
Tags bbcode php and reference vbulletin
"Simple text typesetting with VB code"
Reason: 1.1.4 version does not have these, and the domestic more famous Ubb hack home on the addition of a lot of text typesetting UBB code (VB code).
Advantages: Only a few lines, it can be achieved, very simple.
Disadvantages: Because of the need to nest, so if users do not write well, it will affect the style of other content of the post, and even the whole topic.
Self-evaluation: In fact, this is only more HTML code in the form of VB code to achieve, so that people from another perspective to learn how to do the Web text typesetting without learning HTML, but also for security.

Step: Open the global.php and find the
function Bbcodeparse2 ($bbcode, $forumid =0, $allowsmilie =1) {
", in the appropriate place before [code] and other hack, for example,"
Perform a reference reply
$bbcode =eregi_replace ("quote\]", "quote]", $bbcode); lowercase
$bbcode =str_replace ("Reference content rn", "<blockquote><smallfont> citation:</smallfont>$bbcode =str_replace ("[quote]", "<blockquote><smallfont> quote:</smallfont>$bbcode =str_replace ("RN", "$bbcode =str_replace ("[/quote]", "", add in the back"
Hack Color,font,size,style,center
$bbcode =eregi_replace ("\ {0,1} (#[a-z0-9-]{6}) ["]{0,1}\]", "<font color=\1>", $bbcode); [Color=]
$bbcode =eregi_replace ("\[/color\]", "</font>", $bbcode); // ;
$bbcode =eregi_replace ("\ {0,1} ([0-9]{1}) ["]{0,1}\]", "<font size=\1>", $bbcode); [Size=]
$bbcode =eregi_replace ("\[/size\]", "</font>", $bbcode); //  
$bbcode =eregi_replace ("\[font=["]{0,1} ([^\[]*) ["]{0,1}\]", "<font face=" \1 ">", $bbcode); [A]
$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
"And done.
Examples can refer to:

"Prohibit JavaScript"
Reason: vbulletin does not treat JavaScript scripts in any particular way, so if the forum opens up HTML code, it could be hit by alert or window.open.

Step: Open the global.php and find the
if ($dohtml ==0) {
Delete HTML code
$bbcode =str_replace ("&", "&", $bbcode);
$bbcode =str_replace ("<", "<", $bbcode);
$bbcode =str_replace (">", ">", $bbcode);
}
"Before the last curly brace, join the"
} else {
$bbcode =eregi_replace ("< ([/]{0,1}script[^<]*) >", "<\1>", $bbcode);
"And Done!



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.