]> git.mxchange.org Git - friendica.git/blobdiff - mod/profile.php
Merge remote-tracking branch 'upstream/develop' into 1706-lock
[friendica.git] / mod / profile.php
index 3e98906b346feb563384d504685dd614dd61f169..7a11e9bc6b1fe80a261b5328ac77400afecf8bc8 100644 (file)
@@ -1,9 +1,10 @@
 <?php
 
+use Friendica\App;
+
 require_once('include/contact_widgets.php');
 require_once('include/redir.php');
 
-
 function profile_init(App $a) {
 
        if(! x($a->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`