5411
SMEDrieben
Re: Bug in custom code in class textsanitizer
  • 2015/10/17 11:43

  • SMEDrieben

  • Not too shy to talk

  • Posts: 173

  • Since: 2009/6/17


Thanks Mamba ! This solves the problem.

The php-code I used was copied from the class/texsanitizer/readme.txt. It should be changed there as well.

SMEDrieben



5412
Mamba
Re: Bug in custom code in class textsanitizer
  • 2015/10/17 9:58

  • Mamba

  • Moderator

  • Posts: 11373

  • Since: 2004/4/23


If the function is declared "static" in the parent as in:

static function decode()

you cannot then re-declare it as non-static:

function decode($text)

You need to declare "static" as it was done in the parent, i.e.
static function decode($text)
Support XOOPS => DONATE
Use 2.5.10 | Docs | Modules | Bugs



5413
SMEDrieben
Bug in custom code in class textsanitizer
  • 2015/10/16 19:14

  • SMEDrieben

  • Not too shy to talk

  • Posts: 173

  • Since: 2009/6/17


I have made a custom code in class textsanitizer. It worked fine till recently. I don't know if it went wrong after moving tot 2.5.7.1 of to php 5.4 (tested on 5.4.12 and 5.4.45-0+deb7u1).

This is the error:
Fatal errorCannot make static method MyTextSanitizerExtension::decode() non static in class MytsBldwz in C:wampwwwhttpdocsclasstextsanitizerbldwzbldwz.php on line 64


This is my custom code (bldwz.php) that is a modification of the readme.txt that is found in class/textsanitizer

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::loadConfigdirname(__FILE__) );
        if ( empty(
$text) || empty($config['enabled']) ) return $text;
        
$ret someFunctionToConvertTheTextToDefinedFormat($text);
        return 
$ret;
    }
}
?>


Line 64 is almost the latest with only "}".

Any idea what is wrong ?

Thanks !

SMEDrieben



5414
Cesagonchu
Re: PLEASE, I need to install a good module for visitors download mp3 audio

Thanks oswaldo



5415
oswaldo
Re: PLEASE, I need to install a good module for visitors download mp3 audio
  • 2015/10/14 20:09

  • oswaldo

  • Quite a regular

  • Posts: 215

  • Since: 2008/8/22


Ok I will proceed to translate them today, thanks.



5416
Cesagonchu
Re: PLEASE, I need to install a good module for visitors download mp3 audio

I sent the latest wfdownloads module (3.23 RC5) on Transifex.
There are still some files to translate, for example, in spanish:

http://www.transifex.com/xoops/wfdownloads/language/es_ES/

Resized Image



5417
Mamba
Re: cronjob cleaning xoops cache ?
  • 2015/10/12 12:08

  • Mamba

  • Moderator

  • Posts: 11373

  • Since: 2004/4/23


Google results for "xoops cron cache":

1) How to create a cron in Xoops

2) cleaning templace_c folder

3) How to make a function similar to a cron job...

It seems like XoopsCare would be the best start for you...
Support XOOPS => DONATE
Use 2.5.10 | Docs | Modules | Bugs



5418
oswaldo
Re: PLEASE, I need to install a good module for visitors download mp3 audio
  • 2015/10/12 2:33

  • oswaldo

  • Quite a regular

  • Posts: 215

  • Since: 2008/8/22


Quote:
I need the spanish language

Search the spanish files at transifex



5419
mjoel
cronjob cleaning xoops cache ?
  • 2015/10/11 22:05

  • mjoel

  • Quite a regular

  • Posts: 325

  • Since: 2006/12/9


anyone know how to clear xoops cache automatically each morning...

/cache/smarty_cache/
/cache/smarty_compile/
/cache/xoops_cache/



5420
Mamba
Re: Publisher 1.02 RC-1 available for testing
  • 2015/10/11 2:07

  • Mamba

  • Moderator

  • Posts: 11373

  • Since: 2004/4/23


I'll be looking into it this weekend. Hopefully by Monday we'll find the issues...
Support XOOPS => DONATE
Use 2.5.10 | Docs | Modules | Bugs




TopTop
« 1 ... 539 540 541 (542) 543 544 545 ... 29425 »



Login

Who's Online

501 user(s) are online (368 user(s) are browsing Support Forums)


Members: 0


Guests: 501


more...

Donat-O-Meter

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

Latest GitHub Commits