From fc8379b1080823bb69664aa4119ba190e1f5b1ca Mon Sep 17 00:00:00 2001 From: Mike Macgirvin Date: Sat, 24 Jul 2010 23:20:20 -0700 Subject: [PATCH] live updates sort of working --- mod/network.php | 8 +++++++- mod/profile.php | 11 ++++++++--- mod/update_network.php | 9 ++++++--- mod/update_profile.php | 9 ++++++--- view/head.tpl | 45 +++++++++++++++++++++++++++++++++++++----- view/jot-header.tpl | 36 +-------------------------------- 6 files changed, 68 insertions(+), 50 deletions(-) diff --git a/mod/network.php b/mod/network.php index cbd1f44545..0807f95614 100644 --- a/mod/network.php +++ b/mod/network.php @@ -119,9 +119,15 @@ function network_content(&$a, $update = false) { } } + if($update) + $return_url = $_SESSION['return_url']; + else + $return_url = $_SESSION['return_url'] = $a->cmd; + + if($item['last-child']) { $comment = replace_macros($cmnt_tpl,array( - '$return_path' => $a->cmd, + '$return_path' => $_SESSION['return_url'], '$id' => $item['item_id'], '$parent' => $item['parent'], '$profile_uid' => $_SESSION['uid'], diff --git a/mod/profile.php b/mod/profile.php index aa13f0a78d..0cfe228072 100644 --- a/mod/profile.php +++ b/mod/profile.php @@ -212,13 +212,18 @@ function profile_content(&$a, $update = false) { $redirect_url = $a->get_baseurl() . '/redir/' . $item['cid'] ; - if(can_write_wall($a,$a->profile['profile_uid'])) { + if($update) + $return_url = $_SESSION['return_url']; + else + $return_url = $_SESSION['return_url'] = $a->cmd; + + if(can_write_wall($a,$a->profile['uid'])) { if($item['last-child']) { $comment = replace_macros($cmnt_tpl,array( - '$return_path' => $a->cmd, + '$return_path' => $_SESSION['return_url'], '$id' => $item['item_id'], '$parent' => $item['parent'], - '$profile_uid' => $a->profile['profile_uid'], + '$profile_uid' => $a->profile['uid'], '$ww' => '' )); } diff --git a/mod/update_network.php b/mod/update_network.php index 655bebb965..18c630fdf0 100644 --- a/mod/update_network.php +++ b/mod/update_network.php @@ -6,9 +6,12 @@ require_once('mod/network.php'); function update_network_content(&$a) { - echo "\r\n"; - echo network_content($a,true); - echo "\r\n"; + header("Content-type: text/html"); + echo "\r\n"; + echo (($_GET['msie'] == 1) ? '
' : '
'); + echo str_replace("\t",' ',network_content($a,true)); + echo (($_GET['msie'] == 1) ? '
' : ''); + echo "\r\n"; killme(); } \ No newline at end of file diff --git a/mod/update_profile.php b/mod/update_profile.php index a0cb10f5d3..367a5568d8 100644 --- a/mod/update_profile.php +++ b/mod/update_profile.php @@ -6,9 +6,12 @@ require_once('mod/profile.php'); function update_profile_content(&$a) { - echo "\r\n"; - echo profile_content($a,true); - echo "\r\n"; + header("Content-type: text/html"); + echo "\r\n"; + echo (($_GET['msie'] == 1) ? '
' : '
'); + echo str_replace("\t",' ',profile_content($a,true)); + echo (($_GET['msie'] == 1) ? '
' : ''); + echo "\r\n"; killme(); } \ No newline at end of file diff --git a/view/head.tpl b/view/head.tpl index 6be3f7940a..d02f56c727 100644 --- a/view/head.tpl +++ b/view/head.tpl @@ -9,12 +9,24 @@ diff --git a/view/jot-header.tpl b/view/jot-header.tpl index 78e0151d80..3a1d0a2ae4 100644 --- a/view/jot-header.tpl +++ b/view/jot-header.tpl @@ -1,3 +1,4 @@ +