Changeset 606 for trunk/admin/update.php
- Timestamp:
- Nov 17, 2004, 12:38:34 AM (20 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/admin/update.php
r602 r606 32 32 include_once( PHPWG_ROOT_PATH.'admin/include/isadmin.inc.php'); 33 33 34 define('CURRENT_DATE', "'".date('Y-m-d')."'");34 define('CURRENT_DATE', date('Y-m-d')); 35 35 // +-----------------------------------------------------------------------+ 36 36 // | functions | … … 408 408 { 409 409 $insert = array(); 410 $insert['file'] = "'".$unregistered_element."'";410 $insert['file'] = $unregistered_element; 411 411 $insert['storage_category_id'] = $category_id; 412 412 $insert['date_available'] = CURRENT_DATE; 413 $insert['tn_ext'] = "'".$tn_ext."'"; 413 $insert['tn_ext'] = $tn_ext; 414 $insert['path'] = $dir.$unregistered_element; 414 415 415 416 $counts['new_elements']++; … … 447 448 448 449 $insert = array(); 449 $insert['file'] = "'".$unregistered_element."'"; 450 $insert['file'] = $unregistered_element; 451 $insert['path'] = $dir.$unregistered_element; 450 452 $insert['storage_category_id'] = $category_id; 451 453 $insert['date_available'] = CURRENT_DATE; 452 454 if ( $tn_ext != '' ) 453 455 { 454 $insert['tn_ext'] = "'".$tn_ext."'";456 $insert['tn_ext'] = $tn_ext; 455 457 } 456 458 if ( $representative_ext != '' ) 457 459 { 458 $insert['representative_ext'] = "'".$representative_ext."'";460 $insert['representative_ext'] = $representative_ext; 459 461 } 460 462 … … 476 478 $dbfields = array( 477 479 'file','storage_category_id','date_available','tn_ext' 478 ,'representative_ext' 480 ,'representative_ext','path' 479 481 ); 480 $query = ' 481 INSERT INTO '.IMAGES_TABLE.' 482 ('.implode(',', $dbfields).') 483 VALUES 484 '; 485 foreach ($inserts as $insert_id => $insert) 486 { 487 $query.= ' 488 '; 489 if ($insert_id > 0) 490 { 491 $query.= ','; 492 } 493 $query.= '('; 494 foreach ($dbfields as $field_id => $dbfield) 495 { 496 if ($field_id > 0) 497 { 498 $query.= ','; 499 } 500 501 if (!isset($insert[$dbfield]) or $insert[$dbfield] == '') 502 { 503 $query.= 'NULL'; 504 } 505 else 506 { 507 $query.= $insert[$dbfield]; 508 } 509 } 510 $query.=')'; 511 } 512 $query.= ' 513 ;'; 514 515 pwg_query($query); 482 mass_inserts(IMAGES_TABLE, $dbfields, $inserts); 516 483 517 484 // what are the ids of the pictures in the $category_id ?
Note: See TracChangeset
for help on using the changeset viewer.