summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--classes/Status_network.php20
-rw-r--r--db/site.sql2
2 files changed, 22 insertions, 0 deletions
diff --git a/classes/Status_network.php b/classes/Status_network.php
index 445f8a5a3..f1314d615 100644
--- a/classes/Status_network.php
+++ b/classes/Status_network.php
@@ -39,6 +39,7 @@ class Status_network extends DB_DataObject
public $logo; // varchar(255)
public $created; // datetime() not_null
public $modified; // timestamp() not_null default_CURRENT_TIMESTAMP
+ public $tags; // text
/* Static get */
function staticGet($k,$v=NULL) { return DB_DataObject::staticGet('Status_network',$k,$v); }
@@ -245,4 +246,23 @@ class Status_network extends DB_DataObject
return $this->nickname . '.' . self::$wildcard;
}
}
+
+ /**
+ * Return site meta-info tags as an array
+ * @return array of strings
+ */
+ function getTags()
+ {
+ return array_filter(explode("|", strval($this->tags)));
+ }
+
+ /**
+ * Check if this site record has a particular meta-info tag attached.
+ * @param string $tag
+ * @return bool
+ */
+ function hasTag($tag)
+ {
+ return in_array($tag, $this->getTags());
+ }
}
diff --git a/db/site.sql b/db/site.sql
index a9f64e5a5..791303bd5 100644
--- a/db/site.sql
+++ b/db/site.sql
@@ -14,6 +14,8 @@ create table status_network (
sitename varchar(255) comment 'display name',
theme varchar(255) comment 'theme name',
logo varchar(255) comment 'site logo',
+
+ tags text comment 'site meta-info tags (pipe-separated)',
created datetime not null comment 'date this record was created',
modified timestamp comment 'date this record was modified'