diff -r singapore-0.9.9/includes/io_db.class.php singapore-0.9.9b/includes/io_db.class.php
9c9
<  * @version $Id: io_db.class.php,v 1.1 2004/02/02 16:28:48 tamlyn Exp $
---
>  * @version $Id: io_db.class.php,v 1.2 2004/05/23 16:57:30 tamlyn Exp $
60c60
<         echo $dsn."<br />";
---
>         
diff -r singapore-0.9.9/includes/singapore.class.php singapore-0.9.9b/includes/singapore.class.php
7c7
<  * @version $Id: singapore.class.php,v 1.23 2004/05/14 14:03:56 tamlyn Exp $
---
>  * @version $Id: singapore.class.php,v 1.26 2004/08/08 13:58:19 tamlyn Exp $
24c24
<   var $version = "0.9.9";
---
>   var $version = "0.9.9b";
600c600
<     $ret  = "<map name=\"sgNavMap\">\n";
---
>     $ret  = "<map name=\"sgNavMap\" id=\"sgNavMap\">\n";
603c603
<     $ret .= "coords=\"$middleX,$middleY,$imageWidth,$imageHeight,$imageWidth,0,$middleX,$middleY\">\n";
---
>     $ret .= "coords=\"$middleX,$middleY,$imageWidth,$imageHeight,$imageWidth,0,$middleX,$middleY\" />\n";
606c606
<     $ret .= "coords=\"$middleX,$middleY,0,0,0,$imageHeight,$middleX,$middleY\">\n";
---
>     $ret .= "coords=\"$middleX,$middleY,0,0,0,$imageHeight,$middleX,$middleY\" />\n";
608c608
<     $ret .= "coords=\"$middleX,$middleY,0,0,$imageWidth,0,$middleX,$middleY\">\n";
---
>     $ret .= "coords=\"$middleX,$middleY,0,0,$imageWidth,0,$middleX,$middleY\" />\n";
741c741
<         $ret .= '"alt="'.$this->i18n->_g("Sample image from gallery").'" />';
---
>         $ret .= 'alt="'.$this->i18n->_g("Sample image from gallery").'" />';
796c796
<     $ret = "<link rel=\"Top\" title=\"".$this->config->gallery_name."\" href=\"".$this->formatURL(".")."\">\n";
---
>     $ret = "<link rel=\"Top\" title=\"".$this->config->gallery_name."\" href=\"".$this->formatURL(".")."\" />\n";
799c799
<       $ret .= "<link rel=\"Up\" title=\"".$this->galleryName()."\" href=\"".$this->imageParentURL()."\">\n";
---
>       $ret .= "<link rel=\"Up\" title=\"".$this->galleryName()."\" href=\"".$this->imageParentURL()."\" />\n";
801,802c801,802
<         $ret .= "<link rel=\"First\" title=\"".$this->imageName(0)."\" href=\"".$this->imageFirstURL()."\">\n";
<         $ret .= "<link rel=\"Prev\" title=\"".$this->imageName($this->image->index-1)."\" href=\"".$this->imagePrevURL()."\">\n";
---
>         $ret .= "<link rel=\"First\" title=\"".$this->imageName(0)."\" href=\"".$this->imageFirstURL()."\" />\n";
>         $ret .= "<link rel=\"Prev\" title=\"".$this->imageName($this->image->index-1)."\" href=\"".$this->imagePrevURL()."\" />\n";
805,806c805,806
<         $ret .= "<link rel=\"Next\" title=\"".$this->imageName($this->image->index+1)."\" href=\"".$this->imageNextURL()."\">\n";
<         $ret .= "<link rel=\"Last\" title=\"".$this->imageName($this->imageCount()-1)."\" href=\"".$this->imageLastURL()."\">\n";
---
>         $ret .= "<link rel=\"Next\" title=\"".$this->imageName($this->image->index+1)."\" href=\"".$this->imageNextURL()."\" />\n";
>         $ret .= "<link rel=\"Last\" title=\"".$this->imageName($this->imageCount()-1)."\" href=\"".$this->imageLastURL()."\" />\n";
810c810
<         $ret .= "<link rel=\"Up\" title=\"".$this->gallery->parentName."\" href=\"".$this->formatURL($this->gallery->parent)."\">\n";
---
>         $ret .= "<link rel=\"Up\" title=\"".$this->gallery->parentName."\" href=\"".$this->formatURL($this->gallery->parent)."\" />\n";
812,813c812,813
<         $ret .= "<link rel=\"Prev\" title=\"".$this->i18n->_g("gallery|Previous")."\" href=\"".$this->galleryPrevURL()."\">\n";
<         $ret .= "<link rel=\"First\" title=\"".$this->i18n->_g("gallery|First")."\" href=\"".$this->formatURL($this->gallery->idEncoded, null, 0)."\">\n";
---
>         $ret .= "<link rel=\"Prev\" title=\"".$this->i18n->_g("gallery|Previous")."\" href=\"".$this->galleryPrevURL()."\" />\n";
>         $ret .= "<link rel=\"First\" title=\"".$this->i18n->_g("gallery|First")."\" href=\"".$this->formatURL($this->gallery->idEncoded, null, 0)."\" />\n";
816,817c816,817
<         $ret .= "<link rel=\"Next\" title=\"".$this->i18n->_g("gallery|Next")."\" href=\"".$this->galleryNextURL()."\">\n";
<         $ret .= "<link rel=\"Last\" title=\"".$this->i18n->_g("gallery|Last")."\" href=\"".$this->formatURL($this->gallery->idEncoded, null, $this->lastPageIndex())."\">\n";
---
>         $ret .= "<link rel=\"Next\" title=\"".$this->i18n->_g("gallery|Next")."\" href=\"".$this->galleryNextURL()."\" />\n";
>         $ret .= "<link rel=\"Last\" title=\"".$this->i18n->_g("gallery|Last")."\" href=\"".$this->formatURL($this->gallery->idEncoded, null, $this->lastPageIndex())."\" />\n";
993a994,1001
>    * @return int number of images in current view
>    */
>   function gallerySelectedImagesCount()
>   {
>     return min(count($this->gallery->images) - $this->startat, $this->config->thumb_number_album);
>   }
>   
>   /**
1009a1018,1025
>    * @return int number of galleries in current view
>    */
>   function gallerySelectedGalleriesCount()
>   {
>     return min(count($this->gallery->galleries) - $this->startat, $this->config->thumb_number_gallery);
>   }
>   
>   /**
1025c1041,1044
<    * @return string
---
>    * Creates a correctly formatted &lt;img&gt; tag to display the album 
>    * thumbnail of the specified image
>    * @param int index of image (optional)
>    * @return string html
1038c1057
<                            $this->imageWidth($index), $this->imageHeight($index),
---
>                            $this->imageRealWidth($index), $this->imageRealHeight($index),
1043c1062
<                            $this->imageWidth($index), $this->imageHeight($index),
---
>                            $this->imageRealWidth($index), $this->imageRealHeight($index),
1053,1056c1072,1103
<   function thumbnailWidth($imageWidth, $imageHeight, $width, $height, $forceSize)
<   {
<     if($forceSize || ($width > $imageWidth && $height > $imageHeight)) 
<       return $width;
---
>   /**
>    * Calculates thumbnail width given:
>    * @param int original image width
>    * @param int original image height
>    * @param int required image width
>    * @param int required image height
>    * @param bool force size of thumbnail
>    * @return int width of thumbnail in pixels
>    */
>   function thumbnailWidth($imageWidth, $imageHeight, $maxWidth, $maxHeight, $forceSize)
>   {
>     //if aspect ratio is to be constrained set crop size
>     if($forceSize) {
>       $newAspect = $maxWidth/$maxHeight;
>       $oldAspect = $imageWidth/$imageHeight;
>       if($newAspect > $oldAspect) {
>         $cropWidth = $imageWidth;
>         $cropHeight = round($imageHeight*($oldAspect/$newAspect));
>       } else {
>         $cropWidth = round($imageWidth*($newAspect/$oldAspect));
>         $cropHeight = $imageHeight;
>       }
>     //else crop size is image size
>     } else {
>       $cropWidth = $imageWidth;
>       $cropHeight = $imageHeight;
>     }
>     
>     if($cropHeight > $maxHeight && ($cropWidth < $maxWidth || ($cropWidth > $maxWidth && round($cropHeight/$cropWidth * $maxWidth) > $maxHeight)))
>       return round($cropWidth/$cropHeight * $maxHeight);
>     elseif($cropWidth > $maxWidth)
>       return $maxWidth;
1058,1061c1105
<       if($imageWidth < $imageHeight)
<         return floor($imageWidth/$imageHeight * $width);
<       else
<         return $width;
---
>       return $imageWidth;
1064,1067c1108,1139
<   function thumbnailHeight($imageWidth, $imageHeight, $width, $height, $forceSize)
<   {
<     if($forceSize || ($width > $imageWidth && $height > $imageHeight)) 
<       return $height;
---
>   /**
>    * Calculates thumbnail height given:
>    * @param int original image width
>    * @param int original image height
>    * @param int required image width
>    * @param int required image height
>    * @param bool force size of thumbnail
>    * @return int height of thumbnail in pixels
>    */
>   function thumbnailHeight($imageWidth, $imageHeight, $maxWidth, $maxHeight, $forceSize)
>   {
>     //if aspect ratio is to be constrained set crop size
>     if($forceSize) {
>       $newAspect = $maxWidth/$maxHeight;
>       $oldAspect = $imageWidth/$imageHeight;
>       if($newAspect > $oldAspect) {
>         $cropWidth = $imageWidth;
>         $cropHeight = round($oldAspect/$newAspect * $imageHeight);
>       } else {
>         $cropWidth = round($newAspect/$oldAspect * $imageWidth);
>         $cropHeight = $imageHeight;
>       }
>     //else crop size is image size
>     } else {
>       $cropWidth = $imageWidth;
>       $cropHeight = $imageHeight;
>     }
>     
>     if($cropWidth > $maxWidth && ($cropHeight < $maxHeight || ($cropHeight > $maxHeight && round($cropWidth/$cropHeight * $maxHeight) > $maxWidth)))
>       return round($cropHeight/$cropWidth * $maxWidth);
>     elseif($cropHeight > $maxHeight)
>       return $maxHeight;
1069,1072c1141
<       if($imageWidth > $imageHeight)
<         return floor($imageHeight/$imageWidth * $height);
<       else
<         return $height;
---
>       return $imageHeight;
1074a1144,1148
>   /**
>    * Calculates image width by supplying appropriate values to {@link thumbnailWidth()} 
>    * @param int index of image (optional)
>    * @return int width of image in pixels 
>    */
1077,1087c1151,1155
<     if($index === null) {
<       $imageWidth  = $this->image->width;
<       $imageHeight = $this->image->height;
<     } else {
<       $imageWidth  = $this->gallery->images[$index]->width;
<       $imageHeight = $this->gallery->images[$index]->height;
<     }
<   
<     if(!$this->config->full_image_resize || $this->config->thumb_force_size_image
<        || ($this->config->thumb_width_image > $imageWidth && $this->config->thumb_image_height > $imageHeight)) 
<       return $imageWidth;
---
>     if($this->config->full_image_resize)
>       return $this->thumbnailWidth(
>                $this->imageRealWidth($index), $this->imageRealHeight($index), 
>                $this->config->thumb_width_image, $this->config->thumb_height_image, 
>                $this->config->thumb_force_size_image);
1089,1092c1157
<       if($imageWidth < $imageHeight)
<         return floor($imageWidth/$imageHeight * $this->config->thumb_width_image);
<       else
<         return $this->config->thumb_width_image;
---
>       return $this->imageRealWidth($index);
1094a1160,1164
>   /**
>    * Calculates image height by supplying appropriate values to {@link thumbnailHeight()} 
>    * @param int index of image (optional)
>    * @return int height of image in pixels
>    */
1097,1103c1167,1174
<     if($index === null) {
<       $imageWidth  = $this->image->width;
<       $imageHeight = $this->image->height;
<     } else {
<       $imageWidth  = $this->gallery->images[$index]->width;
<       $imageHeight = $this->gallery->images[$index]->height;
<     }
---
>     if($this->config->full_image_resize)
>       return $this->thumbnailHeight(
>                $this->imageRealWidth($index), $this->imageRealHeight($index), 
>                $this->config->thumb_width_image, $this->config->thumb_height_image, 
>                $this->config->thumb_force_size_image);
>     else
>       return $this->imageRealHeight($index);
>   }
1105,1107c1176,1184
<     if(!$this->config->full_image_resize || $this->config->thumb_force_size_image 
<        || ($this->config->thumb_width_image > $imageWidth && $this->config->thumb_image_height > $imageHeight)) 
<       return $imageHeight;
---
>   /**
>    * Returns the size of the original image 
>    * @param int index of image (optional)
>    * @return int width of image in pixels
>    */
>   function imageRealWidth($index = null)
>   {
>     if($index === null)
>       return $this->image->width;
1109,1112c1186,1199
<       if($imageWidth > $imageHeight)
<         return floor($imageHeight/$this->image->width * $this->config->thumb_height_image);
<       else
<         return $this->config->thumb_height_image;
---
>       return $this->gallery->images[$index]->width;
>   }
>   
>   /**
>    * Returns the size of the original image 
>    * @param int index of image (optional)
>    * @return int height of image in pixels
>    */
>   function imageRealHeight($index = null)
>   {
>     if($index === null)
>       return $this->image->height;
>     else
>       return $this->gallery->images[$index]->height;
1121a1209,1216
>    * @return string
>    */
>   function imageViews($index = null)
>   {
>     //todo: redo hit logging system to allow this
>   }
>   
>   /**
1162a1258,1268
>    * @return string
>    */
>   function imageDescription($index = null)
>   {
>     if($index===null)
>       return $this->image->desc;
>     else
>       return $this->gallery->images[$index]->desc;
>   }
>   
>   /**
1212c1318
<                              $this->imageWidth($i), $this->imageHeight($i),
---
>                              $this->imageRealWidth($i), $this->imageRealHeight($i),
1217c1323
<                              $this->imageWidth($i), $this->imageHeight($i),
---
>                              $this->imageRealWidth($i), $this->imageRealHeight($i),
diff -r singapore-0.9.9/templates/admin_default/gallery.tpl.php singapore-0.9.9b/templates/admin_default/gallery.tpl.php
30c30
<         <p><strong><a href="<?php echo $sg->galleryURL($index) ?>"><?php echo $gal->name ?></a></strong></p>
---
>         <p><strong><a href="<?php echo $sg->galleryURL($index+$sg->startat) ?>"><?php echo $gal->name ?></a></strong></p>
diff -r singapore-0.9.9/templates/admin_default/galleryhits.tpl.php singapore-0.9.9b/templates/admin_default/galleryhits.tpl.php
24,25c24,25
<       <tr>
<         <tr class="sgRow<?php echo $index%2 ?>"><td><a href="<?php echo $sg->formatAdminURL($sg->isAlbum($index) ? "showimagehits": "showgalleryhits", $sg->encodeId($gal->id)) ?>"><?php echo $gal->name ?></a></td>
---
>       <tr class="sgRow<?php echo $index%2 ?>">
>         <td><a href="<?php echo $sg->formatAdminURL($sg->isAlbum($index) ? "showimagehits": "showgalleryhits", $sg->encodeId($gal->id)) ?>"><?php echo $gal->name ?></a></td>
28c28
<         <td><img src="<?php echo $sg->config->pathto_admin_template ?>images/graph.gif" height="8" width="<?php echo $sg->gallery->maxhits==0 ? "0" : floor(($gal->hits->hits/$sg->gallery->maxhits)*300) ?>" /></td></tr>
---
>         <td><img src="<?php echo $sg->config->pathto_admin_template ?>images/graph.gif" height="8" width="<?php echo $sg->gallery->maxhits==0 ? "0" : floor(($gal->hits->hits/$sg->gallery->maxhits)*300) ?>" alt="" /></td>
diff -r singapore-0.9.9/templates/admin_default/main.css singapore-0.9.9b/templates/admin_default/main.css
117c117
<   font: x-small Verdana;
---
>   font: x-small Verdana, sans-serif;
diff -r singapore-0.9.9/templates/default/gallery.tpl.php singapore-0.9.9b/templates/default/gallery.tpl.php
30c30
<         <p><strong><a href="<?php echo $sg->galleryURL($index) ?>"><?php echo $gal->name ?></a></strong></p>
---
>         <p><strong><a href="<?php echo $sg->galleryURL($index+$sg->startat) ?>"><?php echo $gal->name ?></a></strong></p>
diff -r singapore-0.9.9/templates/default/main.css singapore-0.9.9b/templates/default/main.css
99,132d98
< div.sgAdminBar {
<   background-color: #f0f0f0;
<   border: 1px solid #000;
<   margin: 1em 0 1em 0;
<   padding: 5px;
<   font-size: x-small;
< }
< 
< div.sgAdminBar a:link, div.sgAdminBar a:visited, div.sgAdminBar a:active {
<   color: #000;
<   font: x-small Verdana;
<   position: relative;
<   left: 1px;
<   top: 1px;
<   border: 1px solid #f0f0f0;
<   text-decoration: none;
<   padding: 2px;
< }
< 
< div.sgAdminBar a:hover {
<   position: relative;
<   left: 0px;
<   top: 0px;
<   border: 1px solid #000;
<   color: #000;
<   background-color: #fff;
< }
< 
< span.sgAdminBarSeparator {
<   border-left: 1px solid #888;
<   width: 0px;
<   margin-right: 4px;
< }
< 
diff -r singapore-0.9.9/thumb.php singapore-0.9.9b/thumb.php
10c10
<  * @version $Id: thumb.php,v 1.27 2004/05/15 01:48:16 tamlyn Exp $
---
>  * @version $Id: thumb.php,v 1.29 2004/08/08 13:58:21 tamlyn Exp $
22c22
< function showThumb($gallery, $image, $width, $height, $forceAspect) {
---
> function showThumb($gallery, $image, $maxWidth, $maxHeight, $forceSize) {
32c32
<   $thumbPath = $config->pathto_cache.$width."x".$height.($forceAspect?"f":"").strtr("-$gallery-$image",":/?\\","----");
---
>   $thumbPath = $config->pathto_cache.$maxWidth."x".$maxHeight.($forceSize?"f":"").strtr("-$gallery-$image",":/?\\","----");
62,63c62,63
<   if($forceAspect) {
<     $newAspect = $width/$height;
---
>   if($forceSize) {
>     $newAspect = $maxWidth/$maxHeight;
67c67
<       $cropHeight = round($imageHeight*($oldAspect/$newAspect));
---
>       $cropHeight = round($oldAspect/$newAspect * $imageHeight);
69c69
<       $cropWidth = round($imageWidth*($newAspect/$oldAspect));
---
>       $cropWidth = round($newAspect/$oldAspect * $imageWidth);
83,88c83,88
<   if($cropWidth < $cropHeight && ($cropWidth>$width || $cropHeight>$height)) {
<     $thumbWidth = round($cropWidth/$cropHeight * $width);
<     $thumbHeight = $height;
<   } elseif($cropWidth > $width || $cropHeight > $height) {
<     $thumbWidth = $width;
<     $thumbHeight = round($cropHeight/$cropWidth * $width);
---
>   if($cropWidth > $maxWidth && ($cropHeight < $maxHeight || ($cropHeight > $maxHeight && round($cropWidth/$cropHeight * $maxHeight) > $maxWidth))) {
>     $thumbWidth = $maxWidth;
>     $thumbHeight = round($cropHeight/$cropWidth * $maxWidth);
>   } elseif($cropHeight > $maxHeight) {
>     $thumbWidth = round($cropWidth/$cropHeight * $maxHeight);
>     $thumbHeight = $maxHeight;
112c112
<     if($forceAspect) $cmd .= " -crop {$cropWidth}x{$cropHeight}+$cropX+$cropY";
---
>     if($forceSize) $cmd .= " -crop {$cropWidth}x{$cropHeight}+$cropX+$cropY";
diff -r singapore-0.9.9/tools/index.html singapore-0.9.9b/tools/index.html
23c23
< see the <a href="../docs/Translation.hltm">translation</a> readme for more 
---
> see the <a href="../docs/Translation.html">translation</a> readme for more 
27c27
<   <li><a href="extract.php">Extractor</a> - for developers only. Extracts 
---
>   <li><a href="extract.php">Extractor</a> - for developers. Extracts 
