| | Copyright: copyright (C) 2006 by Mike de Boer | | Description: zOOm Media Gallery, a multi-gallery component for | | Joomla!. It's the most feature-rich gallery component | | for Joomla!! For documentation and a detailed list | | of features, check the zOOm homepage: | | http://www.zoomfactory.org | | License: GPL | | Filename: special.php | | | ----------------------------------------------------------------------- * @version $Id: special.php,v 1.20 2006/08/02 18:52:50 kevinuru Exp $ * @package zOOmGallery * @author Mike de Boer **/ // MOS Intruder Alerts defined( '_VALID_MOS' ) or die( 'Direct Access to this location is not allowed.' ); global $size; /** 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 **/ $sorting = intval(trim(mosGetParam($_REQUEST, 'sorting'))); if ($sorting == 1 || $sorting == 2) { $where_prefix = "WHERE "; } else { $where_prefix = "AND "; } if ($zoom->_isAdmin) { $where_clause = ""; } else { $where_clause = $where_prefix."cats.catpassword = '' AND img.published = 1"; } 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 $where_clause 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_clause ORDER BY 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 LEFT JOIN #__zoom_comments AS com ON com.imgid = img.imgid LEFT JOIN #__zoom AS cats ON img.catid = cats.catid $where_clause 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 $where_clause ORDER BY rating desc, img.votenum DESC LIMIT 10"); break; default: die("You must visit this page the legit way, remember?"); } $zoom->_result = $database->query(); if ($zoom->_CONFIG['ratingOn']) { $zoom->createRatingCSS(); } ?>
_CONFIG['mainscreen']) { ?> ">    | 
_result) > 0) { while($row = mysql_fetch_object($zoom->_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(); if ($zoom->_gallery->isMember() && $zoom->_gallery->_images[$i]->isMember()) { echo ''; if (!$zoom->_CONFIG['popUpImages']) { ?> '; echo '"; if ($tabcnt >= 1) { $tabcnt = 0; } else { $tabcnt++; } } else { ?>
  '.$imgcnt.'   _gallery->_id."&key=".$i."&hit=1");?>"> encrypt("catid=".$zoom->_gallery->_id."&key=".$i."&isAdmin=".$zoom->_isAdmin."&hit=1"); ?> $zoom->_CONFIG['maxsize']) { $link .= $zoom->_CONFIG['maxsize'] + 50; } else { $link .= $size[0] + 40; } $link .= ", height="; if ($size[1] < 550) { $link .= "550"; } elseif ($size[1] > $zoom->_CONFIG['maxsize']) { $link .= $zoom->_CONFIG['maxsize'] + 50; } else { $link .= $size[1] + 100; } $link .= ", scrollbars=1').focus()\">\n"; echo $link; } echo ''.$zoom->_gallery->_images[$i]->_filename.'
'; if ($zoom->_CONFIG['showHits']) echo _ZOOM_HITS.' = '.$zoom->_gallery->_images[$i]->_hits.'
'; if ($zoom->_CONFIG['ratingOn']) { echo $zoom->_gallery->_images[$i]->getStars(); } echo "_gallery->_id)."\">".$zoom->_gallery->getCatVirtPath().""; //new feature if ($sorting == 2){ $dir_prefix = $mosConfig_live_site."/components/com_zoom/www/"; $smilies = $zoom->_getSmiliesTable(); $lastelement = count($zoom->_gallery->_images[$i]->_comments); if ($lastelement <> ""){ $comment = $zoom->_gallery->_images[$i]->_comments[$lastelement-1]; echo ""; echo ""; $theComment = $comment->_processSmilies($comment->_comment,$dir_prefix,$smilies); echo ""; echo "
".$comment->_name."(".$comment->_date.")
".$theComment."
"; } } echo "