X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=mod%2Fnetwork.php;h=68c9656e50504686d82ebb32f6fff35fb85ba1b2;hb=c3cb3d75e593faa06e4050a016ef1893bd5a4a3a;hp=10683aeda8022744c376a92c0f45361406381842;hpb=28ebbe38d6f987c91b508d384e24ba15c2dad06b;p=friendica.git diff --git a/mod/network.php b/mod/network.php index 10683aeda8..68c9656e50 100644 --- a/mod/network.php +++ b/mod/network.php @@ -2,8 +2,10 @@ function network_init(&$a) { - if(! local_user()) - goaway( $a->get_baseurl() . "/login" ); + if(! local_user()) { + notice( t('Permission denied.') . EOL); + return; + } require_once('include/group.php'); @@ -26,7 +28,8 @@ function network_init(&$a) { function network_content(&$a, $update = 0) { if(! local_user()) - return ""; + return login(false); + $o = ''; require_once("include/bbcode.php"); @@ -35,23 +38,23 @@ function network_content(&$a, $update = 0) { $group = 0; - if(! $update) { - $o .= ''; + $nouveau = false; + require_once('include/acl_selectors.php'); - $nouveau = false; + 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 .= ''; $_SESSION['return_url'] = $a->cmd; @@ -65,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"); @@ -76,11 +78,21 @@ function network_content(&$a, $update = 0) { $celeb = ((($a->user['page-flags'] == PAGE_SOAPBOX) || ($a->user['page-flags'] == PAGE_COMMUNITY)) ? true : false); + $jotplugins = ''; + $jotnets = ''; + call_hooks('jot_tool', $jotplugins); + call_hooks('jot_networks', $jotnets); + + $tpl = replace_macros($tpl,array('$jotplugins' => $jotplugins)); + $o .= replace_macros($tpl,array( '$return_path' => $a->cmd, '$baseurl' => $a->get_baseurl(), '$defloc' => $a->user['default-location'], '$visitor' => 'block', + '$emailcc' => t('CC: email addresses'), + '$jotnets' => $jotnets, + '$emtitle' => t('Example: bob@example.com, mary@example.com'), '$lockstate' => $lockstate, '$acl' => populate_acl((($group) ? $group_acl : $a->user), $celeb), '$bang' => (($group) ? '!' : ''), @@ -93,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 .= '
' . "\r\n"; - $o .= "\r\n"; - } + $o .= "\r\n"; } @@ -121,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 @@ -237,7 +251,7 @@ function network_content(&$a, $update = 0) { '$lock' => $lock, '$thumb' => $profile_avatar, '$title' => $item['title'], - '$body' => bbcode($item['body']), + '$body' => smilies(bbcode($item['body'])), '$ago' => relative_date($item['created']), '$location' => $location, '$indent' => '', @@ -327,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'], @@ -339,7 +354,7 @@ function network_content(&$a, $update = 0) { )); } - $drop = replace_macros(load_view_file('view/wall_item_drop.tpl'), array('$id' => $item['id'])); + $drop = replace_macros(load_view_file('view/wall_item_drop.tpl'), array('$id' => $item['id'], '$delete' => t('Delete'))); @@ -397,7 +412,11 @@ function network_content(&$a, $update = 0) { $tmp_item = replace_macros($template,array( '$id' => $item['item_id'], - '$title' => t('View $name\'s profile'), + '$linktitle' => t('View $name\'s profile'), + '$olinktitle' => t('View $owner_name\'s profile'), + '$to' => t('to'), + '$wall' => t('Wall-to-Wall'), + '$vwall' => t('via Wall-To-Wall:'), '$profile_url' => $profile_link, '$name' => $profile_name, '$thumb' => $profile_avatar, @@ -412,6 +431,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, @@ -427,8 +447,10 @@ function network_content(&$a, $update = 0) { } } - if(! $update) + if(! $update) { $o .= paginate($a); + $o .= '
' . t('Shared content is covered by the Creative Commons Attribution 3.0 license.') . '
'; + } return $o; } \ No newline at end of file