summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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
?>