diff --git a/controllers/controllers.php b/controllers/controllers.php index 505589f..3f95147 100644 --- a/controllers/controllers.php +++ b/controllers/controllers.php @@ -115,6 +115,7 @@ $app->get('/bookmark', function() use($app) { 'bookmark_tags' => $tags, 'token' => generate_login_token(), 'syndication_targets' => json_decode($user->syndication_targets, true), + 'user' => $user, 'authorizing' => false )); } @@ -323,6 +324,9 @@ $app->post('/settings/save', function() use($app) { if(array_key_exists('slug_field', $params) && $params['slug_field']) $user->micropub_slug_field = $params['slug_field']; + if(array_key_exists('syndicate_field', $params) && $params['syndicate_field']) + $user->micropub_syndicate_field = $params['syndicate_field']; + $user->save(); $app->response()['Content-type'] = 'application/json'; $app->response()->body(json_encode(array( diff --git a/schema/migrations/0004.sql b/schema/migrations/0004.sql new file mode 100644 index 0000000..8b74018 --- /dev/null +++ b/schema/migrations/0004.sql @@ -0,0 +1,5 @@ +ALTER TABLE users +ADD COLUMN `micropub_syndicate_field` VARCHAR(255) NOT NULL DEFAULT 'mp-syndicate-to' AFTER `micropub_slug_field`; + +UPDATE users +SET micropub_syndicate_field = 'syndicate-to'; diff --git a/schema/mysql.sql b/schema/mysql.sql index 31f10fd..9796b5d 100644 --- a/schema/mysql.sql +++ b/schema/mysql.sql @@ -9,6 +9,7 @@ CREATE TABLE `users` ( `micropub_scope` varchar(255) DEFAULT NULL, `micropub_response` text, `micropub_slug_field` varchar(255) NOT NULL DEFAULT 'mp-slug', + `micropub_syndicate_field` varchar(255) NOT NULL DEFAULT 'mp-syndicate-to', `micropub_success` tinyint(4) DEFAULT '0', `date_created` datetime DEFAULT NULL, `last_login` datetime DEFAULT NULL, diff --git a/schema/sqlite.sql b/schema/sqlite.sql index 1dced77..00e5f1c 100644 --- a/schema/sqlite.sql +++ b/schema/sqlite.sql @@ -9,6 +9,7 @@ CREATE TABLE users ( micropub_scope TEXT, micropub_response TEXT, micropub_slug_field TEXT default 'mp-slug', + micropub_syndicate_field TEXT default 'mp-syndicate-to', micropub_success INTEGER default 0, date_created datetime, last_login datetime, diff --git a/views/docs/note.php b/views/docs/note.php index 654c478..737e811 100644 --- a/views/docs/note.php +++ b/views/docs/note.php @@ -30,7 +30,7 @@
location
- If you check the "location" box, then this property will be a Geo URI with the location the browser detected. You will see a preview of the value in the note interface along with a map.photo
or photo[]
- If your server supports a Media Endpoint, this will be set to the URL that your endpoint returned when it uploaded the photo. Otherwise, this will be one of the parts in the multipart request with the image file itself.mp-slug
- If you enter a slug, this will be sent in the request. You can customize the name of this property in settings.syndicate-to[]
- (Note: this is deprecated and will be replaced with "mp-syndicate-to[]" soon) Each syndication destination selected will be sent in this property. The values will be the uid
that your endpoint returns. See Syndication for more details.mp-syndicate-to[]
- Each syndication destination selected will be sent in this property. The values will be the uid
that your endpoint returns. See Syndication for more details. (If you are using an older Micropub endpoint that expects syndicate-to
, you can customize this property in the settings.)