$row['id'], 'cr_id' => -1, ) ); } // Put that array in the database if (count($edits) > 0) { mass_inserts( COPYRIGHTS_MEDIA, array_keys($edits[0]), $edits ); } } // Delete all copyrights from an author function delete_default_CR($author) { global $prefixeTable; // Get all image_id's with default copyrights from this author $query = sprintf( 'SELECT id FROM %s WHERE (`author`=\'%s\' OR `author`=NULL) AND id IN ( SELECT media_id AS id FROM %s WHERE cr_id = -1 ) ;', IMAGES, $author, COPYRIGHTS_MEDIA); $result = pwg_query($query); // Put them in an array $deletes = array(); while ($row = pwg_db_fetch_assoc($result)) { $deletes[] = $row['id']; } // Delete them if (count($deletes) > 0) { $query = sprintf( 'DELETE FROM %s WHERE media_id IN (%s) ;', COPYRIGHTS_MEDIA, implode(',', $deletes)); pwg_query($query); } } ?>