aboutsummaryrefslogtreecommitdiffstats
path: root/mod/addtocal.php
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2014-05-29 21:25:19 -0700
committerfriendica <info@friendica.com>2014-05-29 21:25:19 -0700
commit832cbbec15ae2abbd04d775e4cfb056e797722f1 (patch)
tree157792443a0eb07be3cbeb4e805d0e18ba17df53 /mod/addtocal.php
parent22ed5b1d03314d2bc7ff41b4724526fe00472904 (diff)
downloadvolse-hubzilla-832cbbec15ae2abbd04d775e4cfb056e797722f1.tar.gz
volse-hubzilla-832cbbec15ae2abbd04d775e4cfb056e797722f1.tar.bz2
volse-hubzilla-832cbbec15ae2abbd04d775e4cfb056e797722f1.zip
testing new event code
Diffstat (limited to 'mod/addtocal.php')
-rw-r--r--mod/addtocal.php56
1 files changed, 0 insertions, 56 deletions
diff --git a/mod/addtocal.php b/mod/addtocal.php
deleted file mode 100644
index 7789e0ede..000000000
--- a/mod/addtocal.php
+++ /dev/null
@@ -1,56 +0,0 @@
-<?php /** @file */
-
-
-function addtocal_init(&$a) {
-
- if(! local_user())
- return;
-
- if(argc() > 1) {
- $post_id = intval(argv(1));
-
- $r = q("select * from item where id = %d and uid = %d limit 1",
- intval($post_id),
- intval(local_user())
- );
-
- if(! $r)
- return;
- }
-
- $arr = $r[0];
- $channel = $a->get_channel();
-
- if(! $channel)
- return;
-
- // for events, extract the event info and create an event linked to an item
-
- if((x($arr,'obj_type')) && (activity_match($arr['obj_type'],ACTIVITY_OBJ_EVENT))) {
-
- require_once('include/event.php');
- $ev = bbtoevent($arr['body']);
-
- if(x($ev,'description') && x($ev,'start')) {
- $ev['event_xchan'] = $arr['author_xchan'];
- $ev['uid'] = $channel['channel_id'];
- $ev['account'] = $channel['channel_account_id'];
- $ev['edited'] = $arr['edited'];
- $ev['mid'] = $arr['mid'];
- $ev['private'] = $arr['item_private'];
-
- // is this an edit?
-
- $r = q("SELECT resource_id FROM item where mid = '%s' and uid = %d and resource_type = 'event' limit 1",
- dbesc($arr['mid']),
- intval($channel['channel_id'])
- );
- if($r) {
- $ev['event_hash'] = $r[0]['resource_id'];
- }
-
- $xyz = event_store($ev);
-
- }
- }
-} \ No newline at end of file