From b274422867a11f14a1a2bfcf57b1de4961361e15 Mon Sep 17 00:00:00 2001 From: friendica Date: Fri, 18 Jan 2013 19:54:37 -0800 Subject: if chanview is provided a url - always load it even if there's no xchan available on this site. --- mod/chanview.php | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'mod') diff --git a/mod/chanview.php b/mod/chanview.php index b2a8e12d2..a9f3969d1 100644 --- a/mod/chanview.php +++ b/mod/chanview.php @@ -26,7 +26,7 @@ function chanview_content(&$a) { dbesc($_REQUEST['url']) ); if(! $r) - $r = array(array('xchan_url' => $_REQUEST['url'])); + $xchan = array(array('xchan_url' => $_REQUEST['url'])); } if($r) { $xchan = $r[0]; @@ -39,10 +39,15 @@ function chanview_content(&$a) { return; } + $observer = get_observer(); + + $url = (($observer) + ? z_root() . '/magic?f=&dest=' . $xchan['xchan_url'] . '&addr=' . $xchan['xchan_addr'] + : $xchan['xchan_url'] + ); + $o = replace_macros(get_markup_template('chanview.tpl'),array( - '$url' => $xchan['xchan_url'] -// FIXME when magic auth is finished replace here and check that against the chanview page when unauthenticated any place -// '$url' => z_root() . '/magic?f=&dest=' . $xchan['xchan_url'] . '&addr=' . $xchan['xchan_addr'] + '$url' => $url )); return $o; -- cgit v1.2.3