aboutsummaryrefslogtreecommitdiffstats
path: root/mod/profile.php
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2011-12-12 16:11:03 -0800
committerfriendica <info@friendica.com>2011-12-12 16:11:03 -0800
commitc45b903178f5dd0a6b98697db52de444c4a5d66a (patch)
treedd869305bae64c344ea2eb46377c033b8352bc59 /mod/profile.php
parent80428a33d559cb163390ca471f32919a3bbb0768 (diff)
downloadvolse-hubzilla-c45b903178f5dd0a6b98697db52de444c4a5d66a.tar.gz
volse-hubzilla-c45b903178f5dd0a6b98697db52de444c4a5d66a.tar.bz2
volse-hubzilla-c45b903178f5dd0a6b98697db52de444c4a5d66a.zip
live update improvements
Diffstat (limited to 'mod/profile.php')
-rw-r--r--mod/profile.php37
1 files changed, 20 insertions, 17 deletions
diff --git a/mod/profile.php b/mod/profile.php
index be608e3e9..b7f2c9662 100644
--- a/mod/profile.php
+++ b/mod/profile.php
@@ -158,9 +158,16 @@ function profile_content(&$a, $update = 0) {
if($update) {
- // only setup pagination on initial page view
- $pager_sql = '';
- $update_sql = " AND unseen = 1 ";
+ $r = q("SELECT distinct(parent) AS `item_id`, `contact`.`uid` AS `contact-uid`
+ FROM `item` LEFT JOIN `contact` ON `contact`.`id` = `item`.`contact-id`
+ WHERE `item`.`uid` = %d AND `item`.`visible` = 1 AND `item`.`deleted` = 0
+ and `item`.`parent` in (select parent from item where unseen = 1 )
+ AND `contact`.`blocked` = 0 AND `contact`.`pending` = 0
+ AND `item`.`wall` = 1
+ $sql_extra
+ ORDER BY `item`.`created` DESC",
+ intval($a->profile['profile_uid'])
+ );
}
else {
@@ -180,22 +187,18 @@ function profile_content(&$a, $update = 0) {
}
$pager_sql = sprintf(" LIMIT %d, %d ",intval($a->pager['start']), intval($a->pager['itemspage']));
- $update_sql = '';
-
- }
-
- $r = q("SELECT `item`.`id` AS `item_id`, `contact`.`uid` AS `contact-uid`
- FROM `item` LEFT JOIN `contact` ON `contact`.`id` = `item`.`contact-id`
- WHERE `item`.`uid` = %d AND `item`.`visible` = 1 AND `item`.`deleted` = 0
- $update_sql
- AND `contact`.`blocked` = 0 AND `contact`.`pending` = 0
- AND `item`.`id` = `item`.`parent` AND `item`.`wall` = 1
- $sql_extra
- ORDER BY `item`.`created` DESC $pager_sql ",
- intval($a->profile['profile_uid'])
+ $r = q("SELECT `item`.`id` AS `item_id`, `contact`.`uid` AS `contact-uid`
+ FROM `item` LEFT JOIN `contact` ON `contact`.`id` = `item`.`contact-id`
+ WHERE `item`.`uid` = %d AND `item`.`visible` = 1 AND `item`.`deleted` = 0
+ AND `contact`.`blocked` = 0 AND `contact`.`pending` = 0
+ AND `item`.`id` = `item`.`parent` AND `item`.`wall` = 1
+ $sql_extra
+ ORDER BY `item`.`created` DESC $pager_sql ",
+ intval($a->profile['profile_uid'])
- );
+ );
+ }
$parents_arr = array();
$parents_str = '';