| 1 |
<?php |
<?php |
| 2 |
// $Id: taxonomy_image.module,v 1.12.4.13.2.42 2009/03/17 14:38:16 nancyw Exp $ |
// $Id: taxonomy_image.module,v 1.12.4.13.2.43 2009/03/19 13:44:46 nancyw Exp $ |
| 3 |
|
|
| 4 |
/** |
/** |
| 5 |
* @file |
* @file |
| 645 |
|
|
| 646 |
if (is_object($file)) { |
if (is_object($file)) { |
| 647 |
// If no errors while uploading, save term-image relation into DB |
// If no errors while uploading, save term-image relation into DB |
| 648 |
$filepath = variable_get('taxonomy_image_path', 'category_pictures') . '/' . $file->filename; |
$filepath = variable_get('taxonomy_image_path', 'category_pictures') .'/'. $file->filename; |
| 649 |
|
|
| 650 |
if (taxonomy_image_add($tid, $file->filename)) { |
if (taxonomy_image_add($tid, $file->filename)) { |
| 651 |
// Successfully added to DB, make sure Cron doesn't delete this file. |
// Successfully added to DB, make sure Cron doesn't delete this file. |
| 674 |
taxonomy_image_delete($tid); |
taxonomy_image_delete($tid); |
| 675 |
} |
} |
| 676 |
|
|
| 677 |
if(db_query("INSERT INTO {term_image} (tid, path) VALUES ('%d', '%s')", $tid, $filename)) { |
if (db_query("INSERT INTO {term_image} (tid, path) VALUES ('%d', '%s')", $tid, $filename)) { |
| 678 |
cache_clear_all("taxonomy_image:$tid", 'cache_tax_image'); |
cache_clear_all("taxonomy_image:$tid", 'cache_tax_image'); |
| 679 |
return TRUE; |
return TRUE; |
| 680 |
} |
} |