3.2.0

phpnuke compatible? stripos_clone()

Has anyone successfully used active widgets inside a phpnuke module?

The program seems to be working fine, until I put it inside a module. Then I get this errror.

Fatal error: Cannot redeclare stripos_clone() (previously declared in c:\program files\easyphp1-8\www\mainfile.php:114) in c:\program files\easyphp1-8\www\mainfile.php on line 114

the mainfile.php function looks like this

// We want to use the function stripos,
// but thats only available since PHP5.
// So we cloned the function...
if(!function_exists('stripos')) {
  function stripos_clone($haystack, $needle, $offset=0) {
    return strpos(strtoupper($haystack), strtoupper($needle), $offset);
  }
} else {
// But when this is PHP5, we use the original function
  function stripos_clone($haystack, $needle, $offset=0) {
    return stripos($haystack, $needle, $offset=0);
  }
}


I've looked for something similar in grid.js without luck.

Ideas?
CodyG
November 24,

This topic is archived.

See also:


Back to support forum