Changeset 12796 for trunk/include/calendar_monthly.class.php
- Timestamp:
- Dec 27, 2011, 6:26:44 AM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/calendar_monthly.class.php
r12118 r12796 351 351 $page['chronology_date'][CDAY]=$day; 352 352 $query = ' 353 SELECT id, file, tn_ext,path,width, height, '.pwg_db_get_dayofweek($this->date_field).'-1 as dow';353 SELECT id, file,representative_ext,path,width, height, '.pwg_db_get_dayofweek($this->date_field).'-1 as dow'; 354 354 $query.= $this->inner_sql; 355 355 $query.= $this->get_date_where(); … … 360 360 361 361 $row = pwg_db_fetch_assoc(pwg_query($query)); 362 $items[$day]['tn_url'] = get_thumbnail_url($row); 362 $derivative = new DerivativeImage(IMG_SQUARE, new SrcImage($row)); 363 $items[$day]['derivative'] = $derivative; 363 364 $items[$day]['file'] = $row['file']; 364 $items[$day]['path'] = $row['path'];365 $items[$day]['tn_ext'] = @$row['tn_ext'];366 $items[$day]['width'] = $row['width'];367 $items[$day]['height'] = $row['height'];368 365 $items[$day]['dow'] = $row['dow']; 369 366 } 370 367 371 if ( !empty($items) 372 and $conf['calendar_month_cell_width']>0 373 and $conf['calendar_month_cell_height']>0) 368 if ( !empty($items) ) 374 369 { 375 370 list($known_day) = array_keys($items); … … 397 392 } 398 393 399 $cell_width = $conf['calendar_month_cell_width']; 400 $cell_height = $conf['calendar_month_cell_height']; 394 list($cell_width, $cell_height) = ImageStdParams::get_by_type(IMG_SQUARE)->sizing->ideal_size; 401 395 402 396 $tpl_weeks = array(); … … 431 425 else 432 426 { 433 $thumb = get_thumbnail_path($items[$day]); 434 $tn_size = @getimagesize($thumb); 435 436 $tn_width = $tn_size[0]; 437 $tn_height = $tn_size[1]; 427 list($tn_width,$tn_height) = $items[$day]['derivative']->get_size(); 438 428 439 429 // now need to fit the thumbnail of size tn_size within … … 492 482 'DOW' => $dow, 493 483 'NB_ELEMENTS' => $items[$day]['nb_images'], 494 'IMAGE' => $items[$day][' tn_url'],484 'IMAGE' => $items[$day]['derivative']->get_url(), 495 485 'U_IMG_LINK' => $url, 496 486 'IMAGE_STYLE' => $css_style,
Note: See TracChangeset
for help on using the changeset viewer.