aboutsummaryrefslogtreecommitdiffstats
path: root/mod/content.php
diff options
context:
space:
mode:
Diffstat (limited to 'mod/content.php')
-rw-r--r--mod/content.php14
1 files changed, 13 insertions, 1 deletions
diff --git a/mod/content.php b/mod/content.php
index 01856d88d..369f2fce2 100644
--- a/mod/content.php
+++ b/mod/content.php
@@ -278,7 +278,19 @@ function content_content(&$a, $update = 0) {
$second = dba_timer();
- $items = conv_sort($items,$ordering);
+ $tag_finder = array();
+ if(count($items))
+ foreach($items as $item)
+ if(! in_array($item['item_id'],$tag_finder))
+ $tag_finder[] = $item['item_id'];
+ $tag_finder_str = implode(', ', $tag_finder);
+
+ $tags = q("select * from term where oid in ( %s ) and otype = %d",
+ dbesc($tag_finder_str),
+ intval(TERM_OBJ_POST)
+ );
+
+ $items = conv_sort($items,$tags,$ordering);
} else {
$items = array();