X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=include%2Fevent.php;h=1c34e03cc686e7f0e2e8e15d9a58adf57aa8413a;hb=716747cc774fd4507700e848c5a1bde88de571f0;hp=30ba1cfde26b8a7c00bff69287ad812cfc14edc6;hpb=f02029240876703aeaa0dec9e60ff232253ad22c;p=friendica.git
diff --git a/include/event.php b/include/event.php
index 30ba1cfde2..1c34e03cc6 100644
--- a/include/event.php
+++ b/include/event.php
@@ -5,6 +5,7 @@
*/
use Friendica\Content\Feature;
+use Friendica\Content\Text\BBCode;
use Friendica\Core\Addon;
use Friendica\Core\L10n;
use Friendica\Core\PConfig;
@@ -15,7 +16,6 @@ use Friendica\Model\Profile;
use Friendica\Util\DateTimeFormat;
use Friendica\Util\Map;
-require_once 'include/bbcode.php';
require_once 'include/conversation.php';
function format_event_html($ev, $simple = false) {
@@ -38,9 +38,9 @@ function format_event_html($ev, $simple = false) {
);
if ($simple) {
- $o = "
" . bbcode($ev['summary']) . "
";
+ $o = "" . BBCode::convert($ev['summary']) . "
";
- $o .= "" . bbcode($ev['desc']) . "
";
+ $o .= "" . BBCode::convert($ev['desc']) . "
";
$o .= "" . L10n::t('Starts:') . "
" . $event_start . "
";
@@ -57,7 +57,7 @@ function format_event_html($ev, $simple = false) {
$o = '' . "\r\n";
- $o .= '
' . bbcode($ev['summary']) . '
' . "\r\n";
+ $o .= '
' . BBCode::convert($ev['summary']) . '
' . "\r\n";
$o .= '
' . L10n::t('Starts:') . ' ' . "\r\n";
+ $o .= '' . BBCode::convert($ev['desc']) . '
' . "\r\n";
if (strlen($ev['location'])) {
$o .= '' . L10n::t('Location:') . ' '
- . bbcode($ev['location'])
+ . BBCode::convert($ev['location'])
. '
' . "\r\n";
// Include a map of the location if the [map] BBCode is used.
@@ -238,7 +238,6 @@ function event_delete($event_id) {
function event_store($arr) {
require_once 'include/items.php';
- require_once 'include/bbcode.php';
$a = get_app();
@@ -318,13 +317,8 @@ function event_store($arr) {
$object .= '' . xmlify(format_event_bbcode($arr)) . '';
$object .= '' . "\n";
- q("UPDATE `item` SET `body` = '%s', `object` = '%s', `edited` = '%s' WHERE `id` = %d AND `uid` = %d",
- dbesc(format_event_bbcode($arr)),
- dbesc($object),
- dbesc($arr['edited']),
- intval($r[0]['id']),
- intval($arr['uid'])
- );
+ $fields = ['body' => format_event_bbcode($arr), 'object' => $object, 'edited' => $arr['edited']];
+ Item::update($fields, ['id' => $r[0]['id']]);
$item_id = $r[0]['id'];
} else {
@@ -402,11 +396,7 @@ function event_store($arr) {
$item_id = Item::insert($item_arr);
if ($item_id) {
- q("UPDATE `item` SET `event-id` = %d WHERE `uid` = %d AND `id` = %d",
- intval($event['id']),
- intval($arr['uid']),
- intval($item_id)
- );
+ Item::update(['event-id' => $event['id']], ['id' => $item_id]);
}
Addon::callHooks("event_created", $event['id']);
@@ -619,15 +609,15 @@ function process_events($arr) {
$drop = [System::baseUrl() . '/events/drop/' . $rr['id'], L10n::t('Delete event'), '', ''];
}
- $title = strip_tags(html_entity_decode(bbcode($rr['summary']), ENT_QUOTES, 'UTF-8'));
+ $title = strip_tags(html_entity_decode(BBCode::convert($rr['summary']), ENT_QUOTES, 'UTF-8'));
if (! $title) {
- list($title, $_trash) = explode("
$rr['id'],
'start' => $start,