From bdfd878b58b3171c651fae8865ee8d1a7681a4f9 Mon Sep 17 00:00:00 2001 From: mmk2410 Date: Thu, 18 Jun 2015 20:45:49 +0200 Subject: [PATCH] Theme support, clean up, code formating and improvement --- config.php | 7 +- index.php | 185 ++++++++++++++++++---------------- old/posts.xml | 123 ---------------------- rcc/genpas/index.php | 7 +- rcc/index.php | 7 +- rcc/res/rcc.css | 84 +++++++-------- rcc/uploaded/index.php | 4 +- res/css/no-nav.css | 42 ++++++++ res/css/rangitaki.css | 69 +++---------- res/js/app.js | 58 +++++------ res/php/ArticleGenerator.php | 65 ++++++------ res/php/BlogListGenerator.php | 16 ++- res/php/Disqus.php | 8 +- res/php/GoogleAnalytics.php | 32 +++--- themes/background-img.css | 149 +++++++++++++++++++++++++++ themes/material-dark.css | 135 +++++++++++++++++++++++++ themes/material-light.css | 134 ++++++++++++++++++++++++ 17 files changed, 722 insertions(+), 403 deletions(-) delete mode 100644 old/posts.xml create mode 100644 res/css/no-nav.css create mode 100644 themes/background-img.css create mode 100644 themes/material-dark.css create mode 100644 themes/material-light.css diff --git a/config.php b/config.php index 769f08a..791dac6 100644 --- a/config.php +++ b/config.php @@ -1,4 +1,5 @@ github.com/mmk2410/Rangitaki'; +$blogfooter = 'Rangitaki ' . date("Y") . ' github.com/mmk2410/Rangitaki'; // This enables the optional rangitaki control center. Please read the documentation before you enable it. -$rcc= 'no'; +$rcc = 'no'; // Here you can disable and enable the navigation menu. Usefull if you have no subblogs and no home directory $nav_drawer = 'yes'; +// Set here the name of your theme. Read the documentation for more themes +$theme = 'material-light'; ?> diff --git a/index.php b/index.php index 106aa7c..2034da3 100644 --- a/index.php +++ b/index.php @@ -25,141 +25,152 @@ THE SOFTWARE. --> - + $getblog = filter_input(INPUT_GET, "blog"); + $getarticle = filter_input(INPUT_GET, "article"); + $gettag = filter_input(INPUT_GET, "tag"); + $url = "http://" . filter_input(INPUT_SERVER, "HTTP_HOST") . filter_input(INPUT_SERVER, "REQUEST_URI"); + ?> - - <?php echo $blogtitle; ?> - - - - - - - - - - - - - - - - -
- + + + -
-
- - -
- +
+
+ + +
+ -
-
- setBreaksEnabled(true) - ->text($file); - echo $intro; - ?> -
-
- +
+
+ setBreaksEnabled(true) + ->text($file); + echo $intro; + ?> +
+
+ = 3 && substr($article, -3) == ".md"){ - ArticleGenerator::newArticle($articlesdir, $article, $_GET['blog']); + if (in_array($gettag, $tags)) { + if (strlen($article) >= 3 && substr($article, -3) == ".md") { + ArticleGenerator::newArticle($articlesdir, $article, $getblog); } } } - } else if($_GET['article'] == ""){ + } else if ($getarticle == "") { $articles = scandir($articlesdir, 1); foreach ($articles as $article) { - if(strlen($article) >= 3 && substr($article, -3) == ".md"){ - ArticleGenerator::newArticle($articlesdir, $article, $_GET['blog']); + if (strlen($article) >= 3 && substr($article, -3) == ".md") { + ArticleGenerator::newArticle($articlesdir, $article, $getblog); } } } else { - ArticleGenerator::newArticle($articlesdir, $_GET['article'] . ".md", $_GET['blog']); + ArticleGenerator::newArticle($articlesdir, $getarticle . ".md", $getblog); include './res/php/SocialBar.php'; include './res/php/Disqus.php'; } - ?> + ?>
@@ -168,10 +179,10 @@ THE SOFTWARE.
- - - + + + ?> diff --git a/old/posts.xml b/old/posts.xml deleted file mode 100644 index 0455c47..0000000 --- a/old/posts.xml +++ /dev/null @@ -1,123 +0,0 @@ - - - - About the Future of pBlog - 29th March 2015 - -I figured out that there will be many changes in the engine which will require many changes in the files (especially the posts file) and in the filestructure. I can't say right now which things will change and what you have to change. Out of this reason I change the Version numbers and add an zero in front of them. So instead of 2.1 the latest version is now 0.2.1. The 0.2.x series is now on GitHub as an own branch and will recive bugfix updates. The series 0.3, 0.4, 0.5 and so own will be development releases which won't be compatible to the 0.2 series. I recommend current users to stay on 0.2.x - at least until the 1.0 release. I'm verry sorry for this and in case that there are requests I may write a small script that will help you switch to version 1.0. - - - - Version 2.1 - 29th March 2015 - This version includes fixes for the article links. You only have to replace the hrefgenerator.php file in the res folder. - - - Version 2.0 - 27th March 2015 - -This version introduces some very imporant features: - - **Own page for every article** - - Social **sharing buttons** (at the moment: google+, twitter, facebook but more will follow) - - **Disqus** integration - - Local **config file** -> no more editing the index file - -pBlog 2.0 is only partially compatible with prior versions. You don't have to change anything in the posts or intro file (in case you have one), but to switch to version 2.0 you have to replace your index.php with the new one. With this step all your settings like the title will be lost and you have to set them in the new config.php file. For more questions write me a mail to marcelmichaelkapfer@yahoo.co.nz. - -In the near future I will spend more time in writing a documentation about the blog engine and adding more comments (especially in the css file). - - http://github.com/mmk2410/pBlog - GitHub - - - Version 1.2 - 8th March 2015 - -In this Version code is better designed so you can read and recognise it better. - -This is a code example: - -``scp -r * marcel-kapfer.de:`` - - - - Version 1.1 - 24th February 2015 - -After I published the Version 1.0 last sunday I realized some problems with german umlauts. Now I added a function that converts every umlaut (ü, Ü, ä, Ä, ö, Ö and ß) into the html code. - - - - Version 1.0 - 22nd February 2015 - -Today I'm proud to announce the **Version 1.0** of the pBlog - a simple PHP, XML and Markdown based blogging engine -which is completly independent from any databases. Even if this is the version 1.0 it is still in a early state of -development. - -Version 1.0 has the following features: - - Blog writing in XML - - Content in Markdown - - Static intro in Markdown - - - - Version 0.3 - 20th February 2015 - This is the Version *0.3* of pBlog. It comes with the following changes: -- Complete Markdown Support -- Design fixes -- a mainlink is no longer required - - - - Version 0.2 - 20th February 2015 - -The following things are new in this version: -- Design -- Better structur -- cleaned up - -More will come when it is ready! -This is the version *0.2*. - - index.php - Reload - - - http://marcel-kapfer.de - marcel-kapfer.de - - - https://github.com/mmk2410/pblog - GitHub - - - - - Blog (Experimental) - 13th February 2015 - -This is a test version in a early state of the new **blog engine**. By now it supports following things: -- Markdown -- Mainlink and various other links - -More will come when it is ready! -This is the version *0.1*. - - index.php - Reload - - - http://marcel-kapfer.de - marcel-kapfer.de - - - https://github.com - GitHub - - - - - diff --git a/rcc/genpas/index.php b/rcc/genpas/index.php index ff017a5..29ea984 100644 --- a/rcc/genpas/index.php +++ b/rcc/genpas/index.php @@ -2,7 +2,7 @@ - +
- - \ No newline at end of file diff --git a/themes/background-img.css b/themes/background-img.css new file mode 100644 index 0000000..968a609 --- /dev/null +++ b/themes/background-img.css @@ -0,0 +1,149 @@ +/* +The MIT License + +Copyright 2015 mmk2410. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. +*/ +/* + Created on : Jun 18, 2015, 6:39:37 PM + Author : mmk2410 +*/ + +body{ + font-family: "Roboto", sans-serif; + background: #f6f6f6; + color: #383838; + background-image: url(http://marcel-kapfer.de/res/img/druck.png); + background-size: cover; + background-attachment: fixed; + background-position: top center; + background-repeat: no-repeat; +} + +.header{ + background-color: rgba(0, 0, 0, 0.45); + position: fixed; +} + +.title{ + color: #fff; + position: absolute; +} + +.nav{ + background-color: #fff; + border-right: 1px solid #e0e0e0; +} + +.nav-item, .nav-item-static{ + color: #383838; +} + +.nav-item{ + font-weight: 600; +} + +.nav-item:active{ + background-color: #e2e2e2; +} + +.divider{ + border-bottom: 1px solid #e0e0e0; +} + +.card{ + background: #fff; + border-radius: 2px; + box-shadow: 0px 1px 1.5px 1.5px rgba(62, 62, 62, 0.3); +} + + +.card a{ + color: #ff4415; + text-decoration: none; + border-bottom: 1px solid transparent; + border-bottom-color: transparent; + transition: border-bottom-color 150ms ease-in-out 100ms; +} + +.card a:hover{ + border-bottom-color: #ff4415; +} + +.headline{ + font-size: 24px; + color: #383838!important; + text-decoration: none; + border-bottom: none!important; +} + +.date{ + font-size: 13px; +} + +.articletext{ + font-size: 14px; + line-height: 24px; +} + +.author{ + font-size: 13px; +} + +.tag{ + font-size: 13px; +} + +.fab{ + background-color: #ff4415; + box-shadow: 0px 1px 1.5px 1.5px rgba(62, 62, 62, 0.3); +} + +.subfab{ + background-color: #fff; + box-shadow: 0px 1px 1.5px 1.5px rgba(62, 62, 62, 0.3); +} + +.footer{ + font-size: 12px; + text-align: center; + color: #fff; + text-shadow: 1px 1px rgba(55, 55, 55, 0.3); +} + +.footer a{ + color: #fff; + text-shadow: 1px 1px rgba(175, 175, 175, 0.3); + text-decoration: none; + border-bottom: 1px solid transparent; + border-bottom-color: transparent; +} + +.footer a:hover{ + border-bottom-color: #fff; +} + +@media screen and (min-width: 1440px) { + + .nav{ + background-color: rgba(255, 255, 255, 0.8); + } + +} diff --git a/themes/material-dark.css b/themes/material-dark.css new file mode 100644 index 0000000..a41a244 --- /dev/null +++ b/themes/material-dark.css @@ -0,0 +1,135 @@ +/* +The MIT License + +Copyright 2015 mmk2410. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. +*/ +/* + Created on : Jun 18, 2015, 6:39:37 PM + Author : mmk2410 +*/ + +body{ + font-family: "Roboto", sans-serif; + background: #303030; + color: #fff; +} + +.header{ + background-color: #212121; + position: fixed; + box-shadow: 2px 0px 2px 2px rgba(32, 32, 32, 0.85); +} + +.title{ + color: #fff; + position: absolute; +} + +.nav{ + background-color: #424242; + border-right: 1px solid #1f1f1f; +} + +.nav-item, .nav-item-static{ + color: #fff; +} + +.nav-item{ + font-weight: 600; +} + +.nav-item:active{ + background-color: #383838; +} + +.divider{ + border-bottom: 1px solid #1f1f1f; +} + +.card{ + background: #424242; + border-radius: 2px; + box-shadow: 0px 1px 1.5px 1.5px rgba(42, 42, 42, 0.65); +} + + +.card a{ + color: #ff4415; + text-decoration: none; + border-bottom: 1px solid transparent; + border-bottom-color: transparent; + transition: border-bottom-color 150ms ease-in-out 100ms; +} + +.card a:hover{ + border-bottom-color: #ff4415; +} + +.headline{ + font-size: 24px; + color: #fff!important; + text-decoration: none; + border-bottom: none!important; +} + +.date{ + font-size: 13px; +} + +.articletext{ + font-size: 14px; + line-height: 24px; +} + +.author{ + font-size: 13px; +} + +.tag{ + font-size: 13px; +} + +.fab{ + background-color: #ff4415; + box-shadow: 0px 1px 1.5px 1.5px rgba(42, 42, 42, 0.65); +} + +.subfab{ + background-color: #424242; + box-shadow: 0px 1px 1.5px 1.5px rgba(42, 42, 42, 0.65); +} + +.footer{ + font-size: 12px; + text-align: center; + color: #fff; +} + +.footer a{ + color: #fff; + text-decoration: none; + border-bottom: 1px solid transparent; + border-bottom-color: transparent; +} + +.footer a:hover{ + border-bottom-color: #fff; +} \ No newline at end of file diff --git a/themes/material-light.css b/themes/material-light.css new file mode 100644 index 0000000..f601956 --- /dev/null +++ b/themes/material-light.css @@ -0,0 +1,134 @@ +/* +The MIT License + +Copyright 2015 mmk2410. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. +*/ +/* + Created on : Jun 18, 2015, 6:39:37 PM + Author : mmk2410 +*/ + +body{ + font-family: "Roboto", sans-serif; + background: #f6f6f6; + color: #383838; +} + +.header{ + background-color: #ff4415; + position: fixed; + box-shadow: 2px 0px 2px 2px rgba(62, 62, 62, 0.45); +} + +.title{ + color: #fff; + position: absolute; +} + +.nav{ + background-color: #fff; + border-right: 1px solid #e0e0e0; +} + +.nav-item, .nav-item-static{ + color: #383838; +} + +.nav-item{ + font-weight: 600; +} + +.nav-item:active{ + background-color: #e2e2e2; +} + +.divider{ + border-bottom: 1px solid #e0e0e0; +} + +.card{ + background: #fff; + border-radius: 2px; + box-shadow: 0px 1px 1.5px 1.5px rgba(62, 62, 62, 0.3); +} + + +.card a{ + color: #ff4415; + text-decoration: none; + border-bottom: 1px solid transparent; + border-bottom-color: transparent; + transition: border-bottom-color 150ms ease-in-out 100ms; +} + +.card a:hover{ + border-bottom-color: #ff4415; +} + +.headline{ + font-size: 24px; + color: #383838!important; + text-decoration: none; + border-bottom: none!important; +} + +.date{ + font-size: 13px; +} + +.articletext{ + font-size: 14px; + line-height: 24px; +} + +.author{ + font-size: 13px; +} + +.tag{ + font-size: 13px; +} + +.fab{ + background-color: #ff4415; + box-shadow: 0px 1px 1.5px 1.5px rgba(62, 62, 62, 0.3); +} + +.subfab{ + background-color: #fff; + box-shadow: 0px 1px 1.5px 1.5px rgba(62, 62, 62, 0.3); +} + +.footer{ + font-size: 12px; + text-align: center; +} + +.footer a{ + color: #383838; + text-decoration: none; + border-bottom: 1px solid transparent; + border-bottom-color: transparent; +} + +.footer a:hover{ + border-bottom-color: #383838; +} \ No newline at end of file