From 619382d1b970c27702402cb4694c4e91c6576770 Mon Sep 17 00:00:00 2001 From: vomitcuddle Date: Tue, 18 Jun 2013 21:56:46 +0100 Subject: [PATCH] Include image count and offset in root tag --- ext/danbooru_api/main.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/ext/danbooru_api/main.php b/ext/danbooru_api/main.php index f8501ecb..1a674ed5 100644 --- a/ext/danbooru_api/main.php +++ b/ext/danbooru_api/main.php @@ -265,7 +265,7 @@ class DanbooruApi extends Extension { * id: id to search for (comma delimited) * tags: what tags to search for * limit: limit - * offset: offset + * page: page number * after_id: limit results to posts added after this id */ if(($event->get_arg(1) == 'find_posts') || (($event->get_arg(1) == 'post') && ($event->get_arg(2) == 'index.xml'))) @@ -290,12 +290,13 @@ class DanbooruApi extends Extension { $limit = isset($_GET['limit']) ? int_escape($_GET['limit']) : 100; $start = (isset($_GET['page']) ? int_escape($_GET['page'])-1 : 0) * $limit; $tags = isset($_GET['tags']) ? Tag::explode($_GET['tags']) : array(); + $count = Image::count_images($tags); $results = Image::find_images(max($start, 0), min($limit, 100), $tags); } // Now we have the array $results filled with Image objects // Let's display them - $xml = "\n"; + $xml = "\n"; foreach($results as $img) { // Sanity check to see if $img is really an image object