]> git.mxchange.org Git - friendica.git/blobdiff - include/text.php
When showing posts for a contact we have to tread forums in a special way
[friendica.git] / include / text.php
index cd271676cf45d69e12aa7701b8aefd3fce7de867..66d4f17ea66ac5b20ef9c486f207d23dfa65e68a 100644 (file)
@@ -1,6 +1,7 @@
 <?php
 
 use Friendica\App;
+use Friendica\Core\System;
 
 require_once "include/template_processor.php";
 require_once "include/friendica_smarty.php";
@@ -24,7 +25,7 @@ function replace_macros($s, $r) {
        $a = get_app();
 
        // pass $baseurl to all templates
-       $r['$baseurl'] = App::get_baseurl();
+       $r['$baseurl'] = System::baseUrl();
 
        $t = $a->template_engine();
        try {
@@ -747,7 +748,7 @@ function logger($msg, $level = 0) {
 
        $callers = debug_backtrace();
        $logline = sprintf("%s@%s\t[%s]:%s:%s:%s\t%s\n",
-                       datetime_convert(),
+                       datetime_convert('UTC', 'UTC', 'now', 'Y-m-d\TH:i:s\Z'),
                        $process_id,
                        $LOGGER_LEVELS[$level],
                        basename($callers[0]['file']),
@@ -1311,7 +1312,7 @@ function prepare_body(&$item, $attach = false, $preview = false) {
        $a = get_app();
        call_hooks('prepare_body_init', $item);
 
-       $searchpath = z_root() . "/search?tag=";
+       $searchpath = System::baseUrl() . "/search?tag=";
 
        $tags = array();
        $hashtags = array();
@@ -1330,11 +1331,10 @@ function prepare_body(&$item, $attach = false, $preview = false) {
 
                        $tag["url"] = best_link_url($item, $sp, $tag["url"]);
 
-                       if ($orig_tag != $tag["url"]) {
-                               $item['body'] = str_replace($orig_tag, $tag["url"], $item['body']);
-                       }
-
                        if ($tag["type"] == TERM_HASHTAG) {
+                               if ($orig_tag != $tag["url"]) {
+                                       $item['body'] = str_replace($orig_tag, $tag["url"], $item['body']);
+                               }
                                $hashtags[] = "#<a href=\"".$tag["url"]."\" target=\"_blank\">".$tag["term"]."</a>";
                                $prefix = "#";
                        } elseif ($tag["type"] == TERM_MENTION) {
@@ -1394,10 +1394,10 @@ function prepare_body(&$item, $attach = false, $preview = false) {
                                                if (!$vhead) {
                                                        $vhead = true;
                                                        $a->page['htmlhead'] .= replace_macros(get_markup_template('videos_head.tpl'), array(
-                                                               '$baseurl' => z_root(),
+                                                               '$baseurl' => System::baseUrl(),
                                                        ));
                                                        $a->page['end'] .= replace_macros(get_markup_template('videos_end.tpl'), array(
-                                                               '$baseurl' => z_root(),
+                                                               '$baseurl' => System::baseUrl(),
                                                        ));
                                                }
 
@@ -1424,14 +1424,8 @@ function prepare_body(&$item, $attach = false, $preview = false) {
                                        $title = ((strlen(trim($mtch[4]))) ? escape_tags(trim($mtch[4])) : escape_tags($mtch[1]));
                                        $title .= ' ' . $mtch[2] . ' ' . t('bytes');
 
-                                       if (($filetype == 'image') AND ($item['network'] == NETWORK_OSTATUS)) {
-                                               $icon = '<img class="attached" src="'.$the_url.'" alt="" title="'.$title.'">';
-                                               $s .= '<br><a href="' . strip_tags($the_url) . '" title="' . $title . '" class="attached" target="_blank" >' . $icon . '</a>';
-                                       } else {
-                                               $icon = '<div class="attachtype icon s22 type-' . $filetype . ' subtype-' . $filesubtype . '"></div>';
-                                               $as .= '<a href="' . strip_tags($the_url) . '" title="' . $title . '" class="attachlink" target="_blank" >' . $icon . '</a>';
-                                       }
-
+                                       $icon = '<div class="attachtype icon s22 type-' . $filetype . ' subtype-' . $filesubtype . '"></div>';
+                                       $as .= '<a href="' . strip_tags($the_url) . '" title="' . $title . '" class="attachlink" target="_blank" >' . $icon . '</a>';
                                }
                        }
                }