Fixed some API stuff to return the right values for pypo.

Created a test script to schedule a test file one minute after running it.
Moved the database connection initialization to conf.php instead of in
ui_conf.php.
Changed some includes to rely on the pear path instead of specifying it
directly in the include.  This will make it easier to use the system
defaults (for Ubuntu/Debian for example).
This commit is contained in:
paul.baranowski 2010-11-23 19:21:05 -05:00
parent ef8b8dc54d
commit 8e7e0226e6
11 changed files with 289 additions and 68 deletions

View file

@ -835,6 +835,25 @@ class StoredFile {
}
/**
* Find and return the first exact match for the original file name
* that was used on import.
* @param string $p_name
*/
public static function findByOriginalName($p_name)
{
global $CC_CONFIG, $CC_DBC;
$sql = "SELECT id FROM ".$CC_CONFIG["filesTable"]
." WHERE name='".pg_escape_string($p_name)."'";
$id = $CC_DBC->getOne($sql);
if (is_numeric($id)) {
return StoredFile::Recall($id);
} else {
return NULL;
}
}
/**
* Delete and insert media file
*