diff --git a/www/internals/books.php b/www/internals/books.php
index 84f7fcb..f6ee97a 100644
--- a/www/internals/books.php
+++ b/www/internals/books.php
@@ -98,4 +98,18 @@ class Books
}
return null;
}
+
+ public static function getRepositoryHost($book)
+ {
+ $r = $book['repository'];
+ if (startsWith($r, "http://")) $r = substr($r, strlen("http://"));
+ if (startsWith($r, "https://")) $r = substr($r, strlen("https://"));
+ if (startsWith($r, "www.")) $r = substr($r, strlen("www."));
+
+ if (startsWith(strtolower($r), "gitlab")) return "Gitlab";
+ if (startsWith(strtolower($r), "github")) return "Github";
+ if (startsWith(strtolower($r), "bitbucket")) return "Bitbucket";
+
+ return "Online";
+ }
}
\ No newline at end of file
diff --git a/www/pages/books_view.php b/www/pages/books_view.php
index 76d4c61..d73534b 100644
--- a/www/pages/books_view.php
+++ b/www/pages/books_view.php
@@ -52,11 +52,11 @@ if ($book === NULL) httpError(404, 'Book not found');
-
+
- Github
+