]> git.mxchange.org Git - friendica.git/blobdiff - include/items.php
Replace disapora2bb function content with Markdown::toBBCode call
[friendica.git] / include / items.php
index f1c895f90fece19a2aac720a9d5fa1835c8b4b0b..31c8aaa799394dacdfaec90795523c63b325e989 100644 (file)
@@ -17,15 +17,13 @@ use Friendica\Protocol\OStatus;
 use Friendica\Util\DateTimeFormat;
 use Friendica\Util\Network;
 use Friendica\Util\ParseUrl;
+use Friendica\Util\Temporal;
 
-require_once 'include/bbcode.php';
-require_once 'include/tags.php';
 require_once 'include/text.php';
-require_once 'include/threads.php';
 require_once 'mod/share.php';
 require_once 'include/enotify.php';
 
-function add_page_info_data($data) {
+function add_page_info_data($data, $no_photos = false) {
        Addon::callHooks('page_info_data', $data);
 
        // It maybe is a rich content, but if it does have everything that a link has,
@@ -93,7 +91,7 @@ function add_page_info_data($data) {
        return "\n".$text.$hashtags;
 }
 
-function query_page_info($url, $no_photos = false, $photo = "", $keywords = false, $keyword_blacklist = "") {
+function query_page_info($url, $photo = "", $keywords = false, $keyword_blacklist = "") {
 
        $data = ParseUrl::getSiteinfoCached($url, true);
 
@@ -121,8 +119,8 @@ function query_page_info($url, $no_photos = false, $photo = "", $keywords = fals
        return $data;
 }
 
-function add_page_keywords($url, $no_photos = false, $photo = "", $keywords = false, $keyword_blacklist = "") {
-       $data = query_page_info($url, $no_photos, $photo, $keywords, $keyword_blacklist);
+function add_page_keywords($url, $photo = "", $keywords = false, $keyword_blacklist = "") {
+       $data = query_page_info($url, $photo, $keywords, $keyword_blacklist);
 
        $tags = "";
        if (isset($data["keywords"]) && count($data["keywords"])) {
@@ -142,9 +140,9 @@ function add_page_keywords($url, $no_photos = false, $photo = "", $keywords = fa
 }
 
 function add_page_info($url, $no_photos = false, $photo = "", $keywords = false, $keyword_blacklist = "") {
-       $data = query_page_info($url, $no_photos, $photo, $keywords, $keyword_blacklist);
+       $data = query_page_info($url, $photo, $keywords, $keyword_blacklist);
 
-       $text = add_page_info_data($data);
+       $text = add_page_info_data($data, $no_photos);
 
        return $text;
 }
@@ -323,7 +321,7 @@ function drop_items($items) {
 
        if (count($items)) {
                foreach ($items as $item) {
-                       $owner = Item::delete($item);
+                       $owner = Item::deleteById($item);
                        if ($owner && !$uid)
                                $uid = $owner;
                }
@@ -395,7 +393,7 @@ function drop_item($id) {
                }
 
                // delete the item
-               Item::delete($item['id']);
+               Item::deleteById($item['id']);
 
                goaway(System::baseUrl() . '/' . $_SESSION['return_url']);
                //NOTREACHED
@@ -428,7 +426,7 @@ function list_post_dates($uid, $wall) {
        while (substr($dnow, 0, 7) >= substr($dthen, 0, 7)) {
                $dyear = intval(substr($dnow, 0, 4));
                $dstart = substr($dnow, 0, 8) . '01';
-               $dend = substr($dnow, 0, 8) . get_dim(intval($dnow), intval(substr($dnow, 5)));
+               $dend = substr($dnow, 0, 8) . Temporal::getDaysInMonth(intval($dnow), intval(substr($dnow, 5)));
                $start_month = DateTimeFormat::utc($dstart, 'Y-m-d');
                $end_month = DateTimeFormat::utc($dend, 'Y-m-d');
                $str = day_translate(DateTimeFormat::utc($dnow, 'F'));