X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=mod%2Fprofile.php;h=7a11e9bc6b1fe80a261b5328ac77400afecf8bc8;hb=28eb5d57a72aae22428061b26b90195f7feacadf;hp=259e0860825c1c11a0c33713b54fe61c5be07129;hpb=53c1bf6ba321970fe7de551044f7951f002b57ec;p=friendica.git diff --git a/mod/profile.php b/mod/profile.php index 259e086082..7a11e9bc6b 100644 --- a/mod/profile.php +++ b/mod/profile.php @@ -1,9 +1,10 @@ page,'aside')) @@ -210,13 +211,15 @@ function profile_content(App $a, $update = 0) { if ($update) { + $last_updated = (x($_SESSION['last_updated'], $last_updated_key) ? $_SESSION['last_updated'][$last_updated_key] : 0); + // If the page user is the owner of the page we should query for unseen // items. Otherwise use a timestamp of the last succesful update request. - if ($is_owner) { + if ($is_owner || !$last_updated) { $sql_extra4 = " AND `item`.`unseen`"; } else { - $last_updated = gmdate("Y-m-d H:i:s", $_SESSION['last_updated'][$last_updated_key]); - $sql_extra4 = " AND `item`.`received` > '" . $last_updated . "'"; + $gmupdate = gmdate("Y-m-d H:i:s", $last_updated); + $sql_extra4 = " AND `item`.`received` > '" . $gmupdate . "'"; } $r = q("SELECT distinct(parent) AS `item_id`, `item`.`network` AS `item_network`, `item`.`created` @@ -304,7 +307,7 @@ function profile_content(App $a, $update = 0) { $parents_str = ''; // Set a time stamp for this page. We will make use of it when we - // search fornew items (update routine) + // search for new items (update routine) $_SESSION['last_updated'][$last_updated_key] = time(); if (dbm::is_result($r)) {