]> git.mxchange.org Git - friendica.git/blobdiff - include/bb2diaspora.php
Split the name in the hcard
[friendica.git] / include / bb2diaspora.php
index a07a583538e4ac5e88b1613ff765c50837c83846..e1a67d432d261600cae885ed2185b422275288cd 100644 (file)
@@ -1,12 +1,17 @@
 <?php
 
+use Friendica\App;
+use Friendica\Core\System;
+use Friendica\Model\Contact;
+use Friendica\Network\Probe;
+
 use League\HTMLToMarkdown\HtmlConverter;
 
-require_once "include/oembed.php";
-require_once "include/event.php";
-require_once "library/markdown.php";
-require_once "include/html2bbcode.php";
-require_once "include/bbcode.php";
+require_once 'include/oembed.php';
+require_once 'include/event.php';
+require_once 'library/markdown.php';
+require_once 'include/html2bbcode.php';
+require_once 'include/bbcode.php';
 
 /**
  * @brief Callback function to replace a Diaspora style mention in a mention for Friendica
@@ -19,7 +24,7 @@ function diaspora_mention2bb($match) {
                return;
        }
 
-       $data = get_contact_details_by_addr($match[2]);
+       $data = Contact::getDetailsByAddr($match[2]);
 
        $name = $match[1];
 
@@ -92,7 +97,7 @@ function diaspora2bb($s) {
  */
 function diaspora_mentions($match) {
 
-       $contact = get_contact_details_by_url($match[3]);
+       $contact = Contact::getDetailsByURL($match[3]);
 
        if (!x($contact, 'addr')) {
                $contact = Probe::uri($match[3]);
@@ -185,7 +190,7 @@ function bb2diaspora($Text, $preserve_nl = false, $fordiaspora = true) {
        $Text = $converter->convert($Text);
 
        // unmask the special chars back to HTML
-       $Text = str_replace(array('&_lt_;', '&_gt_;', '&_amp_;'), array('&lt;', '&gt;', '&amp;'), $Text);
+       $Text = str_replace(array('&\_lt\_;', '&\_gt\_;', '&\_amp\_;'), array('&lt;', '&gt;', '&amp;'), $Text);
 
        $a->save_timestamp($stamp1, "parser");
 
@@ -238,7 +243,7 @@ function format_event_diaspora($ev) {
                        $ev['start'] , $bd_format ))
                        :  day_translate(datetime_convert('UTC', 'UTC',
                        $ev['start'] , $bd_format)))
-               .  '](' . App::get_baseurl() . '/localtime/?f=&time=' . urlencode(datetime_convert('UTC','UTC',$ev['start'])) . ")\n";
+               .  '](' . System::baseUrl() . '/localtime/?f=&time=' . urlencode(datetime_convert('UTC','UTC',$ev['start'])) . ")\n";
 
        if (! $ev['nofinish']) {
                $o .= t('Finishes:') . ' ' . '['
@@ -246,7 +251,7 @@ function format_event_diaspora($ev) {
                                $ev['finish'] , $bd_format ))
                                :  day_translate(datetime_convert('UTC', 'UTC',
                                $ev['finish'] , $bd_format )))
-                       . '](' . App::get_baseurl() . '/localtime/?f=&time=' . urlencode(datetime_convert('UTC','UTC',$ev['finish'])) . ")\n";
+                       . '](' . System::baseUrl() . '/localtime/?f=&time=' . urlencode(datetime_convert('UTC','UTC',$ev['finish'])) . ")\n";
        }
 
        if (strlen($ev['location'])) {