function pagination($url = null) { $sql = "SELECT i.id AS id, `name`, size, `from`,`date`, original, thumb_small, thumb_medium, thumb_big, u.id AS user_id, u.first_name AS uploaded_by, i.active as active " . " FROM image i LEFT JOIN user u ON u.id = i.user_id "; if (\SKS\LIB\Session::isAuthor()) { $sql .= " WHERE u.id = " . \SKS\LIB\Session::getLoggedInUser()->getId(); } $sql .= " ORDER BY date DESC "; $table_page = PATH_ADMIN_VIEWS . "gallery/paginator/row.php"; $paginator = new \Paginator(); $paginator->execute($sql, $table_page, $url); }