From eba2d04272ee7fac8a8bb8c52a7e46152382e72b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mike=20Schw=C3=B6rer?= Date: Sat, 24 Mar 2018 02:55:01 +0100 Subject: [PATCH] update statics/books move apgte to gitlab (dmca) --- www/internals/books.php | 14 ++++++++++++++ www/pages/books_view.php | 4 ++-- www/statics/books/__all.php | 12 ++++++------ 3 files changed, 22 insertions(+), 8 deletions(-) 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 + diff --git a/www/statics/books/__all.php b/www/statics/books/__all.php index 93dcc15..7728eb8 100644 --- a/www/statics/books/__all.php +++ b/www/statics/books/__all.php @@ -7,7 +7,7 @@ return 'title' => 'Harry Potter and the Methods of Rationality: Book 1', 'title_short' => 'HPMoR: Book 1', 'date' => '2015-04-04', - 'github' => 'https://github.com/Mikescher/HPMOR-LyX', + 'repository' => 'https://github.com/Mikescher/HPMOR-LyX', 'pages' => '597', 'pdf' => 'https://github.com/Mikescher/HPMOR-LyX/raw/master/hpmor_volume1_16x23.pdf', 'online' => 'http://www.hpmor.com/', @@ -21,7 +21,7 @@ return 'title' => 'Harry Potter and the Methods of Rationality: Book 2', 'title_short' => 'HPMoR: Book 2', 'date' => '2015-04-04', - 'github' => 'https://github.com/Mikescher/HPMOR-LyX', + 'repository' => 'https://github.com/Mikescher/HPMOR-LyX', 'pages' => '719', 'pdf' => 'https://github.com/Mikescher/HPMOR-LyX/raw/master/hpmor_volume2_16x23.pdf', 'online' => 'http://www.hpmor.com/', @@ -35,7 +35,7 @@ return 'title' => 'Harry Potter and the Methods of Rationality: Book 3', 'title_short' => 'HPMoR: Book 3', 'date' => '2015-04-04', - 'github' => 'https://github.com/Mikescher/HPMOR-LyX', + 'repository' => 'https://github.com/Mikescher/HPMOR-LyX', 'pages' => '493', 'pdf' => 'https://github.com/Mikescher/HPMOR-LyX/raw/master/hpmor_volume3_16x23.pdf', 'online' => 'http://www.hpmor.com/', @@ -49,9 +49,9 @@ return 'title' => 'A Practical Guide to Evil: Book 1', 'title_short' => 'APGtE: Book 1', 'date' => '2016-12-23', - 'github' => 'https://github.com/Mikescher/A-Practical-Guide-To-Evil-Lyx', + 'repository' => 'https://gitlab.com/Mikescher/A-Practical-Guide-To-Evil-Lyx', 'pages' => '501', - 'pdf' => 'https://github.com/Mikescher/A-Practical-Guide-To-Evil-Lyx/raw/master/APGTE_1/APGTE.pdf', + 'pdf' => 'https://gitlab.com/Mikescher/A-Practical-Guide-To-Evil-Lyx/raw/master/APGTE_1/APGTE.pdf', 'online' => 'https://practicalguidetoevil.wordpress.com/', 'author' => 'David Verburg', 'size' => [12.5, 19.0], @@ -63,7 +63,7 @@ return 'title' => 'The Metropolitan Man', 'title_short' => 'The Metropolitan Man', 'date' => '2017-12-02', - 'github' => 'https://github.com/Mikescher/Metropolitan-Man-Lyx', + 'repository' => 'https://github.com/Mikescher/Metropolitan-Man-Lyx', 'pages' => '258', 'pdf' => 'https://github.com/Mikescher/Metropolitan-Man-Lyx/raw/master/src/MM.pdf', 'online' => 'https://www.fanfiction.net/s/10360716/1/',