Changeset 303
- Timestamp:
- Jan 19, 2004, 11:02:38 PM (20 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/release-1_3/picture.php
r301 r303 36 36 initialize_category( 'picture' ); 37 37 //------------------------------------- main picture information initialization 38 $query = 'SELECT id,date_available,comment,hit,keywords'; 39 $query.= ',author,name,file,date_creation,filesize,width,height'; 40 $query.= ',storage_category_id'; 41 if ( is_numeric( $page['cat'] ) ) 42 { 43 $query.= ',category_id'; 44 } 38 $infos = array( 'id','date_available','comment','hit','keywords','author' 39 ,'name','file','date_creation','filesize','width','height' 40 ,'storage_category_id' ); 41 42 $query = 'SELECT '.implode( ',', $infos ); 43 if ( is_numeric( $page['cat'] ) ) $query.= ',category_id'; 45 44 $query.= ' FROM '.PREFIX_TABLE.'images'; 46 45 $query.= ' INNER JOIN '.PREFIX_TABLE.'image_category AS ic'; … … 61 60 } 62 61 $row = mysql_fetch_array( $result ); 63 $page['id'] = $row['id']; 64 $page['file'] = $row['file']; 65 $page['name'] = $row['name']; 66 $page['date_available'] = $row['date_available']; 67 $page['comment'] = $row['comment']; 68 $page['hit'] = $row['hit']; 69 $page['author'] = $row['author']; 70 $page['date_creation'] = $row['date_creation']; 71 $page['filesize'] = $row['filesize']; 72 $page['width'] = $row['width']; 73 $page['height'] = $row['height']; 74 if (is_numeric( $page['cat'] )) 75 $page['category_id'] = $row['category_id']; 76 $page['keywords'] = $row['keywords']; 77 $page['storage_category_id'] = $row['storage_category_id']; 62 63 foreach ( $infos as $info ) { 64 if ( isset( $row[$info] ) ) $page[$info] = $row[$info]; 65 else $page[$info] = ''; 66 } 67 if ( is_numeric( $page['cat'] ) ) $page['category_id'] = $row['category_id']; 78 68 // retrieving the number of the picture in its category (in order) 79 69 $query = 'SELECT DISTINCT(id)';
Note: See TracChangeset
for help on using the changeset viewer.