]> git.mxchange.org Git - friendica.git/blobdiff - include/event.php
Merge remote-tracking branch 'upstream/develop' into develop
[friendica.git] / include / event.php
index 3a41dad4e70dd5b66b3f51cc964f62b8271b3e5e..a1ff9bb3364dbb735cadcf275855d21fa7dd59dd 100644 (file)
@@ -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) {