11
SMEDrieben
Re: 2.5.8 Upgrade: textsanitizer
  • 2016/8/22 13:09

  • SMEDrieben

  • Not too shy to talk

  • Posts: 173

  • Since: 2009/6/17


In previous Xoops-version, I made an additonal TextSanitizer extension according to the readme.txt:

<?php
class MytsRef extends MyTextSanitizerExtension
{
    
// The code parser
    
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
    
static function decode($text)
    {
        
// Load config data if any
        
$config parent::loadConfigdirname(__FILE__) );
        if ( empty(
$text) || empty($config['enabled']) ) return $text;
        
$ret someFunctionToConvertTheTextToDefinedFormat($text);
        return 
$ret;
    }
}
?>


It now generates an message:

OnbekendDeclaration of MytsRef::decode() should be compatible with MyTextSanitizerExtension::decode($url$width$heightin bestand /class/textsanitizer/ref/ref.php regel 28


How can I solve this message ?

SMEDrieben

12
geekwright
Re: 2.5.8 Upgrade: textsanitizer

I've opened an issue on GitHub to make sure we get that readme.txt updated. Thanks for pointing that out!

In the mean time, changing the two function declarations as follows should clear up any errors that might show up.

...
     
// The code parser
    
public function load($ts
    {

...

    
// Processing the text
    
public static function decode($text$width$height)
    {
...


You don't have to do anything with the extra parameters to decode, they just have to be there to satisfy the inheritance rules set from the parent class.

Quote:

SMEDrieben wrote:
In previous Xoops-version, I made an additonal TextSanitizer extension according to the readme.txt:

...

It now generates an message:

OnbekendDeclaration of MytsRef::decode() should be compatible with MyTextSanitizerExtension::decode($url$width$heightin bestand /class/textsanitizer/ref/ref.php regel 28


How can I solve this message ?

SMEDrieben

13
SMEDrieben
Re: 2.5.8 Upgrade
  • 2017/2/25 11:37

  • SMEDrieben

  • Not too shy to talk

  • Posts: 173

  • Since: 2009/6/17


I'am now on 2.5.8.1. On opening the admin, the tab section at the right does not start default with the rescue ring. I read the suggestion to upgrade to Tabs 1.2.7, but I don not know how to do.

What file should be replaced ? How can I upgrade tot Tab 1.2.7 ?

SMEDrieben

Login

Who's Online

216 user(s) are online (116 user(s) are browsing Support Forums)


Members: 0


Guests: 216


more...

Donat-O-Meter

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

Latest GitHub Commits