");
}
+ /* get F-Spot database version */
$this->dbver = $this->getFspotDBVersion();
if(!is_writeable($this->cfg->base_path ."/templates_c")) {
$this->tmpl->assign('web_path', $this->cfg->web_path);
+ /* Starting with F-Spot 0.4.2, the rating-feature was available */
+ if($this->dbver > 10) {
+ $this->sort_orders = array_merge($this->sort_orders, array(
+ 'rate_asc' => 'Rate ↑',
+ 'rate_desc' => 'Rate ↓',
+ ));
+ }
+
/* check if all necessary indices exist */
$this->checkDbIndices();
";
}
else {
- $query_str = "
- SELECT p.id, p.uri, p.time, p.description
- FROM photos p
- ";
+ /* till F-Spot version 0.4.1 */
+ if($this->dbver < 11) {
+ $query_str = "
+ SELECT p.id, p.uri, p.time, p.description
+ FROM photos p
+ ";
+ }
+ else {
+ $query_str = "
+ SELECT p.id, p.uri, p.time, p.description, p.rating
+ FROM photos p
+ ";
+ }
}
/* if show_tags is set, only return details for photos which
$this->tmpl->assign('current_img', $photo);
if($previous_img) {
- $this->tmpl->assign('previous_url', "javascript:showImage(". $previous_img .");");
+ $this->tmpl->assign('previous_url', "javascript:showPhoto(". $previous_img .");");
$this->tmpl->assign('prev_img', $previous_img);
}
if($next_img) {
- $this->tmpl->assign('next_url', "javascript:showImage(". $next_img .");");
+ $this->tmpl->assign('next_url', "javascript:showPhoto(". $next_img .");");
$this->tmpl->assign('next_img', $next_img);
}
$this->tmpl->assign('mini_width', $this->cfg->mini_width);
break;
case 'img':
$output.= "
- <div style=\"display: table-cell;\">
- <div style=\"display: table-row; text-align: center;\">
- <a href=\"javascript:Tags('del', ". $tag .");\" title=\"". $this->tags[$tag] ."\">
- <img src=\"". $this->cfg->web_path ."/phpfspot_img.php?tagidx=". $tag ."\" />
- </a>
- </div>
- <div style=\"display: table-row; text-align: center;\">
- <a href=\"javascript:Tags('del', ". $tag .");\" title=\"". $this->tags[$tag] ."\">
- <img src=\"". $this->cfg->web_path ."/resources/underbar.png\" />
- </a>
- </div>
+ <div class=\"tagresulttag\">
+ <a href=\"javascript:Tags('del', ". $tag .");\" title=\"". $this->tags[$tag] ."\">
+ <img src=\"". $this->cfg->web_path ."/phpfspot_img.php?tagidx=". $tag ."\" />
+ </a>
</div>
";
break;
case 'tags_desc':
return " ORDER BY t.name DESC ,p.time ASC";
break;
+ case 'rate_asc':
+ return " ORDER BY t.name ASC, p.rating ASC";
+ break;
+ case 'rate_desc':
+ return " ORDER BY t.name DESC, p.rating DESC";
+ break;
}
} // get_sort_order()
{
if(preg_match('/\/photoview\/|\/photo\/|\/tag\//', $request_uri)) {
- unset($_SESSION['start_action']);
- unset($_SESSION['selected_tags']);
-
$options = explode('/', $request_uri);
switch($options[1]) {
case 'photoview':
if(is_numeric($options[2])) {
+ $this->session_cleanup();
+ //unset($_SESSION['start_action']);
+ //unset($_SESSION['selected_tags']);
$_GET['mode'] = 'showp';
return $this->showPhoto($options[2]);
}
$this->resetTagSearch();
$this->resetNameSearch();
$this->resetDateSearch();
+ $this->resetTags();
} // session_cleanup()