]> git.mxchange.org Git - friendica.git/blobdiff - mod/display.php
Bump DB version
[friendica.git] / mod / display.php
index 6ebe16ae8ad7817e23869941f202c4b828b2b9fa..1f1fd112048f63e31077448ebde723341f39bdf9 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 
-function display_init(&$a) {
+function display_init(App $a) {
 
        if ((get_config('system','block_public')) && (! local_user()) && (! remote_user())) {
                return;
@@ -194,7 +194,7 @@ function display_fetchauthor($a, $item) {
        return($profiledata);
 }
 
-function display_content(&$a, $update = 0) {
+function display_content(App $a, $update = 0) {
 
        if ((get_config('system','block_public')) && (! local_user()) && (! remote_user())) {
                notice(t('Public access denied.') . EOL);
@@ -420,11 +420,17 @@ function display_content(&$a, $update = 0) {
                $title = trim(html2plain(bbcode($r[0]["title"], false, false), 0, true));
                $author_name = $r[0]["author-name"];
 
-               $image = $a->remove_baseurl($r[0]["thumb"]);
+               $image = $a->remove_baseurl($r[0]["author-thumb"]);
 
                if ($title == "") {
                        $title = $author_name;
                }
+
+               // Limit the description to 160 characters
+               if (strlen($description) > 160) {
+                       $description = substr($description, 0, 157) . '...';
+               }
+
                $description = htmlspecialchars($description, ENT_COMPAT, 'UTF-8', true); // allow double encoding here
                $title = htmlspecialchars($title, ENT_COMPAT, 'UTF-8', true); // allow double encoding here
                $author_name = htmlspecialchars($author_name, ENT_COMPAT, 'UTF-8', true); // allow double encoding here