ZenphotoCMS Forum
Error messages appearing - Printable Version

+- ZenphotoCMS Forum (https://forum.zenphoto.org)
+-- Forum: Support (https://forum.zenphoto.org/forum-1.html)
+--- Forum: General support (https://forum.zenphoto.org/forum-4.html)
+--- Thread: Error messages appearing (/thread-2044.html)



Error messages appearing - mandarin - 2008-01-08

After running without any issues suddenly getting two error messages at top of all pages. Any idea as to cause and solution please?

Warning: Invalid argument supplied for foreach() in /home/rhovan/public_html/gallery/zp-core/controller.php on line 41

Warning: Cannot modify header information - headers already sent by (output started at /home/rhovan/public_html/gallery/zp-core/controller.php:41) in /home/rhovan/public_html/gallery/index.php on line 12




Error messages appearing - mandarin - 2008-01-08

To add to the above, the problem appears to be related to a server upgrade to PHP 5 overnight by host.

What is likely to be needed to get the gallery going again please.




Error messages appearing - sbillard - 2008-01-09

The quick answer is to turn off the Captcha option. The longer answer is to modify the code in controller.php

Currently it reads:
`if (getOption('Use_Captcha')) {

$d = getOption('last_captcha_purge');

$expire = time() - 86400;

if ($d > $expire) {

chdir(SERVERCACHE . "/");

$filelist = glob('code_*.png');

foreach ($filelist as $file) {

  $file = SERVERCACHE . "/" . $file;

  if (filemtime(&#36;file) < &#36;expire) {

    unlink(&#36;file);

  }

}

}

setOption('last_captcha_purge', time());

}`

It needs to say:
`if (getOption('Use_Captcha')) {

&#36;d = getOption('last_captcha_purge');

&#36;expire = time() - 86400;

if (&#36;d > &#36;expire) {

chdir(SERVERCACHE . "/");

&#36;filelist = glob('code_*.png');

if (&#36;filelist) {

foreach (&#36;filelist as &#36;file) {

  &#36;file = SERVERCACHE . "/" . &#36;file;

  if (filemtime(&#36;file) < &#36;expire) {

    unlink(&#36;file);

  }

}

}

}

setOption('last_captcha_purge', time());

}`