From 6d308fdcab044c2798d7c915c8d6fdf5b3fc3245 Mon Sep 17 00:00:00 2001 From: Andreas Unterkircher Date: Sat, 20 Sep 2008 11:48:04 +0200 Subject: Older F-Spot database versions are not compatible with new versioning-code. Now on all F-Spot databases before version 9, phpfspot will not cover versioning-topics at all. fixes #76 Signed-off-by: Andreas Unterkircher --- phpfspot.class.php | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/phpfspot.class.php b/phpfspot.class.php index 11b5292..4acb647 100644 --- a/phpfspot.class.php +++ b/phpfspot.class.php @@ -533,24 +533,24 @@ class PHPFSPOT { if(!isset($version_idx) || !$this->is_valid_version($idx, $version_idx)) $version_idx = $this->get_latest_version($idx); - /* if an alternative version has been requested */ - if($version_idx > 0) { - + /* if an alternative version has been requested. But we + support this only for F-Spot database versions from + v9. + */ + if($version_idx > 0 && $this->dbver >= 9) { /* check for alternative versions */ if($version = $this->db->db_fetchSingleRow(" - SELECT - version_id, name, uri - FROM - photo_versions - WHERE - photo_id LIKE '". $idx ."' - AND - version_id LIKE '". $version_idx ."' - ")) { + SELECT + version_id, name, uri + FROM + photo_versions + WHERE + photo_id LIKE '". $idx ."' + AND + version_id LIKE '". $version_idx ."'")) { $row['name'] = $version['name']; $row['uri'] = $version['uri']; - } } -- cgit v1.2.3-18-g5258