1
0

update statics/books

move apgte to gitlab (dmca)
This commit is contained in:
Mike Schwörer 2018-03-24 02:55:01 +01:00
parent 35c1ea30c7
commit eba2d04272
Signed by: Mikescher
GPG Key ID: D3C7172E0A70F8CF
3 changed files with 22 additions and 8 deletions

View File

@ -98,4 +98,18 @@ class Books
} }
return null; 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";
}
} }

View File

@ -52,11 +52,11 @@ if ($book === NULL) httpError(404, 'Book not found');
<div class="bookv_right_comb" style="grid-row:6"> <div class="bookv_right_comb" style="grid-row:6">
<a class="iconbutton" href="<?php echo $book['github'] ?>"> <a class="iconbutton" href="<?php echo $book['repository'] ?>">
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 24 24"> <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 24 24">
<use xlink:href="/data/images/icons.svg#github"/> <use xlink:href="/data/images/icons.svg#github"/>
</svg> </svg>
<span>Github</span> <span><?php echo Books::getRepositoryHost($book); ?></span>
</a> </a>
<a class="iconbutton" href="<?php echo $book['online'] ?>"> <a class="iconbutton" href="<?php echo $book['online'] ?>">
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 24 24"> <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 24 24">

View File

@ -7,7 +7,7 @@ return
'title' => 'Harry Potter and the Methods of Rationality: Book 1', 'title' => 'Harry Potter and the Methods of Rationality: Book 1',
'title_short' => 'HPMoR: Book 1', 'title_short' => 'HPMoR: Book 1',
'date' => '2015-04-04', 'date' => '2015-04-04',
'github' => 'https://github.com/Mikescher/HPMOR-LyX', 'repository' => 'https://github.com/Mikescher/HPMOR-LyX',
'pages' => '597', 'pages' => '597',
'pdf' => 'https://github.com/Mikescher/HPMOR-LyX/raw/master/hpmor_volume1_16x23.pdf', 'pdf' => 'https://github.com/Mikescher/HPMOR-LyX/raw/master/hpmor_volume1_16x23.pdf',
'online' => 'http://www.hpmor.com/', 'online' => 'http://www.hpmor.com/',
@ -21,7 +21,7 @@ return
'title' => 'Harry Potter and the Methods of Rationality: Book 2', 'title' => 'Harry Potter and the Methods of Rationality: Book 2',
'title_short' => 'HPMoR: Book 2', 'title_short' => 'HPMoR: Book 2',
'date' => '2015-04-04', 'date' => '2015-04-04',
'github' => 'https://github.com/Mikescher/HPMOR-LyX', 'repository' => 'https://github.com/Mikescher/HPMOR-LyX',
'pages' => '719', 'pages' => '719',
'pdf' => 'https://github.com/Mikescher/HPMOR-LyX/raw/master/hpmor_volume2_16x23.pdf', 'pdf' => 'https://github.com/Mikescher/HPMOR-LyX/raw/master/hpmor_volume2_16x23.pdf',
'online' => 'http://www.hpmor.com/', 'online' => 'http://www.hpmor.com/',
@ -35,7 +35,7 @@ return
'title' => 'Harry Potter and the Methods of Rationality: Book 3', 'title' => 'Harry Potter and the Methods of Rationality: Book 3',
'title_short' => 'HPMoR: Book 3', 'title_short' => 'HPMoR: Book 3',
'date' => '2015-04-04', 'date' => '2015-04-04',
'github' => 'https://github.com/Mikescher/HPMOR-LyX', 'repository' => 'https://github.com/Mikescher/HPMOR-LyX',
'pages' => '493', 'pages' => '493',
'pdf' => 'https://github.com/Mikescher/HPMOR-LyX/raw/master/hpmor_volume3_16x23.pdf', 'pdf' => 'https://github.com/Mikescher/HPMOR-LyX/raw/master/hpmor_volume3_16x23.pdf',
'online' => 'http://www.hpmor.com/', 'online' => 'http://www.hpmor.com/',
@ -49,9 +49,9 @@ return
'title' => 'A Practical Guide to Evil: Book 1', 'title' => 'A Practical Guide to Evil: Book 1',
'title_short' => 'APGtE: Book 1', 'title_short' => 'APGtE: Book 1',
'date' => '2016-12-23', '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', '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/', 'online' => 'https://practicalguidetoevil.wordpress.com/',
'author' => 'David Verburg', 'author' => 'David Verburg',
'size' => [12.5, 19.0], 'size' => [12.5, 19.0],
@ -63,7 +63,7 @@ return
'title' => 'The Metropolitan Man', 'title' => 'The Metropolitan Man',
'title_short' => 'The Metropolitan Man', 'title_short' => 'The Metropolitan Man',
'date' => '2017-12-02', 'date' => '2017-12-02',
'github' => 'https://github.com/Mikescher/Metropolitan-Man-Lyx', 'repository' => 'https://github.com/Mikescher/Metropolitan-Man-Lyx',
'pages' => '258', 'pages' => '258',
'pdf' => 'https://github.com/Mikescher/Metropolitan-Man-Lyx/raw/master/src/MM.pdf', 'pdf' => 'https://github.com/Mikescher/Metropolitan-Man-Lyx/raw/master/src/MM.pdf',
'online' => 'https://www.fanfiction.net/s/10360716/1/', 'online' => 'https://www.fanfiction.net/s/10360716/1/',