Home"; $repo=get_query_var('repo'); $package=get_query_var('package'); $arch=get_query_var('arch'); if ($repo == "") { // // Repositories // echo " > " . _r("Repositories"); echo "

" . _r("Available repositories") . ":

"; $request = wp_remote_get('https://push.openmamba.org/openmamba/distroquery/api/v1/repositories'); $j = json_decode($request["body"], true); foreach ($j as $repository) { $repository_url = $url_prefix . $repository["tag"]; echo "". $repository["tag"] . ": " . $repository["description"] . "
"; } } else if ($package == "") { // // Repository // echo " > Repositories"; $page = $_GET['page']; $q = $_GET['q']; $query_append = ""; if ($page != "") $query_append="&page=" . $page; if ($q != "") $query_append .= "&q=" . urlencode($q); if ($query_append[0] == '&') $query_append[0] = "?"; $request = wp_remote_get('https://push.openmamba.org/openmamba/distroquery/api/v1/repository/' . $repo . $query_append); $j = json_decode($request["body"], true); if ($j["error"] != "") { echo "

ERROR: " . $j["error"] . "

"; } else { echo " > " . $repo; echo "

" . _r("List of packages") . ":

"; echo "
"; echo ""; echo " - "; if ($q != "") echo _r("Results for:") . " " . $q . " - "; // Pagination if ($j["query"]["pages"]) { $query_append = ""; if ($q != "") $query_append .= "&q=" . urlencode($q); $page = $j["query"]["page"]; $pages = $j["query"]["pages"]; $from_page = 1; if ($page > 10) $from_page = $page - 10; $to_page = $from_page + 20; if ($to_page > $pages) { $to_page = $pages; $from_page = $to_page - 20; if ($from_page < 1) $from_page = 1; } echo "" . $j["query"]["total"] . " " . _r("result(s) found") . " - " . _r("Showing page") . " " . $page . " " . _r("of") . " " . $pages . " [ "; if ($from_page > 1) { $back_page = $from_page - 10; if ($back_page < 1) $back_page = 1; echo "< "; } for ($i = $from_page; $i <= $to_page; $i++) { if ($i != $j["query"]["page"]) { echo "" . $i . " "; } else { echo "" . $i . " "; } } if ($to_page < $pages) { $next_page = $to_page + 10; if ($next_page > $pages) $next_page = $pages; if ($next_page < 1) $next_page = 1; echo "> "; } echo "]
"; } else { echo "0 " . _r("result(s) found"); } echo ""; foreach ($j["packages"] as $package) { $package_url = $url_prefix . $repo . "/" . $package["name"]; echo ""; } echo "
" . _r("Name") . "" . _r("Version") . "" . _r("Summary") . "" . _r("Last update") . "
". $package["name"] . "" . $package["version"] . "-" . $package["release"] . "" . $package["summary"] . "" . substr($package["buildtime"], 0, 10) . "
"; echo "
"; } } else if ($arch == "") { // // Source package // echo " > " . _r("Repositories") . ""; $request = wp_remote_get('https://push.openmamba.org/openmamba/distroquery/api/v1/package/'. $repo . "/" . $package); $j = json_decode($request["body"], true); if ($j["error"] != "") { echo "

" . _r("ERROR") . ": " . $j["error"] . "

"; } else { echo " > $repo > " . $package; ?>

" width="24" height="24"> :

:
:
:
:
:
:
:
:" target=_blank>
:
:" . $child["name"] . "(" . $child["arch"] . ") "; } ?>
:
" . _r("Repositories") . ""; $request = wp_remote_get('https://push.openmamba.org/openmamba/distroquery/api/v1/package/'. $repo . "/" . $package . "/" . $arch); $j = json_decode($request["body"],true); if ($j["error"] != "") { echo "

" . _r("ERROR") . ": " . $j["error"] . "

"; } else { echo " > $repo > " . $package . " (" . $arch . ")"; ?>

" width="24" height="24"> :

:
:
:
:
:
:
:" target=_blank>
:". $j["source"]["name"] . " "; ?>
:". $brother . " "; } ?>
:
:
: