rpicms

A CMS for the Raspberry Pi
git clone git://archive.git.mtrnord.blog/RpicmsTeam/rpicms.git
Log | Files | Refs | README | LICENSE

commit 17a3ae35cd98aece0727ae6aec8c200c62b5ebc8
parent f6fb6f280f74bc072ccdf2f77f6d035ec62c2618
Author: MTRNord <mtrnord1@gmail.com>
Date:   Fri, 20 Mar 2015 18:04:09 +0100

should work now

Diffstat:
Mcore/api/v1/api.php | 20+++++++++++++-------
1 file changed, 13 insertions(+), 7 deletions(-)

diff --git a/core/api/v1/api.php b/core/api/v1/api.php @@ -184,13 +184,19 @@ $app->get('/posts/', function() { // fetch task $result = $db->getPosts(NULL); if ($result != NULL) { - $response["error"] = false; - $response["id"] = $result["id"]; - $response["title"] = $result["title"]; - $response["text"] = $result["text"]; - $response["author"] = $result["author"]; - $response["category"] = $result["category"]; - $response["date"] = $result["date"]; + $x = 1; + $id = 1; + while ($x < $response["post_id_clean"]+1){ + $response["$x"]["error"] = false; + $response["$x"]["id"] = $result["id"]; + $response["$x"]["title"] = $result["title"]; + $response["$x"]["text"] = $result["text"]; + $response["$x"]["author"] = $result["author"]; + $response["$x"]["category"] = $result["category"]; + $response["$x"]["date"] = $result["date"]; + $x = $x+1; + $id = $id+1; + } echoRespnse(200, $response); } else { $response["error"] = true;