diff options
author | Greg Froese <greg.froese@gmail.com> | 2009-05-18 12:57:59 +0000 |
---|---|---|
committer | Greg Froese <greg.froese@gmail.com> | 2009-05-18 12:57:59 +0000 |
commit | 70ad5de3a1d4fffc8b3d97c301194bb0258b4c68 (patch) | |
tree | 765e5d8b7081fd3373df0fb89d33a237a0239fce /friendmostviewed.php | |
parent | dd81b02a85596a913c4a42fba655766b61334eb1 (diff) | |
download | elgg-70ad5de3a1d4fffc8b3d97c301194bb0258b4c68.tar.gz elgg-70ad5de3a1d4fffc8b3d97c301194bb0258b4c68.tar.bz2 |
fixed watermarking after code re-org and added most recently viewed option
Diffstat (limited to 'friendmostviewed.php')
-rw-r--r-- | friendmostviewed.php | 11 |
1 files changed, 1 insertions, 10 deletions
diff --git a/friendmostviewed.php b/friendmostviewed.php index 4f832b228..8f6299c0d 100644 --- a/friendmostviewed.php +++ b/friendmostviewed.php @@ -31,18 +31,9 @@ global $CONFIG; $prefix = $CONFIG->dbprefix; $max = 24; - //grab the top views (metadata 'tp_views') for $max number of entities - //ignores entity subtypes - $sql = "SELECT md.entity_guid, md.owner_guid, md.enabled, ms.string AS views from " . $prefix . "entities ent - INNER JOIN " . $prefix . "metadata md ON md.entity_guid = ent.guid - INNER JOIN " . $prefix . "metastrings ms ON md.value_id = ms.id - INNER JOIN " . $prefix . "metastrings ms2 ON md.name_id = ms2.id AND ms2.string = 'tp_views' - WHERE ent.owner_guid = " . $user->guid . " - ORDER BY (views+0) DESC LIMIT $max"; - $sql = "SELECT ent.guid, count( * ) AS views - FROM `my_elggentities` ent + FROM " . $prefix . "entities ent INNER JOIN " . $prefix . "entity_subtypes sub ON ent.subtype = sub.id AND sub.subtype = 'image' INNER JOIN " . $prefix . "annotations ann1 ON ann1.entity_guid = ent.guid |