Not signed in (Sign In)

Vanilla 1.1.10 is a product of Lussumo. More Information: Documentation, Community Support.

    • CommentAuthorIlle
    • CommentTimeAug 21st 2007
     
    Hi,
    Great work!
    I needed a web gallery and appreciate the lightweight aspect and easy-to-use interface of Plogger.
    But I tried to figure out how I could make an image appear in multiple albms without uploading it many times. Tell me if I'm wrong, but I think it's not actually possible (I use Plogger beta3).
    Thus I did modify some php scripts, change some fields in the pictures table and change the way images are stored on the server (all images at the root of the images directory instead of the collection>>album tree). I noticed a bit late that this breaks the mod_rewrite part of Plogger (I was not able to use it, so it didn't hurt me too much). Sure it should not be difficult to repair it, but it's not my first priority. As I'm a rather inexperienced developer, I'm sure my code introduce a lot of bugs and vulnerabilities.

    Whatever, if someone is interested, I can post a diff here.

    Regards,
    Ille
    • CommentAuthorjammindice
    • CommentTimeAug 22nd 2007 edited
     
    you could have just added entries into the database that contained different collection/album locations and pointed to the same file. wouldn't be hard to write something to do this, but no modifications of the original code would be needed, just add a checkbox and another collection/album chooser to the admin under a new tab or something to allow a second/third/4th/etc... album location and it would just create the appropriate entry into the database, and keep track of it somehow...

    just my opinion, but that's how i'd do it.
    • CommentAuthorIlle
    • CommentTimeAug 27th 2007
     
    Right, I first look this way. But it leads a lot of things to do when moving a picture around or deleting an album or collection. Another problem with creating new entries in the database is that you loose the comments reference to a particular image. I mean, comments refer to the entry in the database, not the image path. It means that for the same image, depending on the album you're looking, you will have different comments...
    Thus I'm pretty sure the original code needed to be modified.
    My way is surely not the best way to go. But it works for me: through the admin picture manager interface, I can link/unlink pictures to/from any album just the way the 'move to' function works. I can delete an album/collection, if the picture is a direct child of this album/collection, it gets deleted, else the links list is adjusted. I did modify some other little things cause I didn't want to have the same thumbnail for different collections/albums (so it's choosen randomly).

    Then I just share my code as Plogger is GPL'ed.

    Regards,
    Ille
    • CommentAuthorjammindice
    • CommentTimeAug 28th 2007
     
    i still think just adding another row in the pictures table would be best, then add a column to the pictures table as a "ref_id" which points to the original picture id... if the row is that actual picture entry the ref_id would equal 0 or be the same as id.

    then rewrite some of the functions to do a check to see if id = ref_id if not then get the row from the database where id = ref_id... and replace album/collection with appropriate fields from the first row....

    quick and dirty... but i think it would be easier to do it that way than to rewrite the whole thing.... IANAPD (i am not a professional developer) but i could probably make this work in a weekend... or two... instead of taking weeks to re-write plogger to consider pictures in multiple albums... plus this way probably wouldn't break mod_rewrite since all it would be doing is piecing together the correct values for the current picture....
    • CommentAuthorIlle
    • CommentTimeSep 5th 2007
     
    I did not rewrite the whole thing.
    What I've done is mainly add a column in the picture table (link_to_album) to store the list of albums the row is linked to. Then I modified some functions to take this in account (mainly change the WHERE conditions). I also modified the admin picture_manager to take this in account.
    I did not understand why we to store all images in a tree reflecting the structure Collection=>Album.
    I added some other minor modifications like the ability to hide an album or have a complete album slideshow.
    It takes effectively a week-end, it's also quick and dirty but everything works (apart the mod_rewrite).
    If you want to have a look at the result, go to http://tam.homelinux.org/Tam/lightspaces/

    Regards,
    Ille