From 9f8b6dff1ce7ddce93647d7155ecdfb102a2f4e0 Mon Sep 17 00:00:00 2001 From: Friendika Date: Wed, 16 Feb 2011 23:05:48 -0800 Subject: [PATCH] ajax live update for all network pages and subpages --- mod/network.php | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/mod/network.php b/mod/network.php index bb0850d68..773c21be2 100644 --- a/mod/network.php +++ b/mod/network.php @@ -40,6 +40,14 @@ function network_content(&$a, $update = 0) { $nouveau = false; + if($update && (x($_SESSION,'netargs'))) { + $nouveau = $_SESSION['netargs']['nouveau']; + $group = $_SESSION['netargs']['group']; + $a->pager['page'] = $_SESSION['netargs']['page']; + $a->set_pager_itemspage(50); + } + + if(! $update) { $o .= ''; @@ -56,6 +64,8 @@ function network_content(&$a, $update = 0) { } } + + $_SESSION['netarg'] = array('nouveau' => $nouveau, 'group' => $group, 'page' => $a->pager['page']); $_SESSION['return_url'] = $a->cmd; $geotag = (($a->user['allow_location']) ? load_view_file('view/jot_geotag.tpl') : ''); @@ -106,10 +116,10 @@ function network_content(&$a, $update = 0) { // filtering by group and also you aren't writing a comment (the last // criteria is discovered in javascript). - if($a->pager['start'] == 0 && $a->argc == 1) { +// if($a->pager['start'] == 0 && $a->argc == 1) { $o .= '
' . "\r\n"; $o .= "\r\n"; - } +// } } @@ -341,7 +351,7 @@ function network_content(&$a, $update = 0) { if($item['last-child']) { $comment = replace_macros($cmnt_tpl,array( '$return_path' => '', - '$jsreload => '', // $_SESSION['return_url'], + '$jsreload' => '', // $_SESSION['return_url'], '$type' => 'net-comment', '$id' => $item['item_id'], '$parent' => $item['parent'],