X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;ds=sidebyside;f=mod%2Fdisplay.php;h=3215ae90a04958352fac8b7eb3e74298e731e7fa;hb=d72f248b3c0279cf8b8b525012fbf1572815e99e;hp=ec036de625b69caa04218401067c000b1a51fedb;hpb=a96da925712184eec97f6ca01072b7c2bee92a7e;p=friendica.git diff --git a/mod/display.php b/mod/display.php index ec036de625..3215ae90a0 100644 --- a/mod/display.php +++ b/mod/display.php @@ -5,8 +5,8 @@ function display_content(&$a) { $o = '
' . "\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']), @@ -173,6 +173,9 @@ function display_content(&$a) { $redirect_url = $a->get_baseurl() . '/redir/' . $item['cid'] ; + // I think this is redundant now but too chicken to remove it unless + // I've had six cups of coffee and tested it completely + if(($item['network'] === 'dfrn') && (! $item['self'] )) { $profile_url = $redirect_url; $sparkle = ' sparkle'; @@ -202,7 +205,7 @@ function display_content(&$a) { $template = $wallwall; $commentww = 'ww'; // If it is our contact, use a friendly redirect link - if(($item['owner-link'] == $item['url']) && ($item['network'] === 'dfrn')) { + if((link_compare($item['owner-link'],$item['url'])) && ($item['network'] === 'dfrn')) { $owner_url = $redirect_url; $osparkle = ' sparkle'; } @@ -211,12 +214,23 @@ function display_content(&$a) { } } - $diff_author = (($item['url'] !== $item['author-link']) ? true : false); + $diff_author = ((link_compare($item['url'],$item['author-link'])) ? false : true); $profile_name = (((strlen($item['author-name'])) && $diff_author) ? $item['author-name'] : $item['name']); $profile_avatar = (((strlen($item['author-avatar'])) && $diff_author) ? $item['author-avatar'] : $item['thumb']); - $profile_link = $profile_url; + // Can we use our special contact URL for this author? + + if(strlen($item['author-link'])) { + if((link_compare($item['author-link'],$item['url'])) && ($item['network'] === 'dfrn') && (! $item['self'])) { + $profile_link = $redirect_url; + $sparkle = ' sparkle'; + } + else { + $profile_link = $item['author-link']; + $sparkle = ''; + } + } if(($item['contact-id'] == remote_user()) || ($item['uid'] == local_user())) $drop = replace_macros(load_view_file('view/wall_item_drop.tpl'), array('$id' => $item['id'])); @@ -241,15 +255,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 +279,12 @@ function display_content(&$a) { '$comment' => $comment )); + $arr = array('item' => $item, 'output' => $tmp_item); + call_hooks('display_item', $arr); + + $o .= $arr['output']; + + } } else { @@ -284,6 +305,9 @@ function display_content(&$a) { } } + + $o .= '
' . t('Shared content is covered by the Creative Commons Attribution 3.0 license.') . '
'; + return $o; }