Home  >  Article  >  Backend Development  >  vBulletin HACK----Two HACK_PHP tutorials about typesetting

vBulletin HACK----Two HACK_PHP tutorials about typesetting

WBOY
WBOYOriginal
2016-07-21 16:02:191013browse



"Simple text typesetting implemented with vB ​​code"
Reason: There is no such thing in version 1.1.4, and the more famous domestic UBB HACK house has added a lot of UBB codes for text typesetting ( vB code).
Advantages: It only takes a few lines to implement, very simple.
Disadvantages: Because it requires nesting, if the user writes poorly, 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 implement more HTML code in the form of vB code, so that people can learn how to typeset text on the Web from another angle without having to learn HTML, and for safety.

Steps: Open global.php, look for "
function bbcodeparse2($bbcode,$forumid=0,$allowsmilie=1) {
", before [code] and other HACKs as appropriate Position, such as "
// Perform quote reply
$bbcode=eregi_replace("quote]","quote]",$bbcode); // Lowercase
$bbcode=str_replace("[quote] rn","

Quote:
",$bbcode);
$bbcode=str_replace("[quote]","
< smallfont>Quote:
",$bbcode);
$bbcode=str_replace("[/quote]rn","
",$bbcode) ;
$bbcode=str_replace("[/quote]","
",$bbcode);
", add "
" // Hack color,font ,size,style,center
$bbcode=eregi_replace("[color=["]{0,1}(#[a-z0-9-]{6})["]{0,1}]" ,"",$bbcode); // [color=]
$bbcode=eregi_replace("[/color]","
",$bbcode); // [/color];
$bbcode=eregi_replace("[size=["]{0,1}([0-9]{1})["]{0,1}]","",$bbcode); // [size=]
$bbcode=eregi_replace("[/size]","
",$bbcode); // [/size]
       $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
”, completed.
For examples, please refer to:

"No JavaScript"
Reason: vBulletin does not do any special treatment for Javascript scripts, so if the forum opens HTML code, it may be alerted or windowed .open attack and fell.

Steps: Open global.php and search for "
if ($dohtml==0) {
" // Delete HTML code
$bbcode=str_replace("&","&" ,$bbcode);
$bbcode=str_replace("<","<",$bbcode);
$bbcode=str_replace(">",">",$bbcode);
}
", before the last curly brace, add "
} else {
} $bbcode=eregi_replace("<([/]{0,1}script[^<]* )>","<1>",$bbcode);
", done!


[The copyright of this article is jointly owned by the author and Oso.com. If you need to reprint, please indicate the author and source]

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/316612.htmlTechArticle"Simple text typesetting implemented with vB ​​code" Reason: There is no such thing in version 1.1.4, and domestic comparisons The famous UBB HACK house has added a lot of UBB codes for text typesetting (vB code...
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn