]> git.mxchange.org Git - friendica.git/blobdiff - mod/profile.php
Changes to make contacts delete all content from the user when a user is deleted.
[friendica.git] / mod / profile.php
index a4dce791802b8ad974599846fd55185a0d04424c..827166f92731135c093061981eec72176c43393b 100644 (file)
@@ -1,6 +1,7 @@
 <?php
 
 require_once('include/contact_widgets.php');
+require_once('include/redir.php');
 
 
 function profile_init(&$a) {
@@ -8,12 +9,10 @@ function profile_init(&$a) {
        if(! x($a->page,'aside'))
                $a->page['aside'] = '';
 
-       $blocked = (((get_config('system','block_public')) && (! local_user()) && (! remote_user())) ? true : false);
-
        if($a->argc > 1)
                $which = $a->argv[1];
        else {
-               $r = q("select nickname from user where blocked = 0 and account_expired = 0 and verified = 1 order by rand() limit 1");
+               $r = q("select nickname from user where blocked = 0 and account_expired = 0 and account_removed = 0 and verified = 1 order by rand() limit 1");
                if(count($r)) {
                        goaway($a->get_baseurl() . '/profile/' . $r[0]['nickname']);
                }
@@ -30,9 +29,13 @@ function profile_init(&$a) {
                $which = $a->user['nickname'];
                $profile = $a->argv[1];         
        }
+       else {
+               auto_redir($a, $which);
+       }
 
        profile_load($a,$which,$profile);
 
+       $blocked = (((get_config('system','block_public')) && (! local_user()) && (! remote_user())) ? true : false);
        $userblock = (($a->profile['hidewall'] && (! local_user()) && (! remote_user())) ? true : false);
 
        if((x($a->profile,'page-flags')) && ($a->profile['page-flags'] == PAGE_COMMUNITY)) {
@@ -304,21 +307,11 @@ function profile_content(&$a, $update = 0) {
                $items = array();
        }
 
-       if($is_owner && ! $update) {
+       if($is_owner && (! $update) && (! get_config('theme','hide_eventlist'))) {
                $o .= get_birthdays();
                $o .= get_events();
        }
 
-       if((! $update) && ($tab === 'posts')) {
-
-               // 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.
-
-               $o .= '<div id="live-profile"></div>' . "\r\n";
-               $o .= "<script> var profile_uid = " . $a->profile['profile_uid'] 
-                       . "; var netargs = '?f='; var profile_page = " . $a->pager['page'] . "; </script>\r\n";
-       }
-
 
        if($is_owner) {
                $r = q("UPDATE `item` SET `unseen` = 0