/**
  * Retrieves the thumbnail image. presented in the category overview
  * @param int Category id
  * @param int image height
  * @param int image width
  * @param string Class name to format thumb view in css files
  * @return string html tag, showing the thumbnail
  * @todo being depreciated in favor of $rsgGallery->thumb() and $rsgDisplay functions
  */
 function getThumb($catid, $height = 0, $width = 0, $class = "")
 {
     global $mainframe;
     $database = JFactory::getDBO();
     //Setting attributes for image tag
     $imgatt = "";
     if ($height > 0) {
         $imgatt .= " height=\"{$height}\" ";
     }
     if ($width > 0) {
         $imgatt .= " width=\"{$width}\" ";
     }
     if ($class != "") {
         $imgatt .= " class=\"{$class}\" ";
     } else {
         $imgatt .= " class=\"rsg2-galleryList-thumb\" ";
     }
     //If no thumb, show default image.
     if (galleryUtils::getFileCount($catid) == 0) {
         $thumb_html = "<img {$imgatt} src=\"" . JURI_SITE . "/components/com_rsgallery2/images/no_pics.gif\" alt=\"No pictures in gallery\" />";
     } else {
         //Select thumb setting for specific gallery("Random" or "Specific thumb")
         $sql = "SELECT thumb_id FROM #__rsgallery2_galleries WHERE id = '{$catid}'";
         $database->setQuery($sql);
         $thumb_id = $database->loadResult();
         $list = galleryUtils::getChildList($catid);
         if ($thumb_id == 0) {
             //Random thumbnail
             $sql = "SELECT name FROM #__rsgallery2_files WHERE gallery_id IN ({$list}) AND published=1 ORDER BY rand() LIMIT 1";
             $database->setQuery($sql);
             $thumb_name = $database->loadResult();
         } else {
             //Specific thumbnail
             $thumb_name = galleryUtils::getFileNameFromId($thumb_id);
         }
         $thumb_html = "<img {$imgatt} src=\"" . imgUtils::getImgThumb($thumb_name) . "\" alt=\"\" />";
     }
     return $thumb_html;
 }
    /**
     * @todo this alternate gallery view needs to be moved to an html file and added as a template parameter
     */
    function _showBox($kids, $subgalleries)
    {
        ?>
		<div class="rsg_box_block">
            <?php 
        $i = 0;
        foreach ($kids as $kid) {
            $i++;
            if ($i > 3) {
                $i = 1;
            }
            ?>
                <div class="rsg_box_box_<?php 
            echo $i;
            ?>
">
                    <div class="rsg_galleryblock">
                    	<div>
							<div class="rsg2-galleryList-status"><?php 
            echo $kid->status;
            ?>
</div>
                            <?php 
            echo $kid->galleryName;
            ?>
                            <sup><span class='rsg2-galleryList-newImages'><?php 
            echo galleryUtils::newImages($kid->get('id'));
            ?>
</span></sup>
                            <div class='rsg2-galleryList-totalImages'>(<?php 
            echo galleryUtils::getFileCount($kid->get('id')) . JText::_(' Images');
            ?>
)</div>
                        </div>
						<div>
                        	<div class="rsg2-galleryList-thumb_box">
								<?php 
            echo $kid->thumbHTML;
            ?>
                        	</div>
                        	<div class="rsg2-galleryList-text_box">
                          		<?php 
            echo $this->_showGalleryDetails($kid);
            ?>
                        	</div>
                    	</div>
                        <div class="rsg2-galleryList-description_box">
                            	<?php 
            echo $kid->description;
            ?>
						</div>
                        <div class="rsg_sub_url"><?php 
            $this->_subGalleryList($kid);
            ?>
</span>
                        </div>
                    </div>
                </div>
                <?php 
        }
        ?>
            </div>
        <?php 
    }