Gossamer Forum
Home : Products : Gossamer Links : Discussions :

Build_Images_Path?

Quote Reply
Build_Images_Path?
I see there is a build_images_url available in the settings. Although it is not displayed is there access to the build_images_path for development purposes? Or should I just make my own?

Thanks.


http://www.iuni.com/...tware/web/index.html
Links Plugins
Quote Reply
Re: [Ian] Build_Images_Path? In reply to
I believe it's just a global variable that you can use in your template files. I don't know what you mean by "make your own"?
========================================
Buh Bye!

Cheers,
Me
Quote Reply
Re: [Stealth] Build_Images_Path? In reply to
Quote:
I don't know what you mean by "make your own"?


Hi!

I currently use most of the setting's urls and paths i.e. $CFG->{build_root_url} etc in my plug-ins. What I mean is, since in most cases both a PATH and a URL are defined for any one location, such as the user's cgi-bin directory, or admin directory, that it seems odd there is only an images URL defined, and no images PATH.

It would be a development mistake to ASSUME that a user places their images into anthing but what is defined in the settings, so I was hoping there may have been a reason for this ommision, and that I could still call upon such a CFG settings from somewhere.

Failing this, by building my own, I mean do a conversion of the URL to a path based on the build_root_path information.


http://www.iuni.com/...tware/web/index.html
Links Plugins
Quote Reply
Re: [Ian] Build_Images_Path? In reply to
Yeah it doesn't look like there is one....you may need do find it but its not 100% reliable....you might want to make it a plugin option for admin to enter the path.

Code:
my ($img_path) = $CFG->{build_images_url} =~ m|^http://[^/]+(.*)$|;

substr($img_path, 0, 1) eq '/' and $img_path =~ s|^/+||;

$img_path = $ENV{DOCUMENT_ROOT} . '/' . $img_path;

THen you'd need to do some more checks like...

unless (-d $img_path) {

Its 9.30am so don't take that code as gospel :)

Last edited by:

Paul: Jul 4, 2002, 1:37 AM
Quote Reply
Re: [Paul] Build_Images_Path? In reply to
Thanks very much Paul!

I'll give that a go :)

Its 7:49 am here.... so I won't put it into the plugin yet either!


http://www.iuni.com/...tware/web/index.html
Links Plugins