aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSimon <simon@kisikew.org>2012-05-29 13:10:52 -0700
committerSimon <simon@kisikew.org>2012-05-29 13:10:52 -0700
commit39927e3dc5d0fc942ef9428b5c5c0d9b8cbb2f56 (patch)
tree5032e7466a5f9571d98e0d433750c596d58f8ce8
parentd5cc81d2174db88d05ae6efea06e69f4c6f5e835 (diff)
parentdfef0ec84d7b62445835ceed094a582d66b900ed (diff)
downloadvolse-hubzilla-39927e3dc5d0fc942ef9428b5c5c0d9b8cbb2f56.tar.gz
volse-hubzilla-39927e3dc5d0fc942ef9428b5c5c0d9b8cbb2f56.tar.bz2
volse-hubzilla-39927e3dc5d0fc942ef9428b5c5c0d9b8cbb2f56.zip
Merge pull request #317 from CatoTH/master
Events: additional hooks, and a bugfix
-rw-r--r--include/event.php17
1 files changed, 11 insertions, 6 deletions
diff --git a/include/event.php b/include/event.php
index 29202badd..866ae8c3f 100644
--- a/include/event.php
+++ b/include/event.php
@@ -42,7 +42,7 @@ function format_event_html($ev) {
return $o;
}
-
+/*
function parse_event($h) {
require_once('include/Scrape.php');
@@ -108,7 +108,7 @@ function parse_event($h) {
return $ret;
}
-
+*/
function format_event_bbcode($ev) {
@@ -162,7 +162,6 @@ function bbtoevent($s) {
$match = '';
if(preg_match("/\[event\-adjust\](.*?)\[\/event\-adjust\]/is",$s,$match))
$ev['adjust'] = $match[1];
- $match = '';
$ev['nofinish'] = (((x($ev, 'start') && $ev['start']) && (!x($ev, 'finish') || !$ev['finish'])) ? 1 : 0);
return $ev;
@@ -294,10 +293,14 @@ function event_store($arr) {
intval($arr['uid'])
);
- return $r[0]['id'];
+ $item_id = $r[0]['id'];
}
else
- return 0;
+ $item_id = 0;
+
+ call_hooks("event_updated", $arr['id']);
+
+ return $item_id;
}
else {
@@ -361,7 +364,7 @@ function event_store($arr) {
$item_arr['body'] = format_event_bbcode($event);
- $item_arr['object'] = '<object><type>' . xmlify(ACTIVITY_OBJ_EVENT) . '</type><title></title><id>' . xmlify($uri) . '</id>';
+ $item_arr['object'] = '<object><type>' . xmlify(ACTIVITY_OBJ_EVENT) . '</type><title></title><id>' . xmlify($arr['uri']) . '</id>';
$item_arr['object'] .= '<content>' . xmlify(format_event_bbcode($event)) . '</content>';
$item_arr['object'] .= '</object>' . "\n";
@@ -383,6 +386,8 @@ function event_store($arr) {
);
}
+ call_hooks("event_created", $event['id']);
+
return $item_id;
}
}