]> git.mxchange.org Git - friendica.git/blobdiff - mod/display.php
allow contact if in allowed group, even if not in non-empty allowed contacts
[friendica.git] / mod / display.php
index 92ffd1a7095c7cc1b07bd8de1978f301fb84aa22..64df4cc6a9d7fc36a952a107f2845ccfaa21bf7c 100644 (file)
@@ -35,8 +35,18 @@ function display_content(&$a) {
        $contact = null;
        $remote_contact = false;
 
-       if(remote_user()) {
-               $contact_id = $_SESSION['visitor_id'];
+       $contact_id = 0;
+
+       if(is_array($_SESSION['remote'])) {
+               foreach($_SESSION['remote'] as $v) {
+                       if($v['uid'] == $a->profile['uid']) {
+                               $contact_id = $v['cid'];
+                               break;
+                       }
+               }
+       }
+
+       if($contact_id) {
                $groups = init_groups_visitor($contact_id);
                $r = q("SELECT * FROM `contact` WHERE `id` = %d AND `uid` = %d LIMIT 1",
                        intval($contact_id),
@@ -113,8 +123,9 @@ function display_content(&$a) {
                        );
                }
 
-
-               $o .= conversation($a,$r,'display', false);
+               $items = conv_sort($r,"`commented`");
+               
+               $o .= conversation($a,$items,'display', false);
 
        }
        else {