Changeset 1036 for trunk/include/category_default.inc.php
- Timestamp:
- Feb 12, 2006, 10:52:16 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/category_default.inc.php
r1014 r1036 32 32 */ 33 33 34 /** 35 * $array_cat_directories is a cache hash associating category id with their 36 * complete directory 37 */ 38 $array_cat_directories = array(); 39 40 $query = ' 41 SELECT DISTINCT(id),path,file,date_available 42 ,tn_ext,name,filesize,storage_category_id,average_rate,hit 43 FROM '.IMAGES_TABLE.' AS i 44 INNER JOIN '.IMAGE_CATEGORY_TABLE.' AS ic ON id=ic.image_id 45 '.$page['where'].' 46 '.$conf['order_by'].' 47 LIMIT '.$page['start'].','.$page['nb_image_page'].' 34 $page['rank_of'] = array_flip($page['items']); 35 36 $pictures = array(); 37 38 $selection = array_slice( 39 $page['items'], 40 $page['start'], 41 $page['nb_image_page'] 42 ); 43 44 if (count($selection) > 0) 45 { 46 $query = ' 47 SELECT * 48 FROM '.IMAGES_TABLE.' 49 WHERE id IN ('.implode(',', $selection).') 48 50 ;'; 49 //echo '<pre>'.$query.'</pre>'; 50 $result = pwg_query($query); 51 $result = pwg_query($query); 52 while ($row = mysql_fetch_array($result)) 53 { 54 $row['rank'] = $page['rank_of'][ $row['id'] ]; 55 56 array_push($pictures, $row); 57 } 58 59 usort($pictures, 'rank_compare'); 60 } 51 61 52 62 // template thumbnail initialization 53 if ( mysql_num_rows($result) > 0)63 if (count($pictures) > 0) 54 64 { 55 65 $template->assign_block_vars('thumbnails', array()); … … 60 70 } 61 71 62 while ($row = mysql_fetch_array($result))72 foreach ($pictures as $row) 63 73 { 64 74 $thumbnail_url = get_thumbnail_src($row['path'], @$row['tn_ext']); … … 151 161 } 152 162 } 163 164 pwg_debug('end include/category_default.inc.php'); 153 165 ?>
Note: See TracChangeset
for help on using the changeset viewer.