X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=mod%2Fprofile.php;h=827530bc8aa63afa8a1c532c16a84a5d9ec7a2e8;hb=fecef140d5181348e1f46cf8405f13bb05401b3e;hp=e8eee810bfb6a9ba686931abdb27548523d92067;hpb=d6b8e8c6a98fb05c9f38f2c323502eb452c031ff;p=friendica.git diff --git a/mod/profile.php b/mod/profile.php index e8eee810bf..827530bc8a 100644 --- a/mod/profile.php +++ b/mod/profile.php @@ -18,6 +18,9 @@ function profile_init(&$a) { profile_load($a,$which,$profile); + if((x($a->profile,'page-flags')) && ($a->profile['page-flags'] & PAGE_COMMUNITY)) { + $a->page['htmlhead'] .= ''; + } if(x($a->profile,'openidserver')) $a->page['htmlhead'] .= '' . "\r\n"; if(x($a->profile,'openid')) { @@ -82,7 +85,6 @@ function profile_content(&$a, $update = 0) { $is_owner = ((local_user()) && (local_user() == $a->profile['profile_uid']) ? true : false); - if(! $update) { if(x($_GET,'tab')) $tab = notags(trim($_GET['tab'])); @@ -134,12 +136,24 @@ function profile_content(&$a, $update = 0) { $lockstate = 'lock'; else $lockstate = 'unlock'; + + $jotplugins = ''; + $jotnets = ''; + call_hooks('jot_tool', $jotplugins); + + call_hooks('jot_networks', $jotnets); + + $tpl = replace_macros($tpl,array('$jotplugins' => $jotplugins)); + $o .= replace_macros($tpl,array( '$baseurl' => $a->get_baseurl(), '$defloc' => (($is_owner) ? $a->user['default-location'] : ''), '$return_path' => $a->cmd, '$visitor' => (($is_owner || $commvisitor) ? 'block' : 'none'), '$lockstate' => $lockstate, + '$emailcc' => t('CC: email addresses'), + '$jotnets' => $jotnets, + '$emtitle' => t('Example: bob@example.com, mary@example.com'), '$bang' => '', '$acl' => (($is_owner) ? populate_acl($a->user, $celeb) : ''), '$profile_uid' => $a->profile['profile_uid'] @@ -149,11 +163,11 @@ function profile_content(&$a, $update = 0) { // This is ugly, but we can't pass the profile_uid through the session to the ajax updater, // because browser prefetching might change it on us. We have to deliver it with the page. - if($tab === 'posts' && (! $a->pager['start'])) { + if($tab === 'posts') { $o .= '
' . "\r\n"; - $o .= "\r\n"; + $o .= "\r\n"; } - } // Construct permissions @@ -228,6 +242,10 @@ function profile_content(&$a, $update = 0) { ); + + if($is_owner && ! $update) + $o .= get_birthdays(); + $cmnt_tpl = load_view_file('view/comment_item.tpl'); $like_tpl = load_view_file('view/like.tpl'); @@ -277,7 +295,8 @@ function profile_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' => 'wall-comment', '$id' => $item['item_id'], '$parent' => $item['parent'], @@ -293,7 +312,7 @@ function profile_content(&$a, $update = 0) { $profile_url = $item['url']; - // This is my profile but I'm not the author of this post/comment. If it's somebody that's a fan or mutual friend, + // This is my profile page but I'm not the author of this post/comment. If it's somebody that's a fan or mutual friend, // I can go directly to their profile as an authenticated guest. if(local_user() && ($item['contact-uid'] == $_SESSION['uid']) @@ -310,7 +329,7 @@ function profile_content(&$a, $update = 0) { // local contact info at all. In this module you should never encounter a third-party author, but we still will do // the right thing if you ever do. - $diff_author = (($item['url'] !== $item['author-link']) ? true : false); + $diff_author = ((link_compare($item['url'],$item['author-link'])) ? false : true); $profile_name = (((strlen($item['author-name'])) && $diff_author) ? $item['author-name'] : $item['name']); $profile_avatar = (((strlen($item['author-avatar'])) && $diff_author) ? $item['author-avatar'] : $item['thumb']); @@ -323,7 +342,7 @@ function profile_content(&$a, $update = 0) { if(($item['contact-id'] == remote_user()) || ($item['uid'] == local_user())) $dropping = true; - $drop = replace_macros((($dropping)? $droptpl : $fakedrop), array('$id' => $item['id'])); + $drop = replace_macros((($dropping)? $droptpl : $fakedrop), array('$id' => $item['id'], '$delete' => t('Delete'))); $like = ((isset($alike[$item['id']])) ? format_like($alike[$item['id']],$alike[$item['id'] . '-l'],'like',$item['id']) : ''); @@ -344,7 +363,7 @@ function profile_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'), '$profile_url' => $profile_link, '$name' => $profile_name, '$thumb' => $profile_avatar, @@ -355,6 +374,7 @@ function profile_content(&$a, $update = 0) { '$lock' => $lock, '$location' => $location, '$indent' => $indent, + '$plink' => get_plink($item), '$drop' => $drop, '$like' => $like, '$vote' => $likebuttons, @@ -375,6 +395,8 @@ function profile_content(&$a, $update = 0) { } $o .= paginate($a); + $o .= '
' . t('Shared content is covered by the Creative Commons Attribution 3.0 license.') . '
'; + return $o; }