• 插件开发
  • 求教下,这段另外一个程序的代码怎么修改

这是一个XN的插件代码,怎么修改成HB适合用的。。。

HB的机制还没研究透。。。.


$CNTV = preg_match_all('/\[CNTV\](.*?)\[\/CNTV\]/i',$first['message_fmt'],$array);

if($CNTV){

for($i=0;$i<count($array[0]);$i++){

$a = $array[0][$i];

$b = $array[1][$i];

$c = '<div id="embed_playerid" style="text-align:center"></div><script type="text/javascript" src="http://js.player.cntv.cn/innerShare.js"></script><script type="text/javascript" src="http://js.player.cntv.cn/creator/swfobject.js"></script><script type="text/javascript">var fo = createPlayer("v_player",640,480);fo.addVariable("videoId","vid");fo.addVariable("videoCenterId","';

$d = '");fo.addVariable("videoType","0");fo.addVariable("videoEditMode","1");fo.addVariable("isAutoPlay","false");fo.addParam("wmode","opaque");writePlayer(fo,"embed_playerid");</script>';

$e = "$c$b$d";

if($user){

$first['message_fmt'] = str_replace($a,$e,$first['message_fmt']);

}else{

$first['message_fmt'] = str_replace($a,$e,$first['message_fmt']);

}

}

}


这个是帖子输出转义,使用Action\Thread.php 钩子,要用哪个钩子。。。