summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndreas Unterkircher <unki@netshadow.at>2008-04-13 06:59:53 +0200
committerAndreas Unterkircher <unki@netshadow.at>2008-04-13 06:59:53 +0200
commit8b5da769f4de61b359c5b5aad51d365e2aa55ba5 (patch)
treed4a5e7fb020225f782d707f1dc77e555af4c68bd
parent3f6b85d5486469cd98661904266606f4387d5a16 (diff)
issue116, don't allow hidden-tags to be added to the selected-tag list
Signed-off-by: Andreas Unterkircher <unki@netshadow.at>
-rw-r--r--phpfspot.class.php31
1 files changed, 30 insertions, 1 deletions
diff --git a/phpfspot.class.php b/phpfspot.class.php
index a279eff..ec041bf 100644
--- a/phpfspot.class.php
+++ b/phpfspot.class.php
@@ -767,10 +767,15 @@ class PHPFSPOT {
if(isset($_SESSION['searchfor_tag']))
unset($_SESSION['searchfor_tag']);
+ // has the user requested to hide this tag, and still someone,
+ // somehow tries to add it, don't allow this.
+ if(!isset($this->cfg->hide_tags) &&
+ in_array($this->get_tag_name($tag), $this->cfg->hide_tags))
+ return "ok";
+
if(!in_array($tag, $_SESSION['selected_tags']))
array_push($_SESSION['selected_tags'], $tag);
-
return "ok";
} // addTag()
@@ -2927,6 +2932,30 @@ class PHPFSPOT {
} // get_mime_info()
+ /**
+ * return tag-name by tag-idx
+ *
+ * this function returns the tag-name for the requested
+ * tag specified by tag-idx.
+ * @param integer $idx
+ * @return string
+ */
+ public function get_tag_name($idx)
+ {
+ if($result = $this->db->db_fetchSingleRow("
+ SELECT name
+ FROM tags
+ WHERE
+ id LIKE '". $idx ."'")) {
+
+ return $result['name'];
+
+ }
+
+ return 0;
+
+ } // get_tag_name()
+
} // class PHPFSPOT
?>