]> git.mxchange.org Git - friendica.git/blobdiff - mod/network.php
Merge commit 'mike/master'
[friendica.git] / mod / network.php
index f09b302e9bbdece1fbc10807856a38aafdcfed0d..79a2f2b3896c6490acc789abc7b705b197ff3e7d 100644 (file)
@@ -39,22 +39,22 @@ function network_content(&$a, $update = 0) {
        $group = 0;
 
        $nouveau = false;
+       require_once('include/acl_selectors.php');
 
-       if(! $update) {
-               $o .= '<script> $(document).ready(function() { $(\'#nav-network-link\').addClass(\'nav-selected\'); });</script>';
+       if(($a->argc > 2) && $a->argv[2] === 'new')
+               $nouveau = true;
 
-               if(($a->argc > 2) && $a->argv[2] === 'new')
+       if($a->argc > 1) {
+               if($a->argv[1] === 'new')
                        $nouveau = true;
-
-                       // pull out the group here because the updater might have different args
-               if($a->argc > 1) {
-                       if($a->argv[1] === 'new')
-                               $nouveau = true;
-                       else {
-                               $group = intval($a->argv[1]);
-                               $group_acl = array('allow_gid' => '<' . $group . '>');
-                       }
+               else {
+                       $group = intval($a->argv[1]);
+                       $group_acl = array('allow_gid' => '<' . $group . '>');
                }
+       }
+
+       if(! $update) {
+               $o .= '<script> $(document).ready(function() { $(\'#nav-network-link\').addClass(\'nav-selected\'); });</script>';
 
                $_SESSION['return_url'] = $a->cmd;
 
@@ -68,7 +68,6 @@ function network_content(&$a, $update = 0) {
                        '$nickname' => $a->user['nickname']
                ));
 
-               require_once('include/acl_selectors.php');
 
                $tpl = load_view_file("view/jot.tpl");
                
@@ -106,10 +105,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) {
                        $o .= '<div id="live-network"></div>' . "\r\n";
-                       $o .= "<script> var profile_uid = " . $_SESSION['uid'] . "; </script>\r\n";
-               }
+                       $o .= "<script> var profile_uid = " . $_SESSION['uid'] 
+                               . "; var netargs = '" . substr($a->cmd,8) 
+                               . "'; var profile_page = " . $a->pager['page'] . "; </script>\r\n";
 
        }
 
@@ -134,6 +133,8 @@ function network_content(&$a, $update = 0) {
                        intval($_SESSION['uid'])
                );
                if(! count($r)) {
+                       if($update)
+                               killme();
                        notice( t('No such group') . EOL );
                        goaway($a->get_baseurl() . '/network');
                        return; // NOTREACHED
@@ -340,7 +341,8 @@ function network_content(&$a, $update = 0) {
 
                        if($item['last-child']) {
                                $comment = replace_macros($cmnt_tpl,array(
-                                       '$return_path' => '', // $_SESSION['return_url'],
+                                       '$return_path' => '', 
+                                       '$jsreload' => '', // $_SESSION['return_url'],
                                        '$type' => 'net-comment',
                                        '$id' => $item['item_id'],
                                        '$parent' => $item['parent'],
@@ -425,6 +427,7 @@ function network_content(&$a, $update = 0) {
                                '$owner_url' => $owner_url,
                                '$owner_photo' => $owner_photo,
                                '$owner_name' => $owner_name,
+                               '$plink' => get_plink($item),
                                '$drop' => $drop,
                                '$vote' => $likebuttons,
                                '$like' => $like,