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

Re: [sangiro] Grabbing files from the Web

Quote Reply
Re: [sangiro] Grabbing files from the Web In reply to
Hi,

Mmm.. thats pretty hard :/

What you would need to do - is have a hook on add_link , and then grab the image.

Then, the hard bit is getting it into the tables.

1) You would need to add the value into your field in the glinks_Links table
2) Then, add another entry (with the new path and URL to the image) into glinks_Links_Files
3) Finally, save the image into a hashed directory.

Getting the hash number is something like:

Code:
my $max_id = $DB->table('Links_Files')->select( ['MAX(ID)'] )->fetchrow; # get the highest ID, which should be the entry you just added
my $fletter = ( reverse split //, $fid )[0]; # get the hashed folder number from the ID.

...$fletter then holds the "hashed" folder ..i.e /path/to/file/$letter/$file

As you can see, not very easy =)

Hope that helps.

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!
Subject Author Views Date
Thread Grabbing files from the Web EZFrag 9927 Feb 14, 2008, 12:48 AM
Thread Re: [EZFrag] Grabbing files from the Web
Andy 9786 Feb 14, 2008, 1:19 AM
Post Re: [Andy] Grabbing files from the Web
EZFrag 9748 Feb 14, 2008, 1:24 AM
Post Re: [Andy] Grabbing files from the Web
EZFrag 9719 Feb 14, 2008, 3:29 AM
Thread Re: [Andy] Grabbing files from the Web
sangiro 9738 Feb 14, 2008, 6:23 AM
Thread Re: [sangiro] Grabbing files from the Web
Andy 9732 Feb 14, 2008, 6:33 AM
Thread Re: [Andy] Grabbing files from the Web
EZFrag 9683 Feb 15, 2008, 1:43 AM
Thread Re: [EZFrag] Grabbing files from the Web
Andy 9699 Feb 15, 2008, 2:03 AM
Thread Re: [Andy] Grabbing files from the Web
EZFrag 9725 Feb 15, 2008, 2:22 AM
Thread Re: [EZFrag] Grabbing files from the Web
Andy 9727 Feb 15, 2008, 2:42 AM
Thread Re: [Andy] Grabbing files from the Web
EZFrag 9710 Feb 15, 2008, 2:43 AM
Thread Re: [EZFrag] Grabbing files from the Web
Andy 9764 Feb 15, 2008, 2:49 AM
Thread Re: [Andy] Grabbing files from the Web
EZFrag 9709 Feb 15, 2008, 3:45 AM
Thread Re: [EZFrag] Grabbing files from the Web
Andy 9731 Feb 15, 2008, 3:50 AM
Post Re: [Andy] Grabbing files from the Web
EZFrag 9655 Feb 15, 2008, 3:59 AM
Post Re: [sangiro] Grabbing files from the Web
eupos 9705 Feb 14, 2008, 7:28 AM