]> git.mxchange.org Git - friendica.git/blobdiff - mod/display.php
undo sql change in f9f018ef083acb554003 (02-DEC-2010), not relevant and incorrect
[friendica.git] / mod / display.php
index 92034d9ae9a91e243fbb0a3e858a1e22074e59e7..0e5768838f74c3f147e3ef4a30c68985ea245244 100644 (file)
@@ -5,8 +5,8 @@ function display_content(&$a) {
 
        $o = '<div id="live-display"></div>' . "\r\n";
 
-       require_once('mod/profile.php');
-       profile_init($a);
+       $nick = (($a->argc > 1) ? $a->argv[1] : '');
+       profile_load($a,$nick);
 
        $item_id = (($a->argc > 2) ? intval($a->argv[2]) : 0);
 
@@ -93,7 +93,7 @@ function display_content(&$a) {
                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`.`parent` = ( SELECT `parent` FROM `item` WHERE ( `id` = '%s' OR `uri` = '%s' ) AND `type` != 'remote' )
+               AND `item`.`parent` = ( SELECT `parent` FROM `item` WHERE ( `id` = '%s' OR `uri` = '%s' ))
                $sql_extra
                ORDER BY `parent` DESC, `gravity` ASC, `id` ASC ",
                intval($a->profile['uid']),
@@ -142,8 +142,8 @@ function display_content(&$a) {
                                && ($item['id'] != $item['parent']))
                                continue;
 
-                       $lock = (($item['uid'] == local_user()) && (strlen($item['allow_cid']) || strlen($item['allow_gid']) 
-                               || strlen($item['deny_cid']) || strlen($item['deny_gid']))
+                       $lock = ((($item['private']) || (($item['uid'] == local_user()) && (strlen($item['allow_cid']) || strlen($item['allow_gid']) 
+                               || strlen($item['deny_cid']) || strlen($item['deny_gid']))))
                                ? '<div class="wall-item-lock"><img src="images/lock_icon.gif" class="lockview" alt="' . t('Private Message') . '" onclick="lockview(event,' . $item['id'] . ');" /></div>'
                                : '<div class="wall-item-lock"></div>');
 
@@ -241,15 +241,16 @@ function display_content(&$a) {
                                $indent .= ' shiny'; 
 
 
-                       $o .= replace_macros($template,array(
+                       $tmp_item = replace_macros($template,array(
                                '$id' => $item['item_id'],
+                               '$title' => t('View $name\'s profile'),
                                '$profile_url' => $profile_link,
                                '$name' => $profile_name,
                                '$sparkle' => $sparkle,
                                '$osparkle' => $osparkle,
                                '$thumb' => $profile_avatar,
                                '$title' => $item['title'],
-                               '$body' => bbcode($item['body']),
+                               '$body' => smilies(bbcode($item['body'])),
                                '$ago' => relative_date($item['created']),
                                '$lock' => $lock,
                                '$location' => $location,
@@ -264,6 +265,12 @@ function display_content(&$a) {
                                '$comment' => $comment
                        ));
 
+                       $arr = array('item' => $item, 'output' => $tmp_item);
+                       call_hooks('display_item', $arr);
+
+                       $o .= $arr['output'];
+
+
                }
        }
        else {