<?php
function newsList() {
    global $conn;
    [$start, $perpage] = get_pagination_params();
    $rss = mysqli_query($conn, "SELECT id, title, body, date, pinned FROM h_news ORDER BY pinned DESC, id DESC LIMIT $start,$perpage");
    $items = []; while ($row = mysqli_fetch_assoc($rss)) { $items[] = $row; }
    success_response(['items' => $items]);
}