Home » (トップ) » Blog » Follow » Blog/Follow/2006-06-14


<?php
class LinkTarget extends XCube_ActionFilter
{
    function preFilter() {
        $this->mController->mRoot->mDelegateManager->add("MyTextSanitizer.XoopsCodePre",array(&$this,"BBCodePre"));
    }
    function BBCodePre(&$patterns, &$replacements, $allowimage) {
       foreach(array_keys($patterns) as $key) {
            if (preg_match('/\[(site)?url\=/',$patterns[$key])) {
                $replacements[$key] = str_replace('target="_blank"', '', $replacements[$key]);
            }
        }
    }
}
?>

Counter: 7504, today: 1, yesterday: 2

flagflag

メインメニュー

XOOPS初心者サーチ


Add to Google

Xoops Cube Project

XOOPS Cube Project Site

XC Developers Ring

http://img.simpleapi.net/small/http://www.peak.ne.jp/xoops/ SIZE:128x128(7.6KB)