aboutsummaryrefslogtreecommitdiff
path: root/engine/lib
diff options
context:
space:
mode:
Diffstat (limited to 'engine/lib')
-rw-r--r--engine/lib/tags.php15
1 files changed, 13 insertions, 2 deletions
diff --git a/engine/lib/tags.php b/engine/lib/tags.php
index 6654dfe14..254e81905 100644
--- a/engine/lib/tags.php
+++ b/engine/lib/tags.php
@@ -74,11 +74,13 @@
* @param string $entity_type Optionally, the entity type ('object' etc)
* @param string $entity_subtype The entity subtype, optionally
* @param int $owner_guid The GUID of the tags owner, optionally
- * @param int $site_guid Optionally, the site to restrict to (default is the current site)
+ * @param int $site_guid Optionally, the site to restrict to (default is the current site)
+ * @param int $start_ts Optionally specify a start timestamp for tags used to generate cloud.
+ * @param int $ent_ts Optionally specify an end timestamp for tags used to generate cloud.
* @return array|false Array of objects with ->tag and ->total values, or false on failure
*/
- function get_tags($threshold = 1, $limit = 10, $metadata_name = "", $entity_type = "object", $entity_subtype = "", $owner_guid = "", $site_guid = -1) {
+ function get_tags($threshold = 1, $limit = 10, $metadata_name = "", $entity_type = "object", $entity_subtype = "", $owner_guid = "", $site_guid = -1, $start_ts = "", $end_ts = "") {
global $CONFIG;
@@ -130,6 +132,15 @@
$query .= " and e.container_guid in (".implode(",",$owner_guid).")";
} else if (is_int($owner_guid)) {
$query .= " and e.container_guid = {$owner_guid} ";
+ }
+ if ($start_ts) {
+ $start_ts = (int)$start_ts;
+ $query .= " and e.time_created>=$start_ts";
+ }
+
+ if ($end_ts) {
+ $end_ts = (int)$end_ts;
+ $query .= " and e.time_created<=$end_ts";
}
//$userid = get_loggedin_userid();