*/
use Friendica\App;
+use Friendica\Content\Feature;
+use Friendica\Core\PConfig;
use Friendica\Core\System;
+use Friendica\Database\DBM;
require_once 'include/bbcode.php';
require_once 'include/map.php';
require_once 'include/datetime.php';
+require_once "include/conversation.php";
function format_event_html($ev, $simple = false) {
if (! ((is_array($ev)) && count($ev))) {
return;
}
- q("DELETE FROM `event` WHERE `id` = %d", intval($event_id));
+ dba::delete('event', array('id' => $event_id));
logger("Deleted event ".$event_id, LOGGER_DEBUG);
}
);
}
- if (dbm::is_result($c)) {
+ if (DBM::is_result($c)) {
$contact = $c[0];
}
intval($arr['id']),
intval($arr['uid'])
);
- if ((! dbm::is_result($r)) || ($r[0]['edited'] === $arr['edited'])) {
+ if ((! DBM::is_result($r)) || ($r[0]['edited'] === $arr['edited'])) {
// Nothing has changed. Grab the item id to return.
intval($arr['id']),
intval($arr['uid'])
);
- return ((dbm::is_result($r)) ? $r[0]['id'] : 0);
+ return ((DBM::is_result($r)) ? $r[0]['id'] : 0);
}
// The event changed. Update it.
intval($arr['id']),
intval($arr['uid'])
);
- if (dbm::is_result($r)) {
+ if (DBM::is_result($r)) {
$object = '<object><type>' . xmlify(ACTIVITY_OBJ_EVENT) . '</type><title></title><id>' . xmlify($arr['uri']) . '</id>';
$object .= '<content>' . xmlify(format_event_bbcode($arr)) . '</content>';
$object .= '</object>' . "\n";
dbesc($arr['uri']),
intval($arr['uid'])
);
- if (dbm::is_result($r)) {
+ if (DBM::is_result($r)) {
$event = $r[0];
}
$r = q("SELECT * FROM `user` WHERE `uid` = %d LIMIT 1",
intval($arr['uid'])
);
- //if (dbm::is_result($r))
+ //if (DBM::is_result($r))
// $plink = System::baseUrl() . '/display/' . $r[0]['nickname'] . '/' . $item_id;
function get_event_strings() {
// First day of the week (0 = Sunday).
- $firstDay = get_pconfig(local_user(), 'system', 'first_day_of_week');
- if ($firstDay === false) {
- $firstDay = 0;
- }
+ $firstDay = PConfig::get(local_user(), 'system', 'first_day_of_week', 0);
$i18n = array(
"firstDay" => $firstDay,
intval($event_params["event_id"])
);
- if (dbm::is_result($r)) {
+ if (DBM::is_result($r)) {
return event_remove_duplicates($r);
}
}
dbesc($event_params["adjust_finish"])
);
- if (dbm::is_result($r)) {
+ if (DBM::is_result($r)) {
return event_remove_duplicates($r);
}
}
);
}
- if (dbm::is_result($r)) {
+ if (DBM::is_result($r)) {
return $r;
}
}
// We are allowed to show events.
// Get the timezone the user is in.
$r = q("SELECT `timezone` FROM `user` WHERE `uid` = %d LIMIT 1", intval($uid));
- if (dbm::is_result($r)) {
+ if (DBM::is_result($r)) {
$timezone = $r[0]['timezone'];
}
* for exporting the cal is enabled (otherwise the widget would appear for logged in users
* on foreigen profile pages even if the widget is disabled).
*/
- if (intval($owner_uid) && local_user() !== $owner_uid && ! feature_enabled($owner_uid, "export_calendar")) {
+ if (intval($owner_uid) && local_user() !== $owner_uid && ! Feature::isEnabled($owner_uid, "export_calendar")) {
return;
}
* If it's a kind of profile page (intval($owner_uid)) return if the user not logged in and
* export feature isn't enabled.
*/
- if (intval($owner_uid) && ! local_user() && ! feature_enabled($owner_uid, "export_calendar")) {
+ if (intval($owner_uid) && ! local_user() && ! Feature::isEnabled($owner_uid, "export_calendar")) {
return;
}