Being that block-random is now part of the gallery "distribution", please change the line in block-random.php which requires init.php to require_once():
- require(dirname(__FILE__) . "/init.php");
+ require_once(dirname(__FILE__) . "/init.php");
(This should solve problems with people calling block-random along with other 'stuff' that makes use of gallery at the same time. )
Thanks
Gary
Posts: 26
On second thought... there MIGHT be an issue with this suggested change: block-random.php turns off sessions, and then requires init.php. If something ELSE (?) wants to require init.php but with sessions on - sessions.php will not get included..
(I don't know if this would be an issue in actual practice or not...)
Posts: 2322
block-random is *required* to be included via http - if you include as a file, you will encounter issues with multiple definitions. There's no way around this - if block-random is set to require_once and included as a file, Gallery will fail.
Posts: 26
From a Mambo module that uses block-random:
(I also did something similar when trying out drupal some time ago.)
As a software engineer (who had a bad day today) I can attest to the fact that any OTHER programmer will certainly use any library or source in EVERY POSSIBLE way that was never intented (and then complain when it doesn't work.) ;)