Hack mod ubbc (hiệu ứng bài viết)
--------------------------------------------------------------------------------
Code:
--------------------------------------------------------------------------------script language='Javascript' src='html/ibfcode.js'></script>
<td class='row1' width="100%" valign="top">
<table cellpadding='2' cellspacing='2' width='100%' align='center'>
<tr>
<td nowrap width='10%'>
<input type='button' accesskey='b' value=' B ' onClick='simpletag("B")' class='codebuttons' name='B' style="font-weight:bold" onMouseOver="hstat('bold')">
<input type='button' accesskey='i' value=' I ' onClick='simpletag("I")' class='codebuttons' name='I' style="font-style:italic" onMouseOver="hstat('italic')">
<input type='button' accesskey='u' value=' U ' onClick='simpletag("U")' class='codebuttons' name='U' style="text-decoration:underline" onMouseOver="hstat('under')">
<select name='ffont' class='codebuttons' onchange="alterfont(this.options[this.selectedIndex].value, 'FONT')" onMouseOver="hstat('font')">
<option value='0'>{$ibforums->lang['ct_font']}</option>
<option value='Arial' style='font-family:Arial'>{$ibforums->lang['ct_arial']}</option>
<option value='Times' style='font-family:Times'>{$ibforums->lang['ct_times']}</option>
<option value='Courier' style='font-family:Courier'>{$ibforums->lang['ct_courier']}</option>
<option value='Impact' style='font-family:Impact'>{$ibforums->lang['ct_impact']}</option>
<option value='Geneva' style='font-family:Geneva'>{$ibforums->lang['ct_geneva']}</option>
<option value='Times' style='font-family:Verdana'>{$ibforums->lang['ct_verdana']}</option>
<option value='Optima' style='font-family:Optima'>Optima</option>
</select><select name='fsize' class='codebuttons' onchange="alterfont(this.options[this.selectedIndex].value, 'SIZE')" onMouseOver="hstat('size')">
<option value='0'>{$ibforums->lang['ct_size']}</option>
<option value='1'>{$ibforums->lang['ct_sml']}</option>
<option value='7'>{$ibforums->lang['ct_lrg']}</option>
<option value='14'>{$ibforums->lang['ct_lest']}</option>
</select><select name='fcolor' class='codebuttons' onchange="alterfont(this.options[this.selectedIndex].value, 'COLOR')" onMouseOver="hstat('color')">
<option value='0'>{$ibforums->lang['ct_color']}</option>
<option value='blue' style='color:blue'>{$ibforums->lang['ct_blue']}</option>
<option value='red' style='color:red'>{$ibforums->lang['ct_red']}</option>
<option value='purple' style='color
urple'>{$ibforums->lang['ct_purple']}</option>
<option value='orange' style='color
range'>{$ibforums->lang['ct_orange']}</option>
<option value='yellow' style='color:yellow'>{$ibforums->lang['ct_yellow']}</option>
<option value='gray' style='color:gray'>{$ibforums->lang['ct_grey']}</option>
<option value='green' style='color:green'>{$ibforums->lang['ct_green']}</option>
</select>
<a href='java_script_:closeall();' onMouseOver="hstat('close')">{$ibforums->lang['js_close_all_tags']}</a>
</td>
</tr>
<tr>
<td align='left'>
<input type='button' accesskey='h' value=' http:// ' onClick='tag_url()' class='codebuttons' name='url' onMouseOver="hstat('url')">
<input type='button' accesskey='g' value=' IMG ' onClick='tag_image()' class='codebuttons' name='img' onMouseOver="hstat('img')">
<input type='button' accesskey='e' value=' @ ' onClick='tag_email()' class='codebuttons' name='email' onMouseOver="hstat('email')">
<input type='button' accesskey='q' value=' QUOTE ' onClick='simpletag("QUOTE")' class='codebuttons' name='QUOTE' onMouseOver="hstat('quote')">
<input type='button' accesskey='p' value=' CODE ' onClick='simpletag("CODE")' class='codebuttons' name='CODE' onMouseOver="hstat('code')">
<input type='button' accesskey='l' value=' LIST ' onClick='tag_list()' class='codebuttons' name="LIST" onMouseOver="hstat('list')">
<!--<input type='button' accesskey='l' value=' SQL ' onClick='simpletag("SQL")' class='codebuttons' name='SQL'>
<input type='button' accesskey='t' value=' HTML ' onClick='simpletag("HTML")' class='codebuttons' name='HTML'>-->
</td>
</tr>
<tr>
<!-- Help Box -->
<td align='left' valign='middle'>
{$ibforums->lang['hb_open_tags']}: <input type='text' name='tagcount' size='3' maxlength='3' style='font-size:10px;font-family:verdana,arial;border:0px;font-weight:bold;' readonly class='row1' value="0">
<input type='text' name='helpbox' size='50' maxlength='120' style='width:80%;font-size:10px;font-family:verdana,arial;border:0px' readonly class='row1' value="{$ibforums->lang['hb_start']}">
</td>
</tr>
</table>
</td>
</tr> --------------------------------------------------------------------------------
thay bằng:
Code:
--------------------------------------------------------------------------------<td class='row1'>
<script language="javascript" type="text/javascript" src="html/UBBC/ubbc.js"></script>
<script language="javascript" type="text/javascript"><!--
var flash_w = '200'; var flash_h = '400';
var ubbc_dir = 'html/UBBC';
var emoticon_dir = 'html/emoticons';
var use_graphics = 1; // 1 = Graphical, 0 = Form based (buttons)
makeInterface(1,1,use_graphics);
//--></script>
</td> --------------------------------------------------------------------------------
tìm:
code:--------------------------------------------------------------------------------<textarea cols='60' style='width:95%' rows='15' wrap='soft' name='Post' tabindex='3' class='textinput'>$data</textarea> --------------------------------------------------------------------------------
thay bằng:
Code:
--------------------------------------------------------------------------------<textarea cols="60" rows="12" wrap="soft" name="Post" tabindex="3" class="textinput" onClick="storeCaret(this);" onKeyup="storeCaret(this);" onChange="storeCaret(this);" onFocus="storeCaret(this);">$data</textarea>
<script language="javascript"><!--
ubbcInit(1,1,use_graphics);
//--></script> --------------------------------------------------------------------------------
Mở file:.../sources/lib/post_parser.php and Find:
Code:
--------------------------------------------------------------------------------$txt = preg_replace( "#\[s\](.+?)\[/s\]#is", "<s>\\1</s>", $txt ); --------------------------------------------------------------------------------
thêm vô sau:
Code:
--------------------------------------------------------------------------------$txt = preg_replace( "#\[shadow=(\S+?)\s*\](.*?)\[\/shadow\]#is", "<font style='width=80%; filter:shadow\(color=\\1)'>\\2</font>", $txt );
$txt = preg_replace( "#\[glow=(\S+?)\s*\](.*?)\[\/glow\]#is", "<font style='width=80%; filter:glow\(color=\\1)'>\\2</font>", $txt );
$txt = preg_replace( "#\[fliph\](.+?)\[\/fliph\]#is", "<font style='width=80%; filter:flipH'>\\1</font>", $txt );
$txt = preg_replace( "#\[flipv\](.+?)\[\/flipv\]#is", "<font style='width=80%; filter:flipV'>\\1</font>", $txt );
$txt = preg_replace( "#\[move\](.+?)\[\/move\]#is", "<marquee>\\1</marquee>", $txt );
$txt = preg_replace( "#\[blur\](.*?)\[\/blur\]#is", "<font style='width=80%; filter:blur'>\\1</font>", $txt );
$txt = preg_replace( "#\[align\s*=\s*(\S+?)\s*\](.*?)\[\/align\]#is", "<div align=\"\\1\">\\2</div>", $txt );
$txt = preg_replace( "#\[dropshadow=(\S+?)\s*\](.*?)\[\/dropshadow\]#is", "<font style='width=80%; filter:dropshadow(color=\\1)'>\\2</font>", $txt );
$txt = preg_replace( "#(\[invert\])(.+?)(\[/invert\])#is", "<font style='width=80%; filter:invert'>\\2</font>", $txt );
$txt = preg_replace( "#(\[xray\])(.+?)(\[/xray\])#is", "<font style='width=80%; filter:xray'>\\2</font>", $txt );
$txt = preg_replace( "#\[spoiler\](.*)\[/spoiler\]#is", "<\!-- spoilerKillit --><table border=\"0\" cellpadding=\"0\" cellspacing=\"0\"><tr><td bgcolor=\"#000000\" valign=\"middle\" align=\"left\"><font color=\"#000000\" size=\"1\"><b>Spoiler (Highlight to Read)\:</b></font><br></td></tr><tr><td bgcolor=\"#ffffff\" valign=\"middle\" align=\"left\"><font color=\"#ffffff\" size=\"1\"><\!-- spoilerKillitEnd --><\!--txtStart-->\\1<\!--txtEnd--><\!-- spoilerKillit --></td></tr></table><\!-- spoilerKillitEnd -->", $txt );
$txt = preg_replace( "#\[video\](.+?)\[/video\]#is", "<div align=\"center\"><embed SRC=\\1 type=\"audio/x-pn-realaudio-plugin\" CONSOLE=\"Clip1\"CONTROLS=\"ImageWindow,ControlPanel,StatusBar\" HEIGHT=\"230\" WIDTH=\"240\"AUTOSTART=\"false\"></embed>", $txt );
$txt = preg_replace( "#\[sound\](.+?)\[/sound\]#is", "<param name=\"BACKGROUNDCOLOR\" <br /><embed src=\\1 align=\"baseline\" border=\"0\" width=\"275\" height=\"40\" type=\"audio/x-pn-realaudio-plugin\" console=\"Clip1\" controls=\"ControlPanel\" autostart=\"true\">", $txt );
$txt = preg_replace( "#\[web\](.+?)\[/web\]#is", "<IFRAME WIDTH=550 HEIGHT=400 SRC=\\1></IFRAME>", $txt );
$txt = preg_replace( "#\[me\](.+?)\[/me\]#is", "<b>*" . $ibforums->member['name'] . " \\1</b><br>", $txt ); --------------------------------------------------------------------------------
Tiếp tục tìm:
Code:
--------------------------------------------------------------------------------function unconvert($txt="", $code=1, $html=0) {
if ($code == 1)
{ --------------------------------------------------------------------------------
thêm vô sau :
Code:
--------------------------------------------------------------------------------$txt = preg_replace( "#(<font style='width=80%; filter:invert'>)(.+?)(</font>)#is", "\[invert\]\\2\[/invert\]", $txt );
$txt = preg_replace( "#(<font style='width=80%; filter:xray'>)(.+?)(</font>)#is", "\[xray\]\\2\[/xray\]", $txt );
$txt = preg_replace( "#(<marquee>)(.+?)(</marquee>)#is", "\[move\]$2\[/move\]", $txt );
$txt = preg_replace( "#(<font style='width=80%; filter:glow\(color=)(.+?)(\)'>)(.+?)(</font>)#is", "\[glow=\\2\]\\4\[/glow\]", $txt );
$txt = preg_replace( "#(<font style='width=80%; filter:shadow\(color=)(.+?)(\)'>)(.+?)(</font>)#is", "\[shadow=\\2\]\\4\[/shadow\]", $txt );
$txt = preg_replace( "#(<font style='width=80%; filter:flipV'>)(.+?)(</font>)#is", "\[flipv\]\\2\[/flipv\]", $txt );
$txt = preg_replace( "#(<font style='width=80%; filter:flipH'>)(.+?)(</font>)#is", "\[fliph\]\\2\[/fliph\]", $txt );
$txt = preg_replace( '#(<div align=")(.+?)(">)(.+?)(</div>)#is', "\[ALIGN=\\2\]\\4\[/ALIGN\]", $txt );
$txt = preg_replace( "#(<font style='width=80%; filter:blur'>)(.+?)(</font>)#is", "\[blur\]\\2\[\/blur]", $txt );
$txt = preg_replace( "#(<font style='width=80%; filter:dropshadow\(color=)(.+?)(\)'>)(.+?)(</font>)#is", "\[dropshadow=\\2\]\\4\[\/dropshadow\]", $txt );
$txt = preg_replace( "#(<\!--txtStart-->)(.+?)(<\!--txtEnd-->)#is", "\[spoiler\]\\2\[/spoiler\]", $txt );
$txt = preg_replace( "#(<\!-- spoilerKillit -->)(.+?)(<\!-- spoilerKillitEnd -->)#is", "", $txt );
$txt = preg_replace( "#<param name=\"BACKGROUNDCOLOR\" <br /><embed src=(.+?)align=\"baseline\" border=\"0\" width=\"275\" height=\"40\" type=\"audio/x-pn-realaudio-plugin\" console=\"Clip1\" controls=\"ControlPanel\" autostart=\"true\">#" , "\[sound\]\\1\[/sound\]" , $txt );
$txt = preg_replace( "#<div align=\"center\"><embed SRC=(.+?)type=\"audio/x-pn-realaudio-plugin\" CONSOLE=\"Clip1\"CONTROLS=\"ImageWindow,ControlPanel,StatusBar\" HEIGHT=\"230\" WIDTH=\"240\"AUTOSTART=\"false\"></embed>#" , "\[video\]\\1\[/video\]" , $txt );
$txt = preg_replace( "#<IFRAME WIDTH=550 HEIGHT=400 SRC=(.+?)></IFRAME>#" , "\[web\]\\1\[/web\]" , $txt );
$txt = preg_replace( "#\[me\](.+?)\[/me\]#is", "<b>*" . $ibforums->member['name'] . " \\1</b><br>", $txt );
$txt = preg_replace( "#\[me\](.+)#is", "*" . $ibforums->member['name'] . " \\1<br>", $txt ); --------------------------------------------------------------------------------
Sau khi lam xong down cái này up lên thư mục html:
http://babybup.net/index.php?act=Attach&type=post&id=47" target="_blank"> UBBC
Chúc các bạn thành công.....!