X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=mod%2Fprofile.php;h=69f044e89f4561f02bf4cfe357cd129cf22eec70;hb=d0dd22af570a06016053030fa468f83d14f25f5d;hp=428679ffc53e02f85f8bf573e4adb371c0557fe7;hpb=1401f763eca776052e97c4d270b33f8c4e1c6e4c;p=friendica.git diff --git a/mod/profile.php b/mod/profile.php old mode 100755 new mode 100644 index 428679ffc5..69f044e89f --- a/mod/profile.php +++ b/mod/profile.php @@ -2,6 +2,11 @@ function profile_init(&$a) { + require_once('include/contact_widgets.php'); + + if(! x($a->page,'aside')) + $a->page['aside'] = ''; + $blocked = (((get_config('system','block_public')) && (! local_user()) && (! remote_user())) ? true : false); if($a->argc > 1) @@ -9,9 +14,10 @@ function profile_init(&$a) { else { $r = q("select nickname from user where blocked = 0 and account_expired = 0 and verified = 1 order by rand() limit 1"); if(count($r)) { - $which = $r[0]['nickname']; + goaway($a->get_baseurl() . '/profile/' . $r[0]['nickname']); } else { + logger('profile error: mod_profile ' . $a->query_string, LOGGER_DEBUG); notice( t('Requested profile is not available.') . EOL ); $a->error = 404; return; @@ -26,6 +32,8 @@ function profile_init(&$a) { profile_load($a,$which,$profile); + $userblock = (($a->profile['hidewall'] && (! local_user()) && (! remote_user())) ? true : false); + if((x($a->profile,'page-flags')) && ($a->profile['page-flags'] == PAGE_COMMUNITY)) { $a->page['htmlhead'] .= ''; } @@ -35,8 +43,8 @@ function profile_init(&$a) { $delegate = ((strstr($a->profile['openid'],'://')) ? $a->profile['openid'] : 'http://' . $a->profile['openid']); $a->page['htmlhead'] .= '' . "\r\n"; } - - if(! $blocked) { + // site block + if((! $blocked) && (! $userblock)) { $keywords = ((x($a->profile,'pub_keywords')) ? $a->profile['pub_keywords'] : ''); $keywords = str_replace(array('#',',',' ',',,'),array('',' ',',',','),$keywords); if(strlen($keywords)) @@ -59,6 +67,13 @@ function profile_init(&$a) { function profile_content(&$a, $update = 0) { + if (x($a->category)) { + $category = $a->category; + } + else { + $category = ((x($_GET,'category')) ? $_GET['category'] : ''); + } + if(get_config('system','block_public') && (! local_user()) && (! remote_user())) { return login(); } @@ -107,13 +122,14 @@ function profile_content(&$a, $update = 0) { $is_owner = ((local_user()) && (local_user() == $a->profile['profile_uid']) ? true : false); - if($a->user['hidewall'] && (! $is_owner) && (! $remote_contact)) { + if($a->profile['hidewall'] && (! $is_owner) && (! $remote_contact)) { notice( t('Access to this profile has been restricted.') . EOL); return; } - if(! $update) { + + if(x($_GET,'tab')) $tab = notags(trim($_GET['tab'])); @@ -127,6 +143,10 @@ function profile_content(&$a, $update = 0) { return $o; } + + $o .= common_friends_visitor_widget($a->profile['profile_uid']); + + if(x($_SESSION,'new_member') && $_SESSION['new_member'] && $is_owner) $o .= '' . t('Tips for New Members') . '' . EOL; @@ -135,6 +155,8 @@ function profile_content(&$a, $update = 0) { $celeb = ((($a->profile['page-flags'] == PAGE_SOAPBOX) || ($a->profile['page-flags'] == PAGE_COMMUNITY)) ? true : false); + $a->page['aside'] .= categories_widget($a->get_baseurl(true) . '/profile/' . $a->profile['nickname'],(x($category) ? xmlify($category) : '')); + if(can_write_wall($a,$a->profile['profile_uid'])) { $x = array( @@ -178,6 +200,10 @@ function profile_content(&$a, $update = 0) { } else { + if(x($category)) { + $sql_extra .= file_tag_file_query('item',$category,'category'); + } + $r = q("SELECT COUNT(*) AS `total` FROM `item` LEFT JOIN `contact` ON `contact`.`id` = `item`.`contact-id` WHERE `item`.`uid` = %d AND `item`.`visible` = 1 AND `item`.`deleted` = 0 @@ -204,6 +230,7 @@ function profile_content(&$a, $update = 0) { intval($a->profile['profile_uid']) ); + } $parents_arr = array();