From: Andreas Unterkircher Date: Fri, 20 Jun 2008 17:43:06 +0000 (+0200) Subject: Merge branch 'master' of /var/cache/git/phpfspot X-Git-Url: https://git.nubati.net/cgi-bin/gitweb.cgi?p=phpfspot.git;a=commitdiff_plain;h=92012e6184a1feb1e659cc7623bd32703025ae17;hp=-c Merge branch 'master' of /var/cache/git/phpfspot --- 92012e6184a1feb1e659cc7623bd32703025ae17 diff --combined phpfspot.class.php index 4bc3266,d39356a..d7a76c3 --- a/phpfspot.class.php +++ b/phpfspot.class.php @@@ -227,9 -227,8 +227,9 @@@ class PHPFSPOT if(!isset($_SESSION['tag_condition'])) $_SESSION['tag_condition'] = 'or'; + /* if sort-order has not been set yet, get the one specified in the config */ if(!isset($_SESSION['sort_order'])) - $_SESSION['sort_order'] = 'date_desc'; + $_SESSION['sort_order'] = $this->cfg->sort_order; if(!isset($_SESSION['searchfor_tag'])) $_SESSION['searchfor_tag'] = ''; @@@ -392,6 -391,11 +392,11 @@@ $this->avail_tags = Array(); $count = 0; + /* if show_tags has been set in the configuration (only show photos + which are tagged by these tags) they following will take care, + that only these other tags are displayed where the photo is also + tagged with one of show_tags. + */ if(isset($this->cfg->show_tags) && !empty($this->cfg->show_tags)) { $query_str=" SELECT @@@ -459,6 -463,7 +464,7 @@@ */ public function get_photo_details($idx) { + /* ~ F-Spot version 0.3.x */ if($this->dbver < 9) { $query_str = " SELECT p.id, p.name, p.time, p.directory_path, p.description @@@ -481,8 -486,8 +487,8 @@@ } } - /* if show_tags is set, only return details for photos which - are specified to be shown + /* if show_tags is set, only return details of photos which are + tagged with a tag that has been specified to be shown. */ if(isset($this->cfg->show_tags) && !empty($this->cfg->show_tags)) { $query_str.= " @@@ -503,6 -508,9 +509,9 @@@ $row = $this->db->db_fetch_object($result); + /* before F-Spot db version 9 there was no uri column but seperated + columns for directory_path and name (= filename). + */ if($this->dbver < 9) { $row['uri'] = "file://". $row['directory_path'] ."/". $row['name']; } @@@ -518,9 -526,10 +527,10 @@@ /** * returns aligned photo names * - * this function returns aligned (length) names for - * an specific photo. If the length of the name exceeds - * $limit the name will be shrinked (...) + * this function returns aligned (length) names for a specific photo. + * If the length of the name exceeds $limit the name will bei + * shrinked (...). + * * @param integer $idx * @param integer $limit * @return string|null @@@ -541,11 -550,11 +551,11 @@@ /** * get photo rating level * - * this function will return the integer-based rating - * level of the photo. This can only be done, if the F-Spot - * database is at a specific level. If rating value can not - * be found, zero will be returned indicating no rating value - * is available. + * this function will return the integer-based rating level of a + * photo. This can only be done, if the F-Spot database is at a + * specific version. If rating value can not be found, zero will + * be returned indicating no rating value is available. + * * @param integer idx * @return integer */ @@@ -563,8 -572,8 +573,8 @@@ /** * get rate-search bars * - * this function will return the rating-bars for the - * search field. + * this function will return the rating-bars for the search field. + * * @return string */ public function get_rate_search() @@@ -610,9 -619,9 +620,9 @@@ /** * shrink text according provided limit * - * If the length of the name exceeds $limit the - * text will be shortend and some content in between - * will be replaced with "..." + * If the length of the name exceeds $limit, text will be shortend + * and inner content will be replaced with "...". + * * @param string $ext * @param integer $limit * @return string @@@ -841,6 -850,9 +851,9 @@@ // loop through our tag array foreach ($tags as $key => $value) { + /* has the currently processed tag already been added to + the selected tag list? if so, ignore it here... + */ if(isset($_SESSION['selected_tags']) && in_array($key, $_SESSION['selected_tags'])) continue; @@@ -849,7 -861,7 +862,7 @@@ // multiply by the font-size increment ($size) // and add the $min_size set above $size = $min_size + (($value - $min_qty) * $step); - // uncomment if you want sizes in whole %: + // uncomment if you want sizes in whole %: $size = ceil($size); $color = $min_sat + ($value - $min_qty) * $step_sat; @@@ -859,10 -871,20 +872,20 @@@ $b = '88'; if(isset($this->tags[$key])) { - if($this->is_user_friendly_url()) - $output.= "cfg->web_path ."/tag/". $key ."\" onclick=\"Tags('add', ". $key ."); return false;\" class=\"tag\" style=\"font-size: ". $size ."%; color: #". $r.$g.$b .";\">". $this->tags[$key] .", "; - else - $output.= "cfg->web_path ."/index.php?mode=showpi\" onclick=\"Tags('add', ". $key ."); return false;\" class=\"tag\" style=\"font-size: ". $size ."%; color: #". $r.$g.$b .";\">". $this->tags[$key] .", "; + if($this->is_user_friendly_url()) { + $output.= "cfg->web_path ."/tag/". $key ."\" + onclick=\"Tags('add', ". $key ."); return false;\" + class=\"tag\" + style=\"font-size: ". $size ."%; color: #". $r.$g.$b .";\" + title=\"Tag ". $this->tags[$key] .", ". $tags[$key] ." picture(s)\">". $this->tags[$key] .", "; + } + else { + $output.= "cfg->web_path ."/index.php?mode=showpi\" + onclick=\"Tags('add', ". $key ."); return false;\" + class=\"tag\" + style=\"font-size: ". $size ."%; color: #". $r.$g.$b .";\" + title=\"Tag ". $this->tags[$key] .", ". $tags[$key] ." picture(s)\">". $this->tags[$key] .", "; + } } } @@@ -2726,7 -2748,7 +2749,7 @@@ return " ORDER BY p.rating ASC, t.name ASC"; break; case 'rate_desc': - return " ORDER BY p.rating DESC, t.name DESC"; + return " ORDER BY p.rating DESC, t.name ASC"; break; }