Fatal error: Cannot redeclare editfield() (previously declared in d:\dev\nu\apache\apache\htdocs\modules\gallery\util.php:33) in D:\Dev\Nu\Apache\Apache\htdocs\modules\gallery\util.php on line 33
----
Give us your Gallery/webserver information to get a faster answer.
Get this information from the PHP diagnostic (in the configuration wizard).
Gallery version: 1.4.1
Apache version: Apache/1.3.29 (Win32)
PHP Version 4.3.4
Graphics Toolkit: netbpm
Operating system: Windows XP
Well, the same error occurs when clicking on an image or album in the Random, AlbumList and newAlbums block but here is the config line for my random block :
Posted: Mon Dec 01, 2003 4:14 pm Post subject: Re: Fatal error: Cannot redeclare editfield
Interesting tip. After deactivating all three NG related blocks, it now works. After activating the New Album block it still works. However, activating either the Random block or the Album lists block brings the error back. What do you think ?
Here you go (but remember it also happens when using the block-NG-AlbumsList block )
block-NG-Random.php :
PHP: › <?php
global $gallery;
/*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or (at
* your option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
* Developed by Dariush Molavi at NukedGallery.net
* Version 1.0
* 8 August 2003
*/
/*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or (at
* your option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
/*
* Original random block code from gallery.menalto.com
* This updated version (c) 2003 Dariush Molavi
* dari.molavi@nukedgallery.net
* Version 1.0
* 8 August 2003
*/
function get_random_photo_id(){
/* Initializing the seed */
srand ((double) microtime() * 1000000);
// Check the cache file to see if it's up to date
$rebuild = 0;
if (fs_file_exists(CACHE_FILE)) {
$stat = fs_stat(CACHE_FILE);
$mtime = $stat[9];
if (time() - $mtime < CACHE_EXPIRED) {
$rebuild = 1;
}
}
if (!$rebuild) {
scanalbums();
savecache();
} else {
readcache();
}
$album = choosealbum();
if ($album) {
$index = choosephoto($album);
}
return array($album,$index);
}
/*
* --------------------------------------------------
* Support functions
* --------------------------------------------------
*/
function savecache() {
global $cache;
if ($fd = fs_fopen(CACHE_FILE, "w")) {
foreach ($cache as $key => $val) {
fwrite($fd, "$key/$val\n");
}
fclose($fd);
}
}
function readcache() {
global $cache;
if ($fd = fs_fopen(CACHE_FILE, "r")) {
while ($line = fgets($fd, 4096)) {
list($key, $val) = explode("/", $line);
$cache[$key] = $val;
}
fclose($fd);
}
}
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum