Writing to g2 db from my own php upload

johnrhoran
johnrhoran's picture

Joined: 2009-01-14
Posts: 6
Posted: Thu, 2009-04-16 20:43

I have my own upload php. I want a slideshow that simply reads my directory containing photos and runs a slide show against the photos in that directory. Is this what G1 does. G2 wants an upload via it's own upload code. I want to use my upload php. As it is now I have clients upload via my upload php and then I have to bulkload those uploads using the 'add item' function found in G2. Too complicated.

Another approach for me would be to write to the G2 db when I write my uploads to my own mysql db. But I see nothing in the G2 code that I can use for this approach.

Any replies apprecieate.

John Horan

 
mridgwel

Joined: 2007-01-27
Posts: 215
Posted: Thu, 2009-04-16 21:39

This isn't exactly writing directly to the db - I'd recommend against that and work with the gallery php code itself - there is a script which adds items to the dallery, but its in perl - you may be able to call this from your php code to add the items that way.

http://codex.gallery2.org/Other_Clients#galleryadd.pl

_________
Mark

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 22890
Posted: Fri, 2009-04-17 00:48
Quote:
I want a slideshow that simply reads my directory containing photos and runs a slide show against the photos in that directory.

Then I guess gallery is a bit more than what you want.

Quote:
Is this what G1 does

No. It is a bit more complex than that.

There is more than one way to add items:
http://codex.gallery2.org/Gallery2:How_to_Add_Items

Quote:
Another approach for me would be to write to the G2 db when I write my uploads to my own mysql db.

Don't write directly to the DB use the api for this purpose. As mridgwel suggested I guess you will have to adapt your own upload php to be similar to galleryadd.pl

Dave

_____________________________________________
Blog & G2 || floridave - Gallery Team

 
alecmyers

Joined: 2006-08-01
Posts: 4338
Posted: Fri, 2009-04-17 08:00

Could have sworn I already posted in this thread ... oh no, that was in one of the other two threads by the same poster asking the same question. One of which I've deleted, the other is here:
http://gallery.menalto.com/node/87172

Could I respectfully request that you post a single query in a single thread? thanks.