]> git.mxchange.org Git - friendica.git/commitdiff
move liveupdate after birthdays/events
authorfriendica <info@friendica.com>
Fri, 25 Nov 2011 01:32:45 +0000 (17:32 -0800)
committerfriendica <info@friendica.com>
Fri, 25 Nov 2011 01:32:45 +0000 (17:32 -0800)
mod/network.php
mod/profile.php

index 763b3693f4191a6aee018308d8e6e1f782613ca0..b6440cabbf0781c0889c6e12358bf4f8342bb9c0 100644 (file)
@@ -342,6 +342,24 @@ function network_content(&$a, $update = 0) {
                $o .= get_events();
        }
 
+       if(! $update) {
+               // The special div is needed for liveUpdate to kick in for this page.
+               // We only launch liveUpdate if you aren't filtering in some incompatible 
+               // way and also you aren't writing a comment (discovered in javascript).
+
+               $o .= '<div id="live-network"></div>' . "\r\n";
+               $o .= "<script> var profile_uid = " . $_SESSION['uid'] 
+                       . "; var netargs = '" . substr($a->cmd,8)
+                       . '?f='
+                       . ((x($_GET,'cid')) ? '&cid=' . $_GET['cid'] : '')
+                       . ((x($_GET,'search')) ? '&search=' . $_GET['search'] : '') 
+                       . ((x($_GET,'star')) ? '&star=' . $_GET['star'] : '') 
+                       . ((x($_GET,'order')) ? '&order=' . $_GET['order'] : '') 
+                       . ((x($_GET,'bmark')) ? '&bmark=' . $_GET['bmark'] : '') 
+                       . ((x($_GET,'liked')) ? '&liked=' . $_GET['liked'] : '') 
+                       . "'; var profile_page = " . $a->pager['page'] . "; </script>\r\n";
+       }
+
        $sql_extra2 = (($nouveau) ? '' : " AND `item`.`parent` = `item`.`id` ");
 
        if(x($_GET,'search')) {
index f68006af54620bfd1bc4b5ca28abc31e9a95f98f..f35ef3653fa48cc2ca85073b581ba8b44d93d4cb 100644 (file)
@@ -148,14 +148,6 @@ function profile_content(&$a, $update = 0) {
                $o .= status_editor($a,$x);
                }
 
-               // This is ugly, but we can't pass the profile_uid through the session to the ajax updater,
-               // because browser prefetching might change it on us. We have to deliver it with the page.
-
-               if($tab === 'posts') {
-                       $o .= '<div id="live-profile"></div>' . "\r\n";
-                       $o .= "<script> var profile_uid = " . $a->profile['profile_uid'] 
-                               . "; var netargs = '/?f='; var profile_page = " . $a->pager['page'] . "; </script>\r\n";
-               }
        }
 
        if($is_owner) {
@@ -229,6 +221,16 @@ function profile_content(&$a, $update = 0) {
                $o .= get_events();
        }
 
+       if((! $update) && ($tab === 'posts')) {
+
+               // This is ugly, but we can't pass the profile_uid through the session to the ajax updater,
+               // because browser prefetching might change it on us. We have to deliver it with the page.
+
+               $o .= '<div id="live-profile"></div>' . "\r\n";
+               $o .= "<script> var profile_uid = " . $a->profile['profile_uid'] 
+                       . "; var netargs = '/?f='; var profile_page = " . $a->pager['page'] . "; </script>\r\n";
+       }
+
        $o .= conversation($a,$r,'profile',$update);
 
        if(! $update) {