X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=include%2Fevent.php;h=a1ff9bb3364dbb735cadcf275855d21fa7dd59dd;hb=4f25396faeaa501907e93b24ee51ebdd08f84993;hp=3a41dad4e70dd5b66b3f51cc964f62b8271b3e5e;hpb=23d4db5149b0c30f09342428a0693a3ae877caca;p=friendica.git diff --git a/include/event.php b/include/event.php index 3a41dad4e7..a1ff9bb336 100644 --- a/include/event.php +++ b/include/event.php @@ -206,7 +206,7 @@ function bbtoevent($s) { } -function sort_by_date($a) { +function sort_by_date(App &$a) { usort($a,'ev_compare'); return $a; @@ -246,6 +246,7 @@ function event_store($arr) { $arr['cid'] = ((intval($arr['cid'])) ? intval($arr['cid']) : 0); $arr['uri'] = (x($arr,'uri') ? $arr['uri'] : item_new_uri($a->get_hostname(),$arr['uid'])); $arr['private'] = ((x($arr,'private')) ? intval($arr['private']) : 0); + $arr['guid'] = get_guid(32); if($arr['cid']) $c = q("SELECT * FROM `contact` WHERE `id` = %d AND `uid` = %d LIMIT 1", @@ -333,16 +334,16 @@ function event_store($arr) { call_hooks("event_updated", $arr['id']); return $item_id; - } - else { + } else { // New event. Store it. - $r = q("INSERT INTO `event` ( `uid`,`cid`,`uri`,`created`,`edited`,`start`,`finish`,`summary`, `desc`,`location`,`type`, + $r = q("INSERT INTO `event` (`uid`,`cid`,`guid`,`uri`,`created`,`edited`,`start`,`finish`,`summary`, `desc`,`location`,`type`, `adjust`,`nofinish`,`allow_cid`,`allow_gid`,`deny_cid`,`deny_gid`) - VALUES ( %d, %d, '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', %d, %d, '%s', '%s', '%s', '%s' ) ", + VALUES ( %d, %d, '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', %d, %d, '%s', '%s', '%s', '%s' ) ", intval($arr['uid']), intval($arr['cid']), + dbesc($arr['guid']), dbesc($arr['uri']), dbesc($arr['created']), dbesc($arr['edited']), @@ -408,7 +409,7 @@ function event_store($arr) { intval($arr['uid']) ); //if (dbm::is_result($r)) - // $plink = $a->get_baseurl() . '/display/' . $r[0]['nickname'] . '/' . $item_id; + // $plink = App::get_baseurl() . '/display/' . $r[0]['nickname'] . '/' . $item_id; if($item_id) {