diff --git a/contrib/shimmie_api/main.php b/contrib/shimmie_api/main.php index e7ddc59e..84f3b0ba 100644 --- a/contrib/shimmie_api/main.php +++ b/contrib/shimmie_api/main.php @@ -120,6 +120,25 @@ class ShimmieApi extends Extension { "SELECT COUNT(*) AS count FROM comments WHERE owner_id=:owner_id", array("owner_id"=>$all['id'])); $all['commentperday'] = sprintf("%.1f", ($all['commentcount'] / (((time() - strtotime($all['joindate'])) / 86400) + 1))); + + if(isset($_GET['recent'])){ + $recent = $database->get_all( + "SELECT * FROM images WHERE owner_id=? ORDER BY id DESC LIMIT 0, 5", + array($all['id'])); + + $i = 0; + foreach($recent as $all['recentposts'][$i]){ + unset($all['recentposts'][$i]['owner_id']); //We already know the owners id.. + unset($all['recentposts'][$i]['owner_ip']); + + for($x=0; $x<14; $x++) unset($all['recentposts'][$i][$x]); + if(empty($all['recentposts'][$i]['author'])) unset($all['recentposts'][$i]['author']); + if($all['recentposts'][$i]['notes'] > 0) $all['recentposts'][$i]['has_notes'] = "Y"; + else $all['recentposts'][$i]['has_notes'] = "N"; + unset($all['recentposts'][$i]['notes']); + $i += 1; + } + } $page->set_data(json_encode($all)); } }