| 1 |
<?php |
<?php |
| 2 |
// $Id: flickrstickr.module,v 1.25 2007/01/22 12:33:51 aronnovak Exp $ |
// $Id: flickrstickr.module,v 1.26 2007/01/22 13:22:12 aronnovak Exp $ |
| 3 |
|
|
| 4 |
/** |
/** |
| 5 |
* @file |
* @file |
| 547 |
// File extension detection later! |
// File extension detection later! |
| 548 |
$path = "files/images/". $matches[1] ."_". $matches[2] ."_". $matches[3]; |
$path = "files/images/". $matches[1] ."_". $matches[2] ."_". $matches[3]; |
| 549 |
// think of leaving out the file_exists check |
// think of leaving out the file_exists check |
| 550 |
if (file_exists($path)) { |
if (file_exists($path. ".jpg") || file_exists($path. ".png") || file_exists($path. ".gif")) { |
| 551 |
//check that the node still exist |
//check that the node still exist |
| 552 |
$filepath = "images/". $matches[1] ."_". $matches[2] ."_". $matches[3]; |
$filepath = "images/". $matches[1] ."_". $matches[2] ."_". $matches[3]; |
| 553 |
$result = db_query("SELECT nid FROM {files} WHERE filepath LIKE %'%s'%", $filepath); |
$result = db_query('SELECT nid FROM {files} WHERE filepath LIKE "%%%s%"', $filepath); |
| 554 |
$image = db_fetch_object($result); |
$image = db_fetch_object($result); |
| 555 |
if ($image) { |
if (!is_null($image)) { |
| 556 |
return; |
return; |
| 557 |
} |
} |
| 558 |
} |
} |
| 654 |
'flickrstickr_saveimages', |
'flickrstickr_saveimages', |
| 655 |
$texts[$i]); |
$texts[$i]); |
| 656 |
} |
} |
| 657 |
} |
} |
| 658 |
} |
} |
| 659 |
|
|
| 660 |
/** |
/** |