diff options
author | friendica <info@friendica.com> | 2012-07-17 05:30:32 -0700 |
---|---|---|
committer | friendica <info@friendica.com> | 2012-07-17 05:30:32 -0700 |
commit | 359c74d320eef7fad24a30b677522a428affe509 (patch) | |
tree | ad55a535a681559a93daf5929346ca49f7de0063 | |
parent | 91e4c2fce1d3004dcdec589035084c4e8ee9a1b4 (diff) | |
download | volse-hubzilla-359c74d320eef7fad24a30b677522a428affe509.tar.gz volse-hubzilla-359c74d320eef7fad24a30b677522a428affe509.tar.bz2 volse-hubzilla-359c74d320eef7fad24a30b677522a428affe509.zip |
error cleanup
-rwxr-xr-x | include/items.php | 10 | ||||
-rw-r--r-- | mod/content.php | 12 | ||||
-rw-r--r-- | mod/network.php | 2 | ||||
-rw-r--r-- | mod/profile.php | 11 |
4 files changed, 8 insertions, 27 deletions
diff --git a/include/items.php b/include/items.php index b7890e602..a780b05e6 100755 --- a/include/items.php +++ b/include/items.php @@ -3760,10 +3760,12 @@ function fetch_post_tags($items) { $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) - ); + if(strlen($tag_finder_str)) { + $tags = q("select * from term where oid in ( %s ) and otype = %d", + dbesc($tag_finder_str), + intval(TERM_OBJ_POST) + ); + } for($x = 0; $x < count($items); $x ++) { if(count($tags)) { diff --git a/mod/content.php b/mod/content.php index 7799ee6ad..cde62d046 100644 --- a/mod/content.php +++ b/mod/content.php @@ -278,18 +278,6 @@ function content_content(&$a, $update = 0) { $second = dba_timer(); - $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 = fetch_post_tags($items); $items = conv_sort($items,$ordering); diff --git a/mod/network.php b/mod/network.php index 5ff883d49..b1bef5d53 100644 --- a/mod/network.php +++ b/mod/network.php @@ -614,6 +614,8 @@ function network_content(&$a, $update = 0) { intval($_SESSION['uid']) ); + require_once('include/items.php'); + $items = fetch_post_tags($items); } else { diff --git a/mod/profile.php b/mod/profile.php index b5fdeec3a..78507820f 100644 --- a/mod/profile.php +++ b/mod/profile.php @@ -282,17 +282,6 @@ function profile_content(&$a, $update = 0) { dbesc($parents_str) ); - $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 = fetch_post_tags($items); $items = conv_sort($items,'created'); |