]> git.mxchange.org Git - friendica.git/blobdiff - mod/profile.php
Merge remote-tracking branch 'upstream/master'
[friendica.git] / mod / profile.php
old mode 100644 (file)
new mode 100755 (executable)
index 9464998..74e1a23
@@ -107,7 +107,7 @@ function profile_content(&$a, $update = 0) {
 
        $is_owner = ((local_user()) && (local_user() == $a->profile['profile_uid']) ? true : false);
 
-       if($a->profile['hidewall'] && (! $is_owner) && (! $remote_contact)) {
+       if($a->user['hidewall'] && (! $is_owner) && (! $remote_contact)) {
                notice( t('Access to this profile has been restricted.') . EOL);
                return;
        }
@@ -128,7 +128,7 @@ function profile_content(&$a, $update = 0) {
                }
 
                if(x($_SESSION,'new_member') && $_SESSION['new_member'] && $is_owner)
-                       $o .= '<a href="newmember">' . t('Tips for New Members') . '</a>' . EOL;
+                       $o .= '<a href="newmember" id="newmember-tips" style="font-size: 1.2em;"><b>' . t('Tips for New Members') . '</b></a>' . EOL;
 
                $commpage = (($a->profile['page-flags'] == PAGE_COMMUNITY) ? true : false);
                $commvisitor = (($commpage && $remote_contact == true) ? true : false);
@@ -167,7 +167,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`.`parent` in (select parent from item where unseen = 1 )
+                       and `item`.`moderated` = 0 and `item`.`unseen` = 1
                        AND `contact`.`blocked` = 0 AND `contact`.`pending` = 0
                        AND `item`.`wall` = 1
                        $sql_extra
@@ -181,7 +181,7 @@ function profile_content(&$a, $update = 0) {
                $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,7 +197,7 @@ 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 ",
@@ -218,16 +218,20 @@ function profile_content(&$a, $update = 0) {
                        `contact`.`name`, `contact`.`photo`, `contact`.`url`, `contact`.`network`, `contact`.`rel`, 
                        `contact`.`thumb`, `contact`.`self`, `contact`.`writable`, 
                        `contact`.`id` AS `cid`, `contact`.`uid` AS `contact-uid`
-                       FROM `item`, (SELECT `p`.`id`,`p`.`created` FROM `item` AS `p` WHERE `p`.`parent` = `p`.`id`) AS `parentitem`, `contact`
+                       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` = `parentitem`.`id` AND `item`.`parent` IN ( %s )
-                       $sql_extra
-                       ORDER BY `parentitem`.`created` DESC, `gravity` ASC, `item`.`created` ASC ",
+                       AND `item`.`parent` IN ( %s )
+                       $sql_extra ",
                        intval($a->profile['profile_uid']),
                        dbesc($parents_str)
                );
+               
+               $items = conv_sort($items,'created');
+       } else {
+               $items = array();
        }
 
        if($is_owner && ! $update) {