X-Git-Url: https://git.nubati.net/cgi-bin/gitweb.cgi?p=phpfspot.git;a=blobdiff_plain;f=phpfspot_img.php;h=a96d5e6f41c1d4ed86dd46933c36bdb9faf441e2;hp=de677e558c56fe3ae76cbfcadd9d266520f17f11;hb=9b898a713707b6ff09f2550307a2d23ae248cd1b;hpb=a552181a7fe679d8aebc24d75f61dcfe445b9f04 diff --git a/phpfspot_img.php b/phpfspot_img.php index de677e5..a96d5e6 100644 --- a/phpfspot_img.php +++ b/phpfspot_img.php @@ -1,5 +1,26 @@ parent = new PHPFSPOT; @@ -14,13 +38,27 @@ class PHPFSPOT_IMG { } // __construct() + /** + * PHPFSPOT_IMG class destructor + */ public function __destruct() { } // __desctruct() + /** + * sends the specified image to the browser + * + * this function will send the specified image to + * the client - in the specified width. it also try's + * to create on-the-fly missing thumbnails via PHPFSPOT + * gen_thumbs function. + */ public function show($idx, $width = 0) { + if($idx == 'rand') + $idx = $this->parent->get_random_photo(); + $details = $this->parent->get_photo_details($idx); if(!$details) { @@ -77,7 +115,7 @@ class PHPFSPOT_IMG { } -if(isset($_GET['idx']) && is_numeric($_GET['idx'])) { +if(isset($_GET['idx']) && (is_numeric($_GET['idx']) || $_GET['idx'] == 'rand')) { $img = new PHPFSPOT_IMG;