![SMEDrieben](https://xoops.org/uploads/avatars/blank.gif)
The php-code I used was copied from the class/texsanitizer/readme.txt. It should be changed there as well.
SMEDrieben
static function decode()
function decode($text)
static function decode($text)
Fatal error: Cannot make static method MyTextSanitizerExtension::decode() non static in class MytsBldwz in C:wampwwwhttpdocsclasstextsanitizerbldwzbldwz.php on line 64
class MytsBldwz extends MyTextSanitizerExtension
{
// The encode function for dhtml editor
function encode($textarea_id)
{
// If the extension has config data, load it
$config = parent::loadConfig(dirname(__FILE__));
// Make sure that the icon is available /images/form/mycode.gif
$code = "
{$this->image_path}/bldwz.gif' alt='Bladwijzer' title='Bladwijzer' onclick='xoopsCodeBldwz("{$textarea_id}","" . htmlspecialchars("Voer de term met bladwijzer in", ENT_QUOTES) . "");' onmouseover='style.cursor="hand"'/> ";
$javascript = << function xoopsCodeBldwz(id, enterBldwzPhrase){
if (enterBldwzPhrase == null) {
enterBldwzPhrase = "Enter the content for the code.";
}
var selection = xoopsGetSelect(id);
if (selection.length > 0) {
var text = selection;
}else {
var text = prompt(enterBldwzPhrase, "");
}
var domobj = xoopsGetElementById(id);
if ( text != null && text != "" ) {
var result = "[bldwz]" + text + "[/bldwz]";
xoopsInsertText(domobj, result);
}
domobj.focus();
}
EOH;
// Return the scripts to be displayed in editor form and the javascript for relevant actions
return array($code, $javascript);
}
// The code parser
function load(&$ts)
{
$ts->patterns[] = "/[bldwz](.*)[/bldwz]/sU";
$ts->replacements[] = '. XOOPS_URL . '/search.php?query=\1&action=results" target="_top">\1';
$ts->patterns[] = "/[bldwz def](.*)[/bldwz]/sU";
$ts->replacements[] = '. XOOPS_URL . '/search.php?query=\1+Begrip:&andor=AND&mids%5B%5D=28&action=results" target="_top">\1';
$ts->patterns[] = "/[bldwz stp](.*)[/bldwz]/sU";
$ts->replacements[] = '. XOOPS_URL . '/search.php?query=\1&mids%5B%5D=28&action=results" target="_top">\1';
$ts->patterns[] = "/[bldwz ([0-9]*)](.*)[/bldwz]/sU";
$ts->replacements[] = '. XOOPS_URL . '/modules/smartfaq/faq.php?faqid=\1" target="_top">\2';
$ts->patterns[] = "/[bldwz KKK=([0-9]*)](.*)[/bldwz]/sU";
$ts->replacements[] = '\2';
$ts->patterns[] = "/[news ([0-9]*)](.*)[/news]/sU";
$ts->replacements[] = '. XOOPS_URL . '/modules/news/article.php?storyid=\1" target="_top">\2';
$ts->patterns[] = "/[smeb ([0-9]*)](.*)[/smeb]/sU";
$ts->replacements[] = '. XOOPS_URL . '/modules/publisher/category.php?categoryid=\1" target="_top">\2';
$ts->patterns[] = "/[smehf ([0-9]*)](.*)[/smehf]/sU";
$ts->replacements[] = '. XOOPS_URL . '/modules/publisher/item.php?itemid=\1" target="_top">\2';
}
// Processing the text
function decode($text)
{
// Load config data if any
$config = parent::loadConfig( dirname(__FILE__) );
if ( empty($text) || empty($config['enabled']) ) return $text;
$ret = someFunctionToConvertTheTextToDefinedFormat($text);
return $ret;
}
}
?>