X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=mod%2Fprofile.php;h=66386160f4706da1031a5cd79a34b3560735617b;hb=1e02fd8a72784d8f637bd7fa6f0b188cae182a3a;hp=5d89db93e7ab1c0153557e7155be0fe6fe051197;hpb=a76a497d924a16b8b07b126408db21655aac3bd6;p=friendica.git diff --git a/mod/profile.php b/mod/profile.php index 5d89db93e7..66386160f4 100755 --- 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) @@ -27,7 +32,7 @@ function profile_init(&$a) { profile_load($a,$which,$profile); if((x($a->profile,'page-flags')) && ($a->profile['page-flags'] == PAGE_COMMUNITY)) { - $a->page['htmlhead'] .= ''; + $a->page['htmlhead'] .= ''; } if(x($a->profile,'openidserver')) $a->page['htmlhead'] .= '' . "\r\n"; @@ -59,6 +64,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(); } @@ -112,7 +124,10 @@ function profile_content(&$a, $update = 0) { return; } - + require_once('include/contact_widgets.php'); + + $a->page['aside'] .= categories_widget($a->get_baseurl(true) . '/profile/' . $a->profile['nickname'],(x($category) ? xmlify($category) : '')); + if(! $update) { if(x($_GET,'tab')) $tab = notags(trim($_GET['tab'])); @@ -128,13 +143,14 @@ function profile_content(&$a, $update = 0) { } if(x($_SESSION,'new_member') && $_SESSION['new_member'] && $is_owner) - $o .= '' . t('Tips for New Members') . '' . EOL; + $o .= '' . t('Tips for New Members') . '' . EOL; $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'])) { $x = array( @@ -159,7 +175,7 @@ function profile_content(&$a, $update = 0) { * Get permissions SQL - if $remote_contact is true, our remote user has been pre-verified and we already have fetched his/her groups */ - $sql_extra = permissions_sql($a->profile['profile_uid'],$remote_contact,$groups); + $sql_extra = item_permissions_sql($a->profile['profile_uid'],$remote_contact,$groups); if($update) { @@ -178,6 +194,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 +224,7 @@ function profile_content(&$a, $update = 0) { intval($a->profile['profile_uid']) ); + } $parents_arr = array(); @@ -228,10 +249,12 @@ function profile_content(&$a, $update = 0) { intval($a->profile['profile_uid']), dbesc($parents_str) ); + + $items = conv_sort($items,'created'); + } else { + $items = array(); } - $items = conv_sort($items,'created'); - if($is_owner && ! $update) { $o .= get_birthdays(); $o .= get_events();