Changeset 307
- Timestamp:
- Jan 21, 2004, 11:03:20 PM (21 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/release-1_3/admin/infos_images.php
r301 r307 24 24 25 25 check_cat_id( $_GET['cat_id'] ); 26 27 $errors = array(); 28 26 29 if ( isset( $page['cat'] ) ) 27 30 { … … 29 32 if ( isset( $_POST['submit'] ) ) 30 33 { 31 $errors = array();32 34 if ( isset( $_POST['associate'] ) ) 33 35 { … … 48 50 } 49 51 52 $associate = false; 53 50 54 $query = 'SELECT id,file'; 51 55 $query.= ' FROM '.PREFIX_TABLE.'images'; … … 54 58 $query.= ';'; 55 59 $result = mysql_query( $query ); 56 $i = 1;57 60 while ( $row = mysql_fetch_array( $result ) ) 58 61 { … … 91 94 92 95 $query.= ', keywords = '; 96 93 97 $keywords_array = get_keywords( $_POST[$keywords] ); 94 if ( count( $keywords_array ) == 0 ) 95 $query.= 'NULL'; 96 else 97 { 98 $query.= "'"; 99 foreach ( $keywords_array as $i => $keyword ) { 100 if ( $i > 0 ) $query.= ','; 101 $query.= $keyword; 102 } 103 $query.= "'"; 104 } 98 if ( count( $keywords_array ) == 0 ) $query.= 'NULL'; 99 else $query.= "'".implode( ',', $keywords_array )."'"; 105 100 106 101 $query.= ' WHERE id = '.$row['id']; … … 109 104 } 110 105 // add link to another category 111 if ( $_POST['check-'.$row['id']] == 1and count( $errors ) == 0 )106 if ( isset( $_POST['check-'.$row['id']] ) and count( $errors ) == 0 ) 112 107 { 113 108 $query = 'INSERT INTO '.PREFIX_TABLE.'image_category'; … … 116 111 $query.= ';'; 117 112 mysql_query( $query ); 113 $associate = true; 118 114 } 119 115 } 120 116 update_category( $_POST['associate'] ); 117 if ( $associate ) synchronize_all_users(); 121 118 //------------------------------------------------------ update general options 122 if ( $_POST['use_common_author'] == 1)119 if ( isset( $_POST['use_common_author'] ) ) 123 120 { 124 121 $query = 'SELECT image_id'; … … 143 140 } 144 141 } 145 if ( $_POST['use_common_date_creation'] == 1)142 if ( isset( $_POST['use_common_date_creation'] ) ) 146 143 { 147 144 if ( check_date_format( $_POST['date_creation_cat'] ) ) … … 234 231 } 235 232 236 if ( is _numeric( $_GET['num']) and $_GET['num'] >= 0 )233 if ( isset($_GET['num']) and is_numeric($_GET['num']) and $_GET['num'] >= 0 ) 237 234 { 238 235 $page['start'] = … … 277 274 $array_cat_directories = array(); 278 275 279 $query = 'SELECT id,file,comment,author,tn_ext,name,date_creation,keywords'; 280 $query.= ',storage_category_id,category_id'; 276 $infos = array( 'id','file','comment','author','tn_ext','name' 277 ,'date_creation','keywords','storage_category_id' 278 ,'category_id' ); 279 280 $query = 'SELECT '.implode( ',', $infos ); 281 281 $query.= ' FROM '.PREFIX_TABLE.'images'; 282 282 $query.= ' INNER JOIN '.PREFIX_TABLE.'image_category ON id = image_id'; … … 288 288 while ( $row = mysql_fetch_array( $result ) ) 289 289 { 290 foreach ($infos as $info) { if (!isset($row[$info])) $row[$info] = ''; } 291 290 292 $vtp->addSession( $sub, 'picture' ); 291 293 $vtp->setVar( $sub, 'picture.id', $row['id'] ); … … 300 302 $vtp->setVar( $sub, 'picture.default_name', $file ); 301 303 // creating url to thumbnail 302 if ( $array_cat_directories[$row['storage_category_id']] == '')304 if ( !isset( $array_cat_directories[$row['storage_category_id']] ) ) 303 305 { 304 306 $array_cat_directories[$row['storage_category_id']] =
Note: See TracChangeset
for help on using the changeset viewer.