
المشاركة الأصلية كتبت بواسطة طير شلوى
hack_poem_1.php :con2:
الظاهر انك ملخبط في الموضوع اخوي العندليب :nice:
انا اقصد الملف functions_bbcodeparse.php
وآسف على الازعاج
إي والله إني ملخبط :funny:
المعذره كنت أرد على الموضوعين في نفس الوقت
بالنسبه لخطوات التعديل
إذا كنت قد سبق وقمت بالترقيع الأخير فعليك إستبدال الملف لأن هناك أسطر كثيره قمت بالتعديل فيها ولكن لو كان الملف جديد ولم تقم بأي ترقيع فيه فاتبع الأتي :
1- إفتح ملف functions_bbcodeparse.php وابحث عن السطر التالي:
كود PHP:
$bbcodes['custom']['recurse']['highlight'][0] = array('replace_html' => "<span class=\"highlight\">\\7</span>");
- أضف بعده مايلي :
كود PHP:
// For Magic-Box Added By AL3NDALEEB
$bbcodes['custom']['find']['[poem'] = '#\[poe[m] (\s|"|"|\'|)(.*)\\1\](<br>|<br />|\r\n|\n|\r)??(.*)(<br>|<br />|\r\n|\n|\r)??\[/poe[m]\]#esiU';
$bbcodes['custom']['replace']['[poem'] = "handle_bbcode_normal('\\4', '\\2', '', 'poem')";
$bbcodes['custom']['recurse']['poem'][0] = array('handler' => 'handle_bbcode_normal');
$bbcodes['custom']['find']['[frame='] = '#\[frame=("|"|\'|)([0-9]+)[ ]+([0-9]+)[ ]*\\1\](<br>|<br />|\r\n|\n|\r)??(.*)(<br>|<br />|\r\n|\n|\r)??\[/frame\]#esiU';
$bbcodes['custom']['replace']['[frame='] = "handle_bbcode_normal('\\5', '\\2', '\\3', 'frame')";
$bbcodes['custom']['recurse']['frame'][0] = array('handler' => 'handle_bbcode_normal');
$bbcodes['custom']['find']['[grade='] = '#\[grade=("|"|\'|)(.*)\\1\](<br>|<br />|\r\n|\n|\r)??(.*)(<br>|<br />|\r\n|\n|\r)??\[/grade\]#esiU';
$bbcodes['custom']['replace']['[grade='] = "handle_bbcode_normal('\\4', '\\2', '', 'grade')";
$bbcodes['custom']['recurse']['grade'][0] = array('handler' => 'handle_bbcode_normal');
$bbcodes['custom']['find']['[glint]'] = '#\[glint\](<br>|<br />|\r\n|\n|\r)??(.*)(<br>|<br />|\r\n|\n|\r)??\[/glint\]#esiU';
$bbcodes['custom']['replace']['[glint]'] = "handle_bbcode_normal('\\2', '', '', 'glint')";
$bbcodes['custom']['recurse']['glint'][0] = array('handler' => 'handle_bbcode_normal');
$bbcodes['custom']['find']['[blink]'] = '#\[blink\](<br>|<br />|\r\n|\n|\r)??(.*)(<br>|<br />|\r\n|\n|\r)??\[/blink\]#esiU';
$bbcodes['custom']['replace']['[blink]'] = "handle_bbcode_normal('\\2', '', '', 'blink')";
$bbcodes['custom']['recurse']['blink'][0] = array('handler' => 'handle_bbcode_normal');
$bbcodes['custom']['find']['[glow='] = '#\[glow=("|"|\'|)([0-9a-fA-F]+)\\1\](<br>|<br />|\r\n|\n|\r)??(.*)(<br>|<br />|\r\n|\n|\r)??\[/glow\]#esiU';
$bbcodes['custom']['replace']['[glow='] = "handle_bbcode_normal('\\4', '\\2', '', 'glow')";
$bbcodes['custom']['recurse']['glow'][0] = array('handler' => 'handle_bbcode_normal');
$bbcodes['custom']['find']['[ramv]'] = '#\[ramv\](.*)\[/ramv\]#esiU';
$bbcodes['custom']['replace']['[ramv]'] = "handle_bbcode_normal('\\1', '', '', 'ramv')";
$bbcodes['custom']['recurse']['ramv'][0] = array('handler' => 'handle_bbcode_normal');
$bbcodes['custom']['find']['[rams]'] = '#\[rams\](.*)\[/rams\]#esiU';
$bbcodes['custom']['replace']['[rams]'] = "handle_bbcode_normal('\\1', '', '', 'rams')";
$bbcodes['custom']['recurse']['rams'][0] = array('handler' => 'handle_bbcode_normal');
$bbcodes['custom']['find']['[media]'] = '#\[media\](.*)\[/media\]#esiU';
$bbcodes['custom']['replace']['[media]'] = "handle_bbcode_normal('\\1', '', '', 'media')";
$bbcodes['custom']['recurse']['media'][0] = array('handler' => 'handle_bbcode_normal');
$bbcodes['custom']['find']['[flash='] = '#\[flash=("|"|\'|)(.*)\\1\]([w|W][i|I][d|D][t|T][h|H][=])\\1([0-9]+)\\1[ ]+([h|H][e|E][i|I][g|G][h|H][t|T][=])\\1([0-9]+)\\1\[/flash\]#esiU';
$bbcodes['custom']['replace']['[flash='] = "handle_bbcode_normal('\\2', '\\4','\\6', 'flash')";
$bbcodes['custom']['recurse']['flash'][0] = array('handler' => 'handle_bbcode_normal');
//
3- إبحث عن السطر التالي :
كود PHP:
// ###################### Start bbcodeparse #######################
4- أضف قبله مايلي :
كود PHP:
// ################################################################
// For Magic-Box Added By AL3NDALEEB
function handle_bbcode_normal($message, $param1 = '', $param2 = '', $type = '' )
{
// remove empty codes
if (trim($message) == '' || $type == '')
{
return '';
}
// remove unnecessary escaped quotes
$message = strip_smilies(str_replace('\\"', '"', $message));
if($type == 'poem'){
// remove smilies from param
$param1 = strip_smilies($param1);
$param1 = str_replace('\\"', '"', $param1);
$param1 = str_replace('"', '"', $param1);
$param1_find = array('/([a-z]+:)/si', '/&(?![a-z0-9#]+;)/si', '/&[a-z]+;([a-z0-9#]+;)/si', '/`/si', '/\'/si');
$param1_replace = array('', '', '', '', '');
$param1 = preg_replace($param1_find, $param1_replace, $param1);
$param1 = str_replace('"', '"', $param1);
$message = strip_bbcode($message, false, true);
$message = poemtext_get($message);
$html = '<div tag="'.$param1.'" style="display:none">'.$message.'</div><script>doPoem(0)</script>';
}elseif($type == 'frame'){
$param1 = intval($param1);
$param2 = intval($param2);
if($param1 > 10 || $param1 < 1)
$param1 = 1;
if($param2 > 100 || $param2 < 0)
$param2 = 100;
$message = strip_bbcode_by_tag($message,'frame');
$html = '<div id="myframe" tag="'.$param1.'|'.$param2.'" style="display:none">'.$message.'</div><script>drawFrame()</script>';
}elseif($type == 'grade'){
$param1 = strip_smilies($param1);
$param1 = str_replace('\\"', '"', $param1);
$param1 = str_replace('"', '"', $param1);
$param1_find = array('/([a-z]+:)/si', '/&(?![a-z0-9#]+;)/si', '/&[a-z]+;([a-z0-9#]+;)/si', '/`/si', '/\'/si');
$param1_replace = array('', '', '', '', '');
$param1 = preg_replace($param1_find, $param1_replace, $param1);
$param1 = str_replace('"', '"', $param1);
$message = strip_bbcode_by_tag($message,'move');
$html = '<div id="mygradient" tag="'.$param1.'" style="display:none">'.$message.'</div><script>drawGradient()</script>';
}elseif($type == 'flash'){
if (!preg_match('#^[a-z]+://#si', $message))
return '';
$param1 = intval($param1);
$param2 = intval($param2);
$html = '<div align="center">';
$html .='<embed src="'.$message.'" width="'.$param1.'" height="'.$param2.'" quality="high" loop="true" menu="false" TYPE="application/x-shockwave-flash" AllowScriptAccess="never" nojava="true"></embed>';
$html .='</div>';
}elseif($type == 'glint'){
$message = strip_bbcode_by_tag($message,'move');
$html = '<div tag="1" id="myglinttext" style="filter:alpha(opacity=0);width:100%;padding:3;margin:-3">'.$message.'</div>';
}elseif($type == 'ramv'){
if (!preg_match('#^[a-z]+://#si', $message))
return '';
$html = '<div align="center">';
$html .='<embed SRC="'.$message.'" type="audio/x-pn-realaudio-plugin" CONSOLE="Clip1" CONTROLS="ImageWindow,ControlPanel,StatusBar" HEIGHT="230" WIDTH=300" AUTOSTART="false" AllowScriptAccess="never" nojava="true"></embed>';
$html .='</div>';
}elseif($type == 'rams'){
if (!preg_match('#^[a-z]+://#si', $message))
return '';
$html = '<div align="center">';
$html .='<embed SRC="'.$message.'" type="audio/x-pn-realaudio-plugin" CONSOLE="Clip1" CONTROLS="ControlPanel,StatusBar" HEIGHT="100" WIDTH=300" AUTOSTART="false" AllowScriptAccess="never" nojava="true"></embed>';
$html .='</div>';
}elseif($type == 'media'){
if (!preg_match('#^[a-z]+://#si', $message))
return '';
$html = '<div align="center">';
$html .='<embed src="'.$message.'" AllowScriptAccess="never" nojava="true"></embed>';
$html .='</div>';
}elseif($type == 'blink'){
$message = strip_bbcode_by_tag($message,'move');
$html = '<span id="myblinktext">'.$message.'</span>';
}elseif($type == 'glow'){
$message = strip_bbcode_by_tag($message,'move');
$html = '<div style="filter:glow(Color='.$param1.',Strength=5); width:100%;padding:3;margin:-3">'.$message.'</div>';
}
return $html;
}
function strip_bbcode_by_tag($message,$tag)
{
$tag = preg_replace('#[^a-z0-9]#i', '', $tag);
$find[0] = '#\[('.$tag.')=("|"|\'|)(.+)\\2\]#siU';
$find[1] = '#\[/('.$tag.')\]#siU';
$replace[0] = '';
$replace[1] = '';
return preg_replace($find, $replace, $message);
}
function poemtext_get($message){
$msg = '';
$message = preg_split('/\r/',$message);
foreach( $message as $line ){
if(preg_match('/(.*)=(.*)/', $line)){
$msg .= $line . "\n";
}
}
return $msg;
}
// #################################################################################
5- احفظ الملف وقم برفعه
انتهى