diff options
author | rvelices <rv-github@modusoptimus.com> | 2006-03-03 04:32:21 +0000 |
---|---|---|
committer | rvelices <rv-github@modusoptimus.com> | 2006-03-03 04:32:21 +0000 |
commit | c4874071babe878fcdcda10da1cc34ba5ded6aae (patch) | |
tree | 65a85967148e642ea0c09197b538524602504d7b /include/calendar_monthly.class.php | |
parent | 2a3d5012138715952add2f69e9b3253353ea419d (diff) |
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
Diffstat (limited to '')
-rw-r--r-- | include/calendar_monthly.class.php | 5 |
1 files changed, 3 insertions, 2 deletions
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 |