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
This commit is contained in:
rvelices
2006-03-03 04:32:21 +00:00
parent 2a3d501213
commit c4874071ba
2 changed files with 31 additions and 39 deletions
+3 -2
View File
@@ -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