see live demo!

Not signed in (Sign In)

Categories

 

buy Monoslideshow

via PayPal / credit card

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

Welcome Guest!
Want to take part in these discussions? If you have an account, sign in now.
If you don't have an account, apply for one now.
    • CommentAuthordravekx
    • CommentTimeDec 27th 2009
     permalink

    Hello. Im using version 1.0. Is there a way to tell Monoslideshow to automatically read images from a specific directory without defining every thumbnail and image in an xml?

  1.  permalink

    The only way I know to achieve this is to have some PHP script writing your xml on the fly.
    Christoph

    • CommentAuthorspasmoid
    • CommentTimeJan 5th 2010
     permalink

    <?php /** * This script generates a slideshow for use in conjunction with monoslideshow 1.x * This script is provided as-is for the moment and has not been generalised for * easy adoption. */ header("Content-Type: Application/xml;"); echo "<"."?xml version=\"1.0\" encoding=\"utf-8\"?".">"; ?> <slideshow> <preferences/> <album imagePath="/tk.c/splashes/" thumbnailPath="/tk.c/splashes/thumbs/"> <?php // You might want to set this to the // name of the folder where the images are // relative to this script // you must create a directory called // "thumbs" inside there. $path = "splashes"; if($h = opendir($path)) { while(false !== ($file = readdir($h))) { if(strtolower(substr($file,-4)) == ".jpg" && substr($file,0,1) != ".") { echo "<img src=\"".$file."\" thumbnail=\"".$file."\" />n"; PutThumbs($file,$path); } } } else { die("Could not open images/banners"); } ?> </album> </slideshow> <?php function PutThumbs($file,$path) { try { if(!file_exists($path."/".$file)) return false; $thumb = $path."/thumbs/".$file; if(file_exists($thumb)) { if(fileatime($thumb) > fileatime($path."/".$file)) return true; } $tn = imagecreatetruecolor(100, 50); $source = imagecreatefromjpeg($path."/".$file); // The last two numbers are the sizes of the // original images. The 4th and 3rd last are // the new sizes for the thumbs imagecopyresampled($tn, $source, 0, 0, 0, 0, 100, 50, 1024, 532); imagejpeg($tn,$thumb); imagedestroy($tn); } catch(Exception $e) { var_dump($e); // debug die(); // debug return false; } } ?>

monokai logo © 2009 Monokai, all rights reserved. Buy Monoslideshow.