Home  >  Article  >  Backend Development  >  vbulletin vBulletin HACK----Two HACKs about typesetting

vbulletin vBulletin HACK----Two HACKs about typesetting

WBOY
WBOYOriginal
2016-07-29 08:34:471095browse

"Simple text typesetting implemented with vB ​​code"
Reason: There is no such thing in version 1.1.4, and the more famous UBB HACK home in China has added a lot of UBB codes (vB codes) for text typesetting.
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.
Step: Open global.php, look for "
function bbcodeparse2($bbcode,$forumid=0,$allowsmilie=1) {
", in the appropriate position before [code] and other HACKs, such as "
" // Execute the reference Reply
      $bbcode=eregi_replace("quote]","quote]",$bbcode);   // Lowercase                                     $bbcode=str_replace("[quote]rn","
Quote:< ;/smallfont> ;
",$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]","< ;/font>",$bbcode); // [/size]
$bbcode=eregi_replace("[f face="1">",$bbcode); // [f
$bbcode=eregi_replace("[ /font]","
",$bbcode); // // [/font]
$bbcode=eregi_replace("[style=["]{0,1}([^[]*) ["]{0,1}]","",$bbcode); // [style=]
$bbcode=eregi_replace("[/style]","< /span>",$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 attacked by alert or window.open and fall.
Steps: Open global.php and search for "
if ($dohtml==0) {
// Delete HTML code
$bbcode=str_replace("&","&",$bbcode);
$bbcode=str_replace(
else {
        $bbcode=eregi_replace("<([/]{0,1}script[^<]*)>","<1>",$bbcode);
", done!
【The copyright of this article is jointly owned by the author and Aosuo.com. If you need to reprint, please indicate the author and source】

The above introduces vbulletin vBulletin HACK----two HACKs about typesetting, including vbulletin content. I hope it will be helpful to friends who are interested in PHP tutorials.

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