Summary:
use $config vars instead of hardcoded pathes
Detailed Description:
Hello Jos,
in Gallery.module.php constants are defined:
define('DEFAULT_GALLERY_PATH', "uploads/images/Gallery/");
define('DEFAULT_GALLERYTHUMBS_PATH', "uploads/images/GalleryThumbs/");
I think this is wrong, since the uploads dir is not always named "uploads".
IMHO This would be the better way:
$config = cmsms()->GetConfig();
define('DEFAULT_GALLERY_PATH', $config['image_uploads_path'] . "/Gallery/");
define('DEFAULT_GALLERYTHUMBS_PATH', $config['image_uploads_path'] .
"/GalleryThumbs/");
But therefore you also need
define('DEFAULT_GALLERY_URL', $config['image_uploads_url'] . "/Gallery/");
define('DEFAULT_GALLERYTHUMBS_URL', $config['image_uploads_url'] .
"/GalleryThumbs/");
because you don't differentiate between URL and PATH. But both may differ.
So when images are displayed use the the URL.
When looking for files at the server use the PATH.
I ran into this issue when creating an xajax-Plugin for frontend that excutes
modules from the plugins dir.
The Gallery module tells me that my Galleries don't exists (wich is wrong). But
obviously it is looking for /plugins/uploads/images/Gallery/ (wich indeed does
not exists). This could be avoided if you use absolue pathes and urls from the
config file.
Just my two cents.
Kind regards
NaN