streams/mod/notes.php

25 lines
495 B
PHP
Raw Normal View History

2013-12-09 23:27:46 +00:00
<?php /** @file */
function notes_init(&$a) {
2014-06-05 04:02:57 +00:00
2015-01-29 04:56:04 +00:00
if(! local_channel())
2013-12-09 23:27:46 +00:00
return;
$ret = array('success' => true);
2013-12-11 10:25:20 +00:00
if($_REQUEST['note_text'] || $_REQUEST['note_text'] == '') {
2013-12-09 23:27:46 +00:00
$body = escape_tags($_REQUEST['note_text']);
2015-01-29 04:56:04 +00:00
set_pconfig(local_channel(),'notes','text',$body);
2013-12-09 23:27:46 +00:00
}
// push updates to channel clones
if((argc() > 1) && (argv(1) === 'sync')) {
require_once('include/zot.php');
build_sync_packet();
}
2014-06-05 04:02:57 +00:00
logger('notes saved.', LOGGER_DEBUG);
2013-12-09 23:27:46 +00:00
json_return_and_die($ret);
2013-12-11 10:25:20 +00:00
}