From c4874071babe878fcdcda10da1cc34ba5ded6aae Mon Sep 17 00:00:00 2001 From: rvelices Date: Fri, 3 Mar 2006 04:32:21 +0000 Subject: optimization: in sessions write 1 less sql query (except during login) bug: corrected algorithm for pretty calendar month view git-svn-id: http://piwigo.org/svn/trunk@1063 68402e56-0260-453c-a942-63ccdbb3a9ee --- include/calendar_monthly.class.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'include/calendar_monthly.class.php') diff --git a/include/calendar_monthly.class.php b/include/calendar_monthly.class.php index 81978f963..2bced250d 100644 --- a/include/calendar_monthly.class.php +++ b/include/calendar_monthly.class.php @@ -452,6 +452,7 @@ SELECT file,tn_ext,path, width, height, DAYOFWEEK('.$this->date_field.')-1 as do $ratio_w = $tn_width/$cell_width; $ratio_h = $tn_height/$cell_height; + $pos_top=$pos_left=0; $img_width=$img_height=''; if ( $ratio_w>1 and $ratio_h>1) @@ -461,13 +462,13 @@ SELECT file,tn_ext,path, width, height, DAYOFWEEK('.$this->date_field.')-1 as do {// thumbnail ratio compared to cell -> wide format $img_height = 'height="'.$cell_height.'"'; $browser_img_width = $cell_height*$tn_width/$tn_height; - $pos_left = ($tn_width-$browser_img_width)/2; + $pos_left = ($browser_img_width-$cell_width)/2; } else { $img_width = 'width="'.$cell_width.'"'; $browser_img_height = $cell_width*$tn_height/$tn_width; - $pos_top = ($tn_height-$browser_img_height)/2; + $pos_top = ($browser_img_height-$cell_height)/2; } } else -- cgit v1.2.3