X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=mod%2Fdisplay.php;h=096ea16c9b7d432b3de449008866e7c8ddd0d482;hb=0d161c6ef60e4bcfe36f0a9b1e090955156a162a;hp=fd845e608ef6188148d0cd3fabcb59a5da0276c6;hpb=b211adfb1290913e11cc77bdd86b733b1f772519;p=friendica.git diff --git a/mod/display.php b/mod/display.php index fd845e608e..096ea16c9b 100644 --- a/mod/display.php +++ b/mod/display.php @@ -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']), @@ -127,6 +127,8 @@ function display_content(&$a) { like_puller($a,$item,$dlike,'dislike'); } + $author_contacts = extract_item_authors($r,$a->profile['uid']); + foreach($r as $item) { $template = $tpl; @@ -149,11 +151,17 @@ function display_content(&$a) { if(can_write_wall($a,$a->profile['uid'])) { if($item['id'] == $item['parent']) { - $likebuttons = replace_macros($like_tpl,array('$id' => $item['id'])); + $likebuttons = replace_macros($like_tpl,array( + '$id' => $item['id'], + '$likethis' => t("I like this \x28toggle\x29"), + '$nolike' => t("I don't like this \x28toggle\x29"), + '$wait' => t('Please wait') + )); } if($item['last-child']) { $comment = replace_macros($cmnt_tpl,array( - '$return_path' => $_SESSION['return_url'], + '$return_path' => '', + '$jsreload' => $_SESSION['return_url'], '$type' => 'wall-comment', '$id' => $item['item_id'], '$parent' => $item['parent'], @@ -171,14 +179,6 @@ function display_content(&$a) { $sparkle = ''; - $redirect_url = $a->get_baseurl() . '/redir/' . $item['cid'] ; - - if(($item['network'] === 'dfrn') && (! $item['self'] )) { - $profile_url = $redirect_url; - $sparkle = ' sparkle'; - } - - // Top-level wall post not written by the wall owner (wall-to-wall) // First figure out who owns it. @@ -202,7 +202,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,15 +211,27 @@ 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'])) { + $profile_link = $item['author-link']; + if(link_compare($item['author-link'],$item['url']) && ($item['network'] === 'dfrn') && (! $item['self'])) { + $profile_link = $redirect_url; + $sparkle = ' sparkle'; + } + elseif(isset($author_contacts[$item['author-link']])) { + $profile_link = $a->get_baseurl() . '/redir/' . $author_contacts[$item['author-link']]; + $sparkle = ' 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'])); + $drop = replace_macros(load_view_file('view/wall_item_drop.tpl'), array('$id' => $item['id'], '$delete' => t('Delete'))); else $drop = replace_macros(load_view_file('view/wall_fake_drop.tpl'), array('$id' => $item['id'])); @@ -243,6 +255,11 @@ function display_content(&$a) { $tmp_item = replace_macros($template,array( '$id' => $item['item_id'], + '$linktitle' => t('View $name\'s profile'), + '$olinktitle' => t('View $owner_name\'s profile'), + '$to' => t('to'), + '$wall' => t('Wall-to-Wall'), + '$vwall' => t('via Wall-To-Wall:'), '$profile_url' => $profile_link, '$name' => $profile_name, '$sparkle' => $sparkle, @@ -257,6 +274,7 @@ function display_content(&$a) { '$owner_url' => $owner_url, '$owner_photo' => $owner_photo, '$owner_name' => $owner_name, + '$plink' => get_plink($item), '$drop' => $drop, '$vote' => $likebuttons, '$like' => $like, @@ -290,6 +308,9 @@ function display_content(&$a) { } } + + $o .= '
' . t('Shared content is covered by the Creative Commons Attribution 3.0 license.') . '
'; + return $o; }