Changeset 9864 for trunk/admin/element_set_ranks.php
- Timestamp:
- Mar 26, 2011, 3:29:27 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/admin/element_set_ranks.php
r9051 r9864 210 210 // template thumbnail initialization 211 211 $current_rank = 1; 212 212 $thumbnail_info=array(); 213 $clipping=array(); 213 214 while ($row = pwg_db_fetch_assoc($result)) 214 215 { 215 216 $src = get_thumbnail_url($row); 216 217 list($thumbnail_width, $thumbnail_height) = getimagesize($src); 218 $thumbnail_x_center = $thumbnail_width/2; 219 $thumbnail_y_center = $thumbnail_height/2; 220 217 218 $thumbnail_size = getimagesize($src); 219 $thumbnail_info[] = array( 220 'width' => $thumbnail_size[0], 221 'height' => $thumbnail_size[1], 222 'id' => $row['id'], 223 'tn_src' => $src, 224 'rank' => $current_rank * 10, 225 ); 226 $clipping[]= min($thumbnail_size[0]*0.75,$thumbnail_size[1]*0.75); 227 228 $current_rank++; 229 } 230 $clipping=array_sum($clipping)/count($clipping); 231 foreach ($thumbnail_info as $thumbnails_info) 232 { 233 $thumbnail_x_center = $thumbnails_info['width']/2; 234 $thumbnail_y_center = $thumbnails_info['height']/2; 221 235 $template->append( 222 236 'thumbnails', 223 237 array( 224 'ID' => $row['id'], 225 'TN_SRC' => $src, 226 'RANK' => $current_rank * 10, 227 'CLIP_TOP' => round($thumbnail_y_center - 96/2), 228 'CLIP_RIGHT' => round($thumbnail_x_center + 96/2), 229 'CLIP_BOTTOM' => round($thumbnail_y_center + 96/2), 230 'CLIP_LEFT' => round($thumbnail_x_center - 96/2) 238 'ID' => $thumbnails_info['id'], 239 'TN_SRC' => $thumbnails_info['tn_src'], 240 'RANK' => $thumbnails_info['rank'], 241 'CLIPING' => round($clipping), 242 'CLIPING_li' => round($clipping+8), 243 'CLIP_TOP' => round($thumbnail_y_center - $clipping/2), 244 'CLIP_RIGHT' => round($thumbnail_x_center + $clipping/2), 245 'CLIP_BOTTOM' => round($thumbnail_y_center + $clipping/2), 246 'CLIP_LEFT' => round($thumbnail_x_center - $clipping/2) 231 247 ) 232 248 ); 233 234 $current_rank++; 235 } 236 249 } 237 250 // image order management 238 251 $sort_fields = array(
Note: See TracChangeset
for help on using the changeset viewer.