aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFriendika <info@friendika.com>2011-06-23 18:56:24 -0700
committerFriendika <info@friendika.com>2011-06-23 18:56:24 -0700
commit8ffcd4323b883b66d9249c9742fb26a5c5f91605 (patch)
treeb5451fcbbd458e0ebda542be8edc83aeaaf809c8
parenta15bd91d1733e8198169a1a492f0268691b7152a (diff)
downloadvolse-hubzilla-8ffcd4323b883b66d9249c9742fb26a5c5f91605.tar.gz
volse-hubzilla-8ffcd4323b883b66d9249c9742fb26a5c5f91605.tar.bz2
volse-hubzilla-8ffcd4323b883b66d9249c9742fb26a5c5f91605.zip
never enough comments
-rw-r--r--include/event.php10
1 files changed, 9 insertions, 1 deletions
diff --git a/include/event.php b/include/event.php
index f79266e33..1032022b3 100644
--- a/include/event.php
+++ b/include/event.php
@@ -212,6 +212,8 @@ function event_store($arr) {
$contact = $c[0];
+ // Existing event being modified
+
if($arr['id']) {
// has the event actually changed?
@@ -221,6 +223,9 @@ function event_store($arr) {
intval($arr['uid'])
);
if((! count($r)) || ($r[0]['edited'] === $arr['edited'])) {
+
+ // Nothing has changed. Grab the item id to return.
+
$r = q("SELECT * FROM `item` WHERE `event-id` = %d AND `uid` = %d LIMIT 1",
intval($arr['id']),
intval($arr['uid'])
@@ -228,6 +233,7 @@ function event_store($arr) {
return((count($r)) ? $r[0]['id'] : 0);
}
+ // The event changed. Update it.
$r = q("UPDATE `event` SET
`edited` = '%s',
@@ -276,7 +282,7 @@ function event_store($arr) {
dbesc($arr['allow_gid']),
dbesc($arr['deny_cid']),
dbesc($arr['deny_gid']),
- dbesc(datetime_convert()),
+ dbesc($arr['edited']),
intval($r[0]['id']),
intval($arr['uid'])
);
@@ -288,6 +294,8 @@ function event_store($arr) {
}
else {
+ // New event. Store it.
+
$r = q("INSERT INTO `event` ( `uid`,`cid`,`uri`,`created`,`edited`,`start`,`finish`,`desc`,`location`,`type`,
`adjust`,`nofinish`,`allow_cid`,`allow_gid`,`deny_cid`,`deny_gid`)
VALUES ( %d, %d, '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', %d, %d, '%s', '%s', '%s', '%s' ) ",