diff options
author | Friendika <info@friendika.com> | 2011-06-08 00:47:00 -0700 |
---|---|---|
committer | Friendika <info@friendika.com> | 2011-06-08 00:47:00 -0700 |
commit | a10abd4860ee2e34b197fd7c1bba295cd35c1a9b (patch) | |
tree | e6bc31e437e4f716f178a7bc05f8094ac1fb44a2 | |
parent | 0bfb6314dfd917ab5e1ab37a654821f9db22f7fb (diff) | |
download | volse-hubzilla-a10abd4860ee2e34b197fd7c1bba295cd35c1a9b.tar.gz volse-hubzilla-a10abd4860ee2e34b197fd7c1bba295cd35c1a9b.tar.bz2 volse-hubzilla-a10abd4860ee2e34b197fd7c1bba295cd35c1a9b.zip |
remove event if attached item is deleted
-rw-r--r-- | mod/item.php | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/mod/item.php b/mod/item.php index 2c8cf256c..d7c15ff02 100644 --- a/mod/item.php +++ b/mod/item.php @@ -772,6 +772,17 @@ function item_content(&$a) { // ignore the result } + // If item is a link to an event, nuke the event record. + + if(intval($item['event-id'])) { + q("DELETE FROM `event` WHERE `id` = %d AND `uid` = %d LIMIT 1", + intval($item['event-id']), + intval($item['uid']) + ); + // ignore the result + } + + // If it's the parent of a comment thread, kill all the kids if($item['uri'] == $item['parent-uri']) { |