| | Copyright: copyright (C) 2004 by Mike de Boer | | Description: zOOm Image Gallery, a multi-gallery component for | | Mambo based on RSGallery by Ronald Smit. It's the most | | feature-rich gallery component for Mambo! | | Filename: special.php | | Version: 2.1.1 | | | ----------------------------------------------------------------------- **/ // MOS Intruder Alerts defined( '_VALID_MOS' ) or die( 'Direct Access to this location is not allowed.' ); /** There are three special image-display formats: 0: Top ten viewed images (most hits) 1: Ten last submitted images (last id's) 2: Ten last commented images 4: Top rated **/ switch($sorting){ case 0: $database->setQuery("SELECT DISTINCT img.imgid AS id, img.catid AS gallery_id FROM #__zoomfiles AS img LEFT JOIN #__zoom AS cats ON img.catid = cats.catid WHERE imghits > 0 AND cats.catpassword = '' AND img.published = 1 ORDER BY imghits DESC LIMIT 10"); break; case 1: $database->setQuery("SELECT DISTINCT img.imgid AS id, img.catid AS gallery_id FROM #__zoomfiles AS img LEFT JOIN #__zoom AS cats ON img.catid = cats.catid WHERE cats.catpassword = '' AND img.published = 1 ORDER BY img.id DESC LIMIT 10"); break; case 2: $database->setQuery("SELECT DISTINCT com.imgid, img.imgid AS id, img.catid AS gallery_id, max(com.cmtid) as maxcmt FROM #__zoomfiles AS img, #__zoom_comments AS com WHERE com.imgid = img.imgid AND img.published = 1 Group By id ORDER BY maxcmt desc LIMIT 10"); break; case 4: $database->setQuery("SELECT DISTINCT img.imgid AS id, img.catid AS gallery_id, img.votenum, (img.votesum/img.votenum) AS rating FROM #__zoomfiles AS img LEFT JOIN #__zoom AS cats ON img.catid = cats.catid WHERE img.votesum > 0 AND img.votenum > 0 AND cats.catpassword = '' AND img.published = 1 ORDER BY rating desc, img.votenum DESC LIMIT 10"); break; default: die("You must visit this page the legit way, remember?"); } // Displaying query-results: $zoom->_result = $database->query(); ?>
<?echo _ZOOM_MAINSCREEN;?>   >
_result)){ $imgcnt++; $zoom->setGallery($row->gallery_id); $zoom->_counter = 0; foreach($zoom->_gallery->_images as $image){ if($image->_id == $row->id){ $i = $zoom->_counter; } $zoom->_counter++; } $zoom->_gallery->_images[$i]->getInfo(); echo ''; $size = getimagesize($zoom->_CONFIG['imagepath'].$zoom->_gallery->_dir."/".$zoom->_gallery->_images[$i]->_filename); if (!$zoom->_CONFIG['popUpImages']){ ?> '; echo '"; if($tabcnt >= 1){ $tabcnt = 0; }else{ $tabcnt++; } } ?>
  '.$imgcnt.'   $zoom->_CONFIG['maxsize']){ echo $zoom->_CONFIG['maxsize'] + 50;}else{ echo $size[0] + 40;} ?>, height=$zoom->_CONFIG['maxsize']){ echo $zoom->_CONFIG['maxsize'] + 50;}else{ echo $size[1] + 100;} ?>,scrollbars=1').focus()"> _gallery->_images[$i]->_thumbnail.'" border="0">'.$zoom->_gallery->_images[$i]->_filename.'
'; if ($zoom->_CONFIG['showHits']) echo 'hits = '.$zoom->_gallery->_images[$i]->_hits.'
'; if($zoom->_CONFIG['ratingOn']){ if($zoom->_gallery->_images[$i]->_votenum!=0){ if($zoom->_gallery->_images[$i]->_votesum!=0){ $rating = round($zoom->_gallery->_images[$i]->_votesum / $zoom->_gallery->_images[$i]->_votenum); }else{ $rating = 0; } ?> (_gallery->_images[$i]->_votenum;?> _gallery->_images[$i]->_votenum==1) echo _ZOOM_VOTE.")
"; else echo _ZOOM_VOTES.")
"; }else{ echo _ZOOM_NOTRATED."
"; } } echo "_gallery->_id."\">".$zoom->_gallery->getCatVirtPath()."