diff options
author | Tony Baldwin <tonybaldwin@gmx.com> | 2014-03-09 19:22:54 -0400 |
---|---|---|
committer | Tony Baldwin <tonybaldwin@gmx.com> | 2014-03-09 19:22:54 -0400 |
commit | 5cca00ddc79dad667464674e08a2a860e262eabd (patch) | |
tree | 53df980e32a6706e977a5a2276e0f9aa9ec09300 /include/api.php | |
parent | 67166180bb560276273a20bcd9ca2a7aae036aba (diff) | |
parent | a79072ce478a999b06df38ae324fbcef6d3a76e7 (diff) | |
download | volse-hubzilla-5cca00ddc79dad667464674e08a2a860e262eabd.tar.gz volse-hubzilla-5cca00ddc79dad667464674e08a2a860e262eabd.tar.bz2 volse-hubzilla-5cca00ddc79dad667464674e08a2a860e262eabd.zip |
Merge remote-tracking branch 'upstream/master'
Conflicts:
view/theme/redbasic/tpl/theme_settings.tpl
reset to upstream
Diffstat (limited to 'include/api.php')
-rw-r--r-- | include/api.php | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/include/api.php b/include/api.php index dc270167b..47c78113a 100644 --- a/include/api.php +++ b/include/api.php @@ -533,6 +533,12 @@ require_once('include/items.php'); api_register_func('api/red/channel/export/basic','api_export_basic', true); + + + + + + function api_channel_stream(&$a, $type) { if(api_user() === false) { logger('api_channel_stream: no user'); @@ -691,6 +697,48 @@ require_once('include/items.php'); api_register_func('api/statuses/update','api_statuses_update', true); + function red_item_new(&$a, $type) { + + if (api_user() === false) { + logger('api_statuses_update: no user'); + return false; + } + + logger('api_statuses_update: REQUEST ' . print_r($_REQUEST,true)); + logger('api_statuses_update: FILES ' . print_r($_FILES,true)); + + + // set this so that the item_post() function is quiet and doesn't redirect or emit json + + $_REQUEST['api_source'] = true; + $_REQUEST['profile_uid'] = api_user(); + + if(x($_FILES,'media')) { + $_FILES['userfile'] = $_FILES['media']; + // upload the image if we have one + $_REQUEST['silent']='1'; //tell wall_upload function to return img info instead of echo + require_once('mod/wall_upload.php'); + $media = wall_upload_post($a); + if(strlen($media)>0) + $_REQUEST['body'] .= "\n\n".$media; + } + + require_once('mod/item.php'); + $x = item_post($a); + json_return_and_die($x); + } + + api_register_func('api/red/item/new','red_item_new', true); + + + + + + + + + + function api_status_show(&$a, $type){ $user_info = api_get_user($a); |