]> git.mxchange.org Git - friendica.git/blobdiff - mod/display.php
bug #70 - error messages on group deletion, warning cleanup
[friendica.git] / mod / display.php
index fb69523e91b095d7485edf74c714ce8b368b43fa..fdb93e480cc3676f8487dfa899edda6ad9d72d8f 100644 (file)
@@ -3,6 +3,16 @@
 
 function display_content(&$a) {
 
+       if((get_config('system','block_public')) && (! local_user()) && (! remote_user())) {
+               notice( t('Public access denied.') . EOL);
+               return;
+       }
+
+       require_once("include/bbcode.php");
+       require_once('include/security.php');
+       require_once('include/conversation.php');
+
+
        $o = '<div id="live-display"></div>' . "\r\n";
 
        $nick = (($a->argc > 1) ? $a->argv[1] : '');
@@ -16,8 +26,6 @@ function display_content(&$a) {
                return;
        }
 
-       require_once("include/bbcode.php");
-       require_once('include/security.php');
 
 
        $groups = array();
@@ -45,6 +53,11 @@ function display_content(&$a) {
                }
        }
 
+       $r = q("SELECT * FROM `contact` WHERE `uid` = %d AND `self` = 1 LIMIT 1",
+               intval($a->profile['uid'])
+       );
+       if(count($r))
+               $a->page_contact = $r[0];
 
        $sql_extra = "
                AND `allow_cid` = '' 
@@ -85,7 +98,7 @@ function display_content(&$a) {
 
        $r = q("SELECT `item`.*, `item`.`id` AS `item_id`, 
                `contact`.`name`, `contact`.`photo`, `contact`.`url`, `contact`.`rel`,
-               `contact`.`network`, `contact`.`thumb`, `contact`.`self`, 
+               `contact`.`network`, `contact`.`thumb`, `contact`.`self`, `contact`.`writable`, 
                `contact`.`id` AS `cid`, `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
@@ -108,7 +121,6 @@ function display_content(&$a) {
                        );
                }
 
-               require_once('include/conversation.php');
 
                $o .= conversation($a,$r,'display', false);