aboutsummaryrefslogtreecommitdiff
path: root/engine/lib
diff options
context:
space:
mode:
authorbrettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544>2009-08-03 20:27:55 +0000
committerbrettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544>2009-08-03 20:27:55 +0000
commitbcd4242a32c0b765156a0672d82e9bd086e80e0a (patch)
tree20074fab6fd9e2320b31a95ad1c4156d9d4ae515 /engine/lib
parent3389990c9e541fdf906293df79da04f05cf16792 (diff)
downloadelgg-bcd4242a32c0b765156a0672d82e9bd086e80e0a.tar.gz
elgg-bcd4242a32c0b765156a0672d82e9bd086e80e0a.tar.bz2
Added starttime and endtime for get_entities_from_annotation().
git-svn-id: https://code.elgg.org/elgg/trunk@3418 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'engine/lib')
-rw-r--r--engine/lib/annotations.php13
1 files changed, 11 insertions, 2 deletions
diff --git a/engine/lib/annotations.php b/engine/lib/annotations.php
index af28a6aff..23109cbf6 100644
--- a/engine/lib/annotations.php
+++ b/engine/lib/annotations.php
@@ -355,13 +355,18 @@
* @param int $offset Place to start.
* @param string $order_by How to order results.
* @param boolean $count Whether to count entities rather than return them
+ * @param int $timelower The earliest time the annotation can have been created. Default: all
+ * @param int $timeupper The latest time the annotation can have been created. Default: all
*/
- function get_entities_from_annotations($entity_type = "", $entity_subtype = "", $name = "", $value = "", $owner_guid = 0, $group_guid = 0, $limit = 10, $offset = 0, $order_by = "asc", $count = false)
+ function get_entities_from_annotations($entity_type = "", $entity_subtype = "", $name = "", $value = "", $owner_guid = 0, $group_guid = 0, $limit = 10, $offset = 0, $order_by = "asc", $count = false, $timelower = 0, $timeupper = 0)
{
global $CONFIG;
$entity_type = sanitise_string($entity_type);
$entity_subtype = get_subtype_id($entity_type, $entity_subtype);
+ $timelower = (int) $timelower;
+ $timeupper = (int) $timeupper;
+
if ($name)
{
$name = get_metastring_id($name);
@@ -414,7 +419,11 @@
if ($value != "")
$where[] = "a.value_id='$value'";
-
+
+ if ($timelower)
+ $where[] = "a.time_created >= {$timelower}";
+ if ($timeupper)
+ $where[] = "a.time_created <= {$timeupper}";
if ($count) {
$query = "SELECT count(distinct e.guid) as total ";