Browse Source

Merge pull request #5 from kylewm/master

add reply={url} query param for posting a note
medium
Aaron Parecki 9 years ago
parent
commit
f9a19f628f
2 changed files with 7 additions and 1 deletions
  1. +6
    -0
      controllers/controllers.php
  2. +1
    -1
      views/new-post.php

+ 6
- 0
controllers/controllers.php View File

@ -43,9 +43,14 @@ function generate_login_token() {
$app->get('/new', function() use($app) { $app->get('/new', function() use($app) {
if($user=require_login($app)) { if($user=require_login($app)) {
$params = $app->request()->params();
$entry = false; $entry = false;
$photo_url = false; $photo_url = false;
$in_reply_to = '';
if(array_key_exists('reply', $params))
$in_reply_to = $params['reply'];
$test_response = ''; $test_response = '';
if($user->last_micropub_response) { if($user->last_micropub_response) {
@ -60,6 +65,7 @@ $app->get('/new', function() use($app) {
$html = render('new-post', array( $html = render('new-post', array(
'title' => 'New Post', 'title' => 'New Post',
'in_reply_to' => $in_reply_to,
'micropub_endpoint' => $user->micropub_endpoint, 'micropub_endpoint' => $user->micropub_endpoint,
'micropub_scope' => $user->micropub_scope, 'micropub_scope' => $user->micropub_scope,
'micropub_access_token' => $user->micropub_access_token, 'micropub_access_token' => $user->micropub_access_token,

+ 1
- 1
views/new-post.php View File

@ -10,7 +10,7 @@
<div class="form-group"> <div class="form-group">
<label for="note_in_reply_to"><code>in-reply-to</code> (optional, a URL you are replying to)</label> <label for="note_in_reply_to"><code>in-reply-to</code> (optional, a URL you are replying to)</label>
<input type="text" id="note_in_reply_to" value="" class="form-control">
<input type="text" id="note_in_reply_to" value="<?= $this->in_reply_to ?>" class="form-control">
</div> </div>
<div class="form-group"> <div class="form-group">

Loading…
Cancel
Save