Not signed in (Sign In)

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

    • CommentAuthorJohan
    • CommentTimeDec 4th 2005
     
    I am currently developing an object oriented flash interface to the plogger system. It went remarkable well to a point of a few issues, mostly interface stuff. I have made an gallery-xml.php that generates all the xml I need to intergrate plogger to flash, really easy even though it is an pretty nasty hiearchy of php code.

    I will share this modification with all of you once I have finished my prototype. I have some issues with blank lines being printed aswell so the browsers doesn't really like the xml, even thought Flash can read it without any problems.

    Now to the point, I haven't really started looking into how I can set the large images to be resized with an max height instead of max width? Interface design will look a million times better using this way of displaying images, where I can set max height of my galleries.

    Is there any easy way to make this setting without destroying a lot of connected functions based on this property?

    By the way, I really like the plogger!
    • CommentAuthorddejong
    • CommentTimeDec 5th 2005
     
    plog-functions.php, line ~75, change:
    $phpThumb->w = $thumb_config['size'];

    to

    $phpThumb->h = $thumb_config['size'];

    And Plogger will instead use the configured thumbnail constraint for height (h) instead of width (w).

    Regards,
    Derek

    PS. This sounds amazing; you might look at dev.plogger.org for the most current build of Beta 3, it might make your project even better and current for Beta 3.
    • CommentAuthorJohan
    • CommentTimeDec 5th 2005 edited
     
    Ahh thank you! It takes some time to get into the code! I will definatly use beta 3 instead then!
    I could use some help though, I will try to explain how I have made the output so far.

    As it is now, I make an request to get the Collections, then another request to get the albums, another to get the thumbs, and last for the picture.
    This could be made alot easier if I could get everything in one xmlfile like this:


    ----------------------------------------------------
    Collection
      Album (contains name, sort order, etc)
        Image (contains image, thumb, exif etc)
          Comment (Contains user, mail, comment etc)
        Image
        Image
        Image
      Album
        Image
        Image
    Collection
      Album
    ...
    ...
    ----------------------------------------------------

    However, I could pretty easily write my own .php file and retrieve the data from the database, but the problem with this is your magnicificant image handling functions that uses imagecache etc.
    As it is now, the images wont resize when I call them from within flash, even though I use ie "index.php?level=album&id=5". I don't really know why it doesnt, but I will try to figure out!
    The most brilliant would be that when I request an image, I call for an .php that returns the image, in that case I could be able to use then resizing functions you have written. Any tips and Ideas perhaps?

    However, when I feel there is some kind stable grounds with this I will release the xml generator aswell as the .fla file for everyone to use! I will try to make the .fla as "templateified :)" as possible.
    I started this project no more than 50 hours ago, and I didn't know about Plogger 52 hours ago :)
    • CommentAuthorddejong
    • CommentTimeDec 5th 2005 edited
     
    Well, consider (and I mean generally, I'm not asking you to do it) implementing AJAX to retreive images (potentially using thumbnail navigation). Not only does that mean picture/album could amalgamated, but you should expect to see a reduction in bandwidth usage and load times.

    Why are my ramblings relevant? Because the XMLHTTPRequest (the core of AJAX) would require a similar XML microformat, something which held the image and metadata. Something similar could be created holding collection or album data. The AJAX or Flash app could then just query for the formats then appropriately parse and handle the file.

    For an example of a Plogger extension using XML, take a look at plog-rss.php. A specific application, but at its core it's an XML manifestation of Plogger galleries.

    Interesting idea. Mike or Anti might know of some functions of interest which already exist, I'm still trying to get acquainted myself.

    Cheers,
    Derek
    • CommentAuthorJohan
    • CommentTimeDec 5th 2005
     
    I don't really see the benfits using Ajax to collect xml data from the database, and the requests for image from flash are handled as Ajax does, or am I totally wrong here? I'm not that acquainted to Ajax but I think we're talking about the same way to handle requests. Through my flashapp I'll only make 3 general requests,

    1. Retrieve all xml data, for everything, and I mean -all of it- :)
    2. Parse this into objects, as the tree I described above, as it is now, I need to track each item within flash, and the object-orientation messes up since I need to store each image as it's on parent.
    3. Send an request (much similar to Ajax), for any image the user want to view.

    I have allready completed this phase, but it doesn't seem like the images are resizing if the settings are changed in the administration. I will look into that later today.

    But I'd love to learn more ways for doing this, and if I am wrong about Ajax, it would be great fun to implement that aswell, new techniques rule! :)
    • CommentAuthorJohan
    • CommentTimeDec 5th 2005
     
    Hmm, I can't find the beta 3 anywhere at dev.plogger.org, could someone please point me in the right direction?
    •  
      CommentAuthormike
    • CommentTimeDec 5th 2005
     
    Johan, you'll need an SVN client (TortoiseSVN is good), do a "checkout" on http://svn.plogger.org/plogger/trunk/.

    Note: just about anything in this version is subject to change without notice.

    Look forward to seeing your project =)
    •  
      CommentAuthormike
    • CommentTimeDec 5th 2005
     
    Also Johan, if you would like to resize images on the fly using a simple PHP call (thus bypassing our generate_thumb function), phpThumb has a built in URL parser which will do this.

    An HTML example here:
    <IMG SRC="/plogger/lib/phpThumb/phpThumb.php?src=/image.jpg&w=100">

    This would resize image.jpg to 100 pixels wide and put the resulting path into the src attribute of this image tag. Seems like you could apply the same technique to your project. You would probably have to implement your own caching system though, as you wouldn't want to regenerate a thumbnail if it already exists.

    See php.readme.txt in your lib/phpThumb directory for a complete list of parameters.
    • CommentAuthorddejong
    • CommentTimeDec 5th 2005
     
    My point regarding AJAX was that it performs XML requests, the same way your Flash program does. I wasn't suggesting the use of Javascript to interface with Flash (though Flikr might do so); it was a suggestion that the XML query extension could be put to several purposes. My interest is AJAX, yours is Flash, but we could both rely on the same underlying functions.

    Also, I think loading the entire database won't give you the desired result, particularly for larger galleries. I think breaking the queries up would produce the best results.

    Regards,
    Derek
    • CommentAuthorJohan
    • CommentTimeDec 5th 2005
     
    The most timeconsuming part will be to rewrite the chaching system, eventhough I think I could re-use some of your code. I hade hoped that I could keep my little side-order within one file, (rewriting only gallery.php), so your users could download something like gallery-xml.php with some basic .fla files so everyone that felt like it could make her / his own flashbased plogger gallery. Maybe there isn't that many who would like to use plogger with an flash interface? :)

    Anyhow, I really hope I'm not stepping on anyones feet with my "project".. I just want to make a great system even better!
    •  
      CommentAuthormike
    • CommentTimeDec 5th 2005
     
    I think a flash based interface would be cool. In fact, you could potentially package and release it as a "theme" with our new theming system in Beta 3.
    •  
      CommentAuthormike
    • CommentTimeDec 5th 2005
     
    Johan, something to look into is phpThumbs built in caching system. This might save you a bit of time. Check out phpThumb.config.php and try setting the cache directory to plogger/thumbs/. Hope that helps...
    • CommentAuthorJohan
    • CommentTimeDec 6th 2005 edited
     
    Edit, Edit, Edit :)

    I just think I found a way to make this more easier than I first thought!
    • CommentAuthorJohan
    • CommentTimeDec 6th 2005 edited
     
    never mind!
    • CommentAuthorJohan
    • CommentTimeDec 6th 2005
     
    Ok, I don't know if anyone really care or so, but I just feel the urge to tell you all that I've solved the image handling, in every direction :), sometimes I just don't see clear :)

    My little project is getting really neat, your ideas of how to store images and such, and your new code in the latest builds, made this really easy. I had to add some tags to clear out the .css, .js and some tabled output in your base-scripts, other than that, everything works just fine keeping it strict to templates!
    • CommentAuthorJohan
    • CommentTimeSep 21st 2007 edited
     
    I want to bring this thread to light again! I would really like to see an option in the admin interface, where I can choose this.
    Now I have to manually, in each installation, go to Line #516 in plog-functions.php and change:

    // set data
    $phpThumb->setSourceFileName($source_file_name);
    if ($imgdata[0] > $imgdata[1]) {
    $phpThumb->w = $thumb_config['size'];
    } else {
    $phpThumb->h = $thumb_config['size'];
    }

    to:

    // set data
    $phpThumb->setSourceFileName($source_file_name);
    $phpThumb->w = $thumb_config['size'];

    The point with this is, as I've mentioned, I want to scale images based on a max width, instead of maxsize at any direction. Designing the projects get way more easy and flexible!