From 1123ed958f7c22116a0c432779aaf1c27fcaf787 Mon Sep 17 00:00:00 2001 From: Aaron Parecki Date: Mon, 27 Feb 2017 12:31:06 -0800 Subject: basic editing support * new route `/edit?url=` intended to be used as an edit button target, which detects the type of post and redirects to the appropriate editing interface * implemented the edit interface for favorites --- lib/helpers.php | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'lib/helpers.php') diff --git a/lib/helpers.php b/lib/helpers.php index b7ae78d..9a862d1 100644 --- a/lib/helpers.php +++ b/lib/helpers.php @@ -277,6 +277,19 @@ function get_micropub_config(&$user, $query=[]) { ]; } +function get_micropub_source(&$user, $url, $properties) { + $r = micropub_get($user->micropub_endpoint, [ + 'q' => 'source', + 'url' => $url, + 'properties' => $properties + ], $user->micropub_access_token); + if(isset($r['data']) && isset($r['data']['properties'])) { + return $r['data']['properties']; + } else { + return false; + } +} + function static_map($latitude, $longitude, $height=180, $width=700, $zoom=14) { return 'https://atlas.p3k.io/map/img?marker[]=lat:' . $latitude . ';lng:' . $longitude . ';icon:small-blue-cutout&basemap=gray&width=' . $width . '&height=' . $height . '&zoom=' . $zoom; } -- cgit v1.2.3