G3 Plugins, symlinks...

shalafi

Joined: 2008-11-24
Posts: 8
Posted: Wed, 2009-06-10 19:49

Hi all.

I'm planning to take a creey trip into the world of plugins and Gallery3.

My plan is to take the "upload from server" plugin and do a couple of small changes so that it will be able to create symbolic links instead of uploading the images to gallery.

I have no clue when it comes to writing plugins to gallery so i asking you for ideas, hints.. where do i start in the plugin source?

I run a gallery2 site with 20000+ images, all symlinked to a different disk on my server so this would be really neat if i cold make it work.

I know i'll probably only work with linux hosts but thats what I'm using :-)

I'd be happy for any input you can give me

//Jörgen

 
bharat
bharat's picture

Joined: 2002-05-21
Posts: 7994
Posted: Fri, 2009-06-12 08:33

Symlinks is *probably* as easy as writing a module that listens for the item_created() event and deletes the file and replaces it with a symlink. Most of the rest of the Gallery code probably won't notice that it's got a symlink and not the original file (but I don't know that for sure). The trick will be identifying the source file to symlink too.. but I'd suggest that you first write a simple module that can capture events (look in modules/*/helpers/*_event.php for examples)

---
Problems? Check gallery3/var/logs before you post! and file bugs here!
Latest zip: http://github.com/gallery/gallery3/zipball/master
Latest git: http://codex.gallery2.org/Gallery:Using_Git

 
shalafi

Joined: 2008-11-24
Posts: 8
Posted: Fri, 2009-06-12 11:23

Thanks, now i know *lots* more than before

 
XabiX

Joined: 2009-05-27
Posts: 19
Posted: Fri, 2010-09-10 09:17

Hello,

Was there any progress on this? I am in the same situation I don't want to duplicate 30k+ picts within the same server.

Will there be a workaround available, like browsing existing directories/albums and automatically creates the structure with g3 db without really having to import them?

Thanks
XabiX

 
shalafi

Joined: 2008-11-24
Posts: 8
Posted: Fri, 2010-09-10 09:41

As far as i know there is nothing more on this (i know that i haven't been creative :-( ). But *really* hope someone else have taken to the idea. My image collection have grown....+65k

it would help LOTS with this functionality
(the coding idea was no in my skillset)
//Jörgen