Gossamer Forum
Home : Products : Gossamer Links : Development, Plugins and Globals :

Access a 'files' save point?

Quote Reply
Access a 'files' save point?
I'm trying to make a plugin that edits the size/looks of an image once it has been submitted by a user. In the admin area, there is an option for 'save path'. How would I go about grabbing this path? The only reason I ask, is because I want to access the image where it is, and then save the the modified version to the same directory, with a slightly different name.

Any help is much appreciated Smile

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] Access a 'files' save point? In reply to
Prolly through $CFG. Look in the config file for the variable name.
Quote Reply
Re: [Paul] Access a 'files' save point? In reply to
Can't see it Frown Alex, GT, anyone?

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Paul] Access a 'files' save point? In reply to
I've checked $CFG, $DB and $IN. None of them hold the value Unimpressed

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Paul] Access a 'files' save point? In reply to
Just so people know...I have managed to work out a way to do this;

Code:
# grab the file save path...
my (@data);
my $file = $CFG->{admin_root_path}."/defs/".$DB->prefix."Links.def";
open(READF,$file) || &error("Can't read $file. Reason: $!");
@data = <READF>;
close(READF);

my $found = 0;
my (@exploded,$path);
foreach (@data) {
chomp;
if ($_ =~ /$_ImageField/) { $found = 1; }
if ($found) {
if ($_ =~ /file_save_in/) {
s/^\s//g;
s/\s$//g;
s/[',\>]//g;
s/file_save_in =//g;
$path = $_;
last;
}
}
}

$_ImageField is defined earlier up the script. It holds the value of the field for the image... i.eTestImage, ImageField, etc.

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] Access a 'files' save point? In reply to
My word, you like making things hard for yourself.

Code:
my $schema = $DB->table('Links')->cols;
Quote Reply
Re: [Paul] Access a 'files' save point? In reply to
I like my way.... it makes me look clever Laugh

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] Access a 'files' save point? In reply to
Trust me, it doesn't =)
Quote Reply
Re: [Paul] Access a 'files' save point? In reply to
Ok, so maybe your method was easier Tongue

Code:
print $schema->{'TestImage'}->{'file_save_in'};

Smile

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!