Subject:*
<
Name/Email:*
<
Message Icon:*
<
Select*
<
Message:*
<



Click the Preview to see the content in action.
Options:*
<
Confirmation Code*
<
5 + 8 = ?  
Input the result from the expression
Maximum attempts you can try: 10
*
<
     

Re: Addtional textsanitizer extensions do not work
by Mamba on 2017/11/25 0:53:06

Sounds more like cache problem...

I'm glad that it's working now.
Re: Addtional textsanitizer extensions do not work
by SMEDrieben on 2017/11/24 21:58:52

But.... I switched "ref" => to 0, reloaded the page, switched back to 1, saved config,php again, reloaded the page and then ... it worked properly without the &

Cookie or cache problem ?

SMEDrieben
Re: Addtional textsanitizer extensions do not work
by SMEDrieben on 2017/11/24 21:41:41

That's even worse ! It generates both a parse error and a fatal error:

le="color: #000000"><?php Parse error: syntax error, unexpected '<' in C:wamp64wwwhttpdocsclassmodule.textsanitizer.php(445) : regexp code on line 1


le="color: #000000"><?php Fatal error: preg_replace(): Failed evaluating code: <a href="http://www.ntvg.nl/publicatie/vaststellen-van-hersendood-bij-orgaandonatie" target="_blank"><span class="refbal pointer">&nbsp;1&nbsp;<span><b>1.</b>&nbsp;E.J.O. Kompanje, J.L. Epker, Y.J. de Groot, E.F.M. Wijdicks, M. van der Jagt. Vaststellen van hersendood bij orgaandonatie. <em>Ned Tijdschr Geneeskd.</em> 2013;157:A6444</span></span></a> in C:wamp64wwwhttpdocsclassmodule.textsanitizer.php on line 445 Call Stack


Other suggestion ?

SMEDRieben
Re: Addtional textsanitizer extensions do not work
by Mamba on 2017/11/24 20:49:29

Try to remove the "&" so it is:

le="color: #000000"><?php load($ts)


see if it helps...
Re: Addtional textsanitizer extensions do not work
by SMEDrieben on 2017/11/24 19:53:06

This solution worked in 2.5.7.1. Now I am on 2.5.9. and the additional extensions don't work anymore.

I added the extensions to class/textsanitizer/config.php or config-custom.php

le="color: #000000"><?php "ref" => 1, "bldwz" => 1)


Thereafter, [ref] appears in the text, it is not interpreted. This is ref.php
<?php class MytsRef extends MyTextSanitizerExtension { // The code parser public function load(&$ts) { $ts->patterns[] = "/[ref ([0-9]*)](.*)[/ref]/sU"; $ts->replacements[] = '<span class="refbal">&nbsp;\1&nbsp;<span><b>\1.</b>&nbsp;\2</span></span>'; $ts->patterns[] = "/[ref ([0-9]*) news=([0-9]*)](.*)[/ref]/sU"; $ts->replacements[] = '<a href="' . XOOPS_URL . '/modules/news/article.php?storyid=\2" target="_top"><span class="refbal pointer">&nbsp;\1&nbsp;<span><b>\1.</b>&nbsp;\3</span></span></a>'; $ts->patterns[] = "/[ref ([0-9]*) smeb=([0-9]*)](.*)[/ref]/sU"; $ts->replacements[] = '<a href="' . XOOPS_URL . '/modules/publisher/category.php?categoryid=\2" target="_top"><span class="refbal pointer">&nbsp;\1&nbsp;<span><b>\1.</b>&nbsp;\3</span></span></a>'; $ts->patterns[] = "/[ref ([0-9]*) smehf=([0-9]*)](.*)[/ref]/sU"; $ts->replacements[] = '<a href="' . XOOPS_URL . '/modules/publisher/item.php?itemid=\2" target="_top"><span class="refbal pointer">&nbsp;\1&nbsp;<span><b>\1.</b>&nbsp;\3</span></span></a>'; $ts->patterns[] = "/[ref ([0-9]*) url=(.*)](.*)[/ref]/sU"; $ts->replacements[] = '<a href="\2" target="_blank"><span class="refbal pointer">&nbsp;\1&nbsp;<span><b>\1.</b>&nbsp;\3</span></span></a>'; } // Processing the text public static function decode($text, $width, $height) { // Load config data if any $config = parent::loadConfig( dirname(__FILE__) ); if ( empty($text) || empty($config['enabled']) ) return $text; $ret = someFunctionToConvertTheTextToDefinedFormat($text); return $ret; } } ?>


refbal is defined as class in style.css of my theme.

In the debug, there is one warning (many times repeated):
le="color: #000000"><?php Waarschuwing: Parameter 1 to MytsRef::load() expected to be a reference, value given in bestand /class/module.textsanitizer.php regel 770


How can I get my extensions working ?

Thanks !

SMEDrieben

Who's Online

512 user(s) are online (444 user(s) are browsing Support Forums)


Members: 0


Guests: 512


more...

Donat-O-Meter

Stats
Goal: $15.00
Due Date: Jul 31
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $15.00
Make donations with PayPal!

Latest GitHub Commits