summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndreas Unterkircher <unki@netshadow.at>2008-09-20 11:48:04 +0200
committerAndreas Unterkircher <unki@netshadow.at>2008-10-16 19:55:14 +0200
commit6d308fdcab044c2798d7c915c8d6fdf5b3fc3245 (patch)
tree483d749140cfaf2fb6929f42e3c3d69bbc26b05a
parentc26dd6eb3b24421abef1be71435b96aef6fe5548 (diff)
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 <unki@netshadow.at>
-rw-r--r--phpfspot.class.php26
1 files 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'];
-
}
}