X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=mod%2Fprofile.php;h=68d73fba3829b50aab8d2fb33897788ee148dfe9;hb=d509a463452585bcbb9fccd07857871ca5c8b063;hp=90a609d0361df46433c94f8f8066347fa871d82f;hpb=93563370c96848948d28ed39e13284ebaf7f430a;p=friendica.git diff --git a/mod/profile.php b/mod/profile.php old mode 100644 new mode 100755 index 90a609d036..68d73fba38 --- 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,8 +124,9 @@ function profile_content(&$a, $update = 0) { return; } - if(! $update) { + + if(x($_GET,'tab')) $tab = notags(trim($_GET['tab'])); @@ -128,13 +141,15 @@ 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); + $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( @@ -159,7 +174,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) { @@ -167,7 +182,7 @@ function profile_content(&$a, $update = 0) { $r = q("SELECT distinct(parent) AS `item_id`, `contact`.`uid` AS `contact-uid` FROM `item` LEFT JOIN `contact` ON `contact`.`id` = `item`.`contact-id` WHERE `item`.`uid` = %d AND `item`.`visible` = 1 AND `item`.`deleted` = 0 - and `item`.`unseen` = 1 + and `item`.`moderated` = 0 and `item`.`unseen` = 1 AND `contact`.`blocked` = 0 AND `contact`.`pending` = 0 AND `item`.`wall` = 1 $sql_extra @@ -178,10 +193,14 @@ 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 - AND `contact`.`blocked` = 0 AND `contact`.`pending` = 0 + and `item`.`moderated` = 0 AND `contact`.`blocked` = 0 AND `contact`.`pending` = 0 AND `item`.`id` = `item`.`parent` AND `item`.`wall` = 1 $sql_extra ", intval($a->profile['profile_uid']) @@ -197,13 +216,14 @@ function profile_content(&$a, $update = 0) { $r = q("SELECT `item`.`id` AS `item_id`, `contact`.`uid` AS `contact-uid` FROM `item` LEFT JOIN `contact` ON `contact`.`id` = `item`.`contact-id` WHERE `item`.`uid` = %d AND `item`.`visible` = 1 AND `item`.`deleted` = 0 - AND `contact`.`blocked` = 0 AND `contact`.`pending` = 0 + and `item`.`moderated` = 0 AND `contact`.`blocked` = 0 AND `contact`.`pending` = 0 AND `item`.`id` = `item`.`parent` AND `item`.`wall` = 1 $sql_extra ORDER BY `item`.`created` DESC $pager_sql ", intval($a->profile['profile_uid']) ); + } $parents_arr = array(); @@ -220,6 +240,7 @@ function profile_content(&$a, $update = 0) { `contact`.`id` AS `cid`, `contact`.`uid` AS `contact-uid` FROM `item`, `contact` WHERE `item`.`uid` = %d AND `item`.`visible` = 1 AND `item`.`deleted` = 0 + and `item`.`moderated` = 0 AND `contact`.`id` = `item`.`contact-id` AND `contact`.`blocked` = 0 AND `contact`.`pending` = 0 AND `item`.`parent` IN ( %s ) @@ -227,10 +248,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();