From 75306b62942a12995db67f48dd9b1a16f38c43eb Mon Sep 17 00:00:00 2001 From: Friendika Date: Sun, 5 Dec 2010 18:08:36 -0800 Subject: allow community page members to upload photos and assorted other stuff which was previously restricted to the page owner --- mod/profile.php | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) (limited to 'mod/profile.php') diff --git a/mod/profile.php b/mod/profile.php index a19f370de..c18c7d196 100644 --- a/mod/profile.php +++ b/mod/profile.php @@ -82,7 +82,6 @@ function profile_init(&$a) { function profile_content(&$a, $update = 0) { - require_once("include/bbcode.php"); require_once('include/security.php'); @@ -124,6 +123,7 @@ function profile_content(&$a, $update = 0) { } $is_owner = ((local_user()) && (local_user() == $a->profile['profile_uid']) ? true : false); + if(! $update) { if(x($_GET,'tab')) @@ -148,22 +148,27 @@ function profile_content(&$a, $update = 0) { return $o; } + $commpage = (($a->profile['page-flags'] == PAGE_COMMUNITY) ? true : false); + $commvisitor = (($commpage && $remote_contact == true) ? true : false); + $celeb = ((($a->profile['page-flags'] == PAGE_SOAPBOX) || ($a->profile['page-flags'] == PAGE_COMMUNITY)) ? true : false); - if(can_write_wall($a,$a->profile['profile_uid'])) { + if(can_write_wall($a,$a->profile['profile_uid'])) { - $geotag = (($is_owner && $a->profile['allow_location']) ? load_view_file('view/jot_geotag.tpl') : ''); + $geotag = ((($is_owner || $commvisitor) && $a->profile['allow_location']) ? load_view_file('view/jot_geotag.tpl') : ''); $tpl = load_view_file('view/jot-header.tpl'); $a->page['htmlhead'] .= replace_macros($tpl, array( '$baseurl' => $a->get_baseurl(), - '$geotag' => $geotag + '$geotag' => $geotag, + '$nickname' => $a->profile['nickname'] )); require_once('include/acl_selectors.php'); - $tpl = load_view_file("view/jot.tpl"); + $tpl = load_view_file('view/jot.tpl'); + if(is_array($a->user) && ((strlen($a->user['allow_cid'])) || (strlen($a->user['allow_gid'])) || (strlen($a->user['deny_cid'])) || (strlen($a->user['deny_gid'])))) $lockstate = 'lock'; else @@ -172,7 +177,7 @@ function profile_content(&$a, $update = 0) { '$baseurl' => $a->get_baseurl(), '$defloc' => (($is_owner) ? $a->user['default-location'] : ''), '$return_path' => $a->cmd, - '$visitor' => (($is_owner) ? 'block' : 'none'), + '$visitor' => (($is_owner || $commvisitor) ? 'block' : 'none'), '$lockstate' => $lockstate, '$bang' => '', '$acl' => (($is_owner) ? populate_acl($a->user, $celeb) : ''), -- cgit v1.2.3