diff --git a/articles/2015-03-27-09-34-Version-2.0.md b/articles/2015-03-27-09-34-Version-2.0.md new file mode 100644 index 0000000..5a20f9e --- /dev/null +++ b/articles/2015-03-27-09-34-Version-2.0.md @@ -0,0 +1,12 @@ +%TITLE: Version 2.0 +%DATE: 27 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). \ No newline at end of file diff --git a/articles/2015-03-29-18-23-Version-2.1.md b/articles/2015-03-29-18-23-Version-2.1.md new file mode 100644 index 0000000..7a160c5 --- /dev/null +++ b/articles/2015-03-29-18-23-Version-2.1.md @@ -0,0 +1,4 @@ +%TITLE: Version 2.1 +%DATE: 29 March 2015 + +This version includes fixes for the article links. You only have to replace the hrefgenerator.php file in the res folder. \ No newline at end of file diff --git a/articles/2015-03-29-21-34-About-the-Future-of-pBlog.md b/articles/2015-03-29-21-34-About-the-Future-of-pBlog.md new file mode 100644 index 0000000..3b4bb67 --- /dev/null +++ b/articles/2015-03-29-21-34-About-the-Future-of-pBlog.md @@ -0,0 +1,4 @@ +%TITLE: About the Future of pBlog +%DATE: 29 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. \ No newline at end of file diff --git a/config.php b/config.php index a4b5c8b..e350c3c 100644 --- a/config.php +++ b/config.php @@ -3,11 +3,11 @@ // Every line has an description about what you can change here. Don't delete any strings. You can set your value after the '=' sign and between the apostrophes. // Make sure that every line ends with an semicolon (';'). // Blog Title - Set here an individual title of your blog by replacing pBlog with it. -$blogtitle = 'pBlog'; +$blogtitle = 'Rangitaki Blog'; // Blog Author - Set here your name $blogauthor = 'Marcel Kapfer'; // Blog description -$blogdescription = 'pBlog - A php blog engine without any database dependency'; +$blogdescription = 'Rangitaki - A php blog engine without any database dependency'; // Home - set yes if you want to link to your homepage and no if not $bloghome = 'yes'; // Home URL - Set here the url to your main page. Either relative (e.g. '../') or absolute ('http://github.com') @@ -21,5 +21,5 @@ $blogdisqus = 'no'; // Disqus shortname - Provide here your Disqus shortname. Without one, this won't work $blogdisqusname = ''; // Footer - set here the text for your footer (e.g. a copyright info). You can replace the whole text after the '=' with your own one. -$blogfooter = 'pBlog ' . date("Y") . ' github.com/mmk2410/pBlog'; +$blogfooter = 'Rangitaki ' . date("Y") . ' marcel-kapfer.de/rangitaki'; ?> diff --git a/index.php b/index.php index 39c07e8..e73760e 100644 --- a/index.php +++ b/index.php @@ -36,14 +36,14 @@ THE SOFTWARE. - +
- + @@ -51,9 +51,9 @@ THE SOFTWARE.
- post as $post){ - $href = $post->title; - $HrefGenerator = new HrefGenerator; - $href = $HrefGenerator->createHref($href); - $titleArray[$i] = $href; - $i = $i + 1; - } - if($_GET['article'] != ""){ - $an = array_search($_GET['article'], $titleArray, true); - $post = $xml->post[$an]; - ?> -
- - title; - $UmlautConverter = new UmlautConverter; - $title = $UmlautConverter->convert($title); - echo $title; - ?> -
-
- - pubdate; - $UmlautConverter = new UmlautConverter; - $pubdate = $UmlautConverter->convert($pubdate); - echo $pubdate; - ?> - -

- setBreaksEnabled(true) - ->text($post->content); - $UmlautConverter = new UmlautConverter; - $content = $UmlautConverter->convert($content); - echo $content; - ?> -

-

- otherlinks->otherlb as $olb){ - ?> - - otherlink; - $UmlautConverter = new UmlautConverter; - $otherlink = $UmlautConverter->convert($otherlink); - echo $otherlink; - ?> - - = 3 && substr($article, -3) == ".md"){ + ArticleGenerator::newArticle("./articles/", $article); + } } - foreach($post->mainlink as $mainlink){ - ?> - - mainlink; - $UmlautConverter = new UmlautConverter; - $mainlink = $UmlautConverter->convert($mainlink); - echo $mainlink; - ?> - - -

- - -
- - - -
- - post as $post){ - ?> -
- - title; - $UmlautConverter = new UmlautConverter; - $title = $UmlautConverter->convert($title); - echo $title; - ?> -
-
- - pubdate; - $UmlautConverter = new UmlautConverter; - $pubdate = $UmlautConverter->convert($pubdate); - echo $pubdate; - ?> - -

- setBreaksEnabled(true) - ->text($post->content); - $UmlautConverter = new UmlautConverter; - $content = $UmlautConverter->convert($content); - echo $content; - ?> -

-

- otherlinks->otherlb as $olb){ - ?> - - otherlink; - $UmlautConverter = new UmlautConverter; - $otherlink = $UmlautConverter->convert($otherlink); - echo $otherlink; - ?> - - mainlink as $mainlink){ - ?> - - mainlink; - $UmlautConverter = new UmlautConverter; - $mainlink = $UmlautConverter->convert($mainlink); - echo $mainlink; - ?> - - -

-
-

diff --git a/md/intro.md b/old/intro.md similarity index 100% rename from md/intro.md rename to old/intro.md diff --git a/xml/posts.xml b/old/posts.xml similarity index 100% rename from xml/posts.xml rename to old/posts.xml diff --git a/res/blog.css b/res/css/blog.css similarity index 97% rename from res/blog.css rename to res/css/blog.css index bc4b449..c5191ac 100644 --- a/res/blog.css +++ b/res/css/blog.css @@ -54,7 +54,7 @@ img{ right: 0; float: center; z-index: 40; - background: #de3e0b; + background: #ff4415; width: 100%; box-shadow: 0px 0px 4px 4px rgba(189, 189, 189, 0.5); -moz-box-shadow: 0px 0px 4px 4px rgba(189, 189, 189, 0.5); @@ -78,7 +78,7 @@ img{ font-size: 14px; line-height: 20px; letter-spacing: 0.01px; - color: #de3e0b; + color: #ff4415; text-decoration: none; } section{ @@ -128,10 +128,10 @@ Usage: YOUR TEXT height: 40px; padding: 8px; color: #FFFFFF; - background-color: #de3e0b; + background-color: #ff4415; border-width: 1px; border-style: solid; - border-color: #de3e0b; + border-color: #ff4415; border-radius: 3px; margin: 4px; margin-bottom: 5px; @@ -184,7 +184,7 @@ code{ } .texttitle:hover{ - color: #de3e0b; + color: #ff4415; } .texttitlemono{ diff --git a/res/css/design.scss b/res/css/design.scss new file mode 100644 index 0000000..b21313d --- /dev/null +++ b/res/css/design.scss @@ -0,0 +1,195 @@ +/* +The MIT License + +Copyright 2015 mmk. + +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 10, 2015, 9:57:04 AM + Author : mmk2410 +*/ + +$primary-color: #ff4415; +$font-family: 'Roboto', sans-serif; + +body{ + margin-right: 15%; + margin-left: 15%; + margin-bottom: 0px; + margin-top: 100px; + font-family: $font-family; + font-size: 14px; + line-height: 20px; + letter-spacing: 0.01px; + background-color: #ffffff; + color: rgba(0, 0, 0, 0.87); +} + +img{ + max-width: 100%; + max-height: 400px; + display: block; + margin-left: auto; + margin-right: auto; +} + + +.header{ + position: absolute; + top: 0; + left: 0; + right: 0; + float: center; + z-index: 40; + background: $primary-color; + width: 100%; + box-shadow: 0px 0px 4px 4px rgba(189, 189, 189, 0.5); + -moz-box-shadow: 0px 0px 4px 4px rgba(189, 189, 189, 0.5); + -webkit-box-shadow: 0px 0px 4px 4px rgba(189, 189, 189, 0.5); + height: 60px; + padding-right: 0px; + padding-top: 0px; + white-space: nowrap; +} +.text{ + font-family: $font-family; + font-size: 14px; + line-height: 20px; + letter-spacing: 0.01px; + background-color: #ffffff; + z-index: 10; + color: rgba(0, 0, 0, 0.87); +} +.text a{ + font-family: $font-family; + font-size: 14px; + line-height: 20px; + letter-spacing: 0.01px; + color: $primary-color; + text-decoration: none; +} +section{ + margin-bottom: 50px; +} + +.title{ + padding-left:15%; + height: 60px; + line-height: 60px; + display:inline-block; + text-decoration: none; + color: #FFFFFF; + vertical-align: middle; + font-size: 24px; + overflow-x: hidden; + max-width: 35%; +} + +.home{ + float: right; + padding-right: 15%; + height: 60px; + line-height: 60px; + vertical-align: middle; + color: #fff; + overflow-x: hidden; + font-size: 20px; + display: inline-block; + text-decoration: none; + max-width: 35%; +} + +code{ + background-color: #e8e6e6; + padding: 5px; +} + +.texttitle{ + font-family: $font-family; + font-weight: 500; + font-size: 20px; + color: rgb(33, 33, 33); + line-height: 24px; + letter-spacing: 0.05px; + text-decoration: none; +} + +.texttitle:hover{ + color: $primary-color; +} + +.texttitlemono{ + font-family: $font-family; + font-weight: 500; + font-size: 20px; + color: rgb(33, 33, 33); + line-height: 24px; + letter-spacing: 0.05px; + text-decoration: none; +} + +.cc{ + font-family: $font-family; + font-size: 12px; + line-height: 14px; + letter-spacing: 0.01px; + text-align: center; +} + +.cc a{ + font-family: 'Roboto', sans-serif; + font-size: 12px; + line-height: 14px; + letter-spacing: 0.01px; + color: rgba(0, 0, 0, 0.87); + text-decoration: none; +} + +.cc a:hover{ + text-decoration: underline; +} + +.socialbar{ + display: inline-block; + height: 68px; + margin-top: 10px; +} + +.socialimg{ + height: 40px; + display: inline-block; + padding-right: 5px; +} + +@media screen and (max-width: 700px){ + body { + margin-right: 40px; + margin-left: 20px; + } + .title{ + padding-left: 10px; + max-width: 45%; + } + .home{ + padding-right: 10px; + max-width: 45%; + } +} + diff --git a/res/fb.png b/res/img/fb.png similarity index 100% rename from res/fb.png rename to res/img/fb.png diff --git a/res/gplus.svg b/res/img/gplus.svg similarity index 100% rename from res/gplus.svg rename to res/img/gplus.svg diff --git a/res/twttr.svg b/res/img/twttr.svg similarity index 100% rename from res/twttr.svg rename to res/img/twttr.svg diff --git a/res/umlautconverter.php b/res/js/app.js similarity index 55% rename from res/umlautconverter.php rename to res/js/app.js index 4b435d2..aa81e76 100644 --- a/res/umlautconverter.php +++ b/res/js/app.js @@ -1,48 +1,25 @@ - - */ -class UmlautConverter -{ - function convert($text) - { - $output = str_replace("ä","ä",$text); - $output = str_replace("Ä","Ä",$output); - $output = str_replace("ö","ö",$output); - $output = str_replace("Ö","Ö",$output); - $output = str_replace("ü","ü",$output); - $output = str_replace("Ü","Ü",$output); - $output = str_replace("ß","ß",$output); - return $output; - } -} \ No newline at end of file diff --git a/res/php/ArticleGenerator.php b/res/php/ArticleGenerator.php new file mode 100644 index 0000000..2c433e1 --- /dev/null +++ b/res/php/ArticleGenerator.php @@ -0,0 +1,64 @@ + + */ +class ArticleGenerator { + + function newArticle($directory, $articlefile) + { + + $article = file_get_contents($directory . $articlefile); + + echo "

"; + + if(substr($article, 0, 6) == "%TITLE"){ + $title = substr($article, 8, strpos($article, "\n") - 8); + $link = "./?article=" . substr($articlefile, 0, -3); + echo "

$title

"; + $article = substr($article, strpos($article, "\n") + 1); + } + + if(substr($article, 0, 5) == "%DATE"){ + $date = substr($article, 7, strpos($article, "\n") - 7); + echo "$date"; + $article = substr($article, strpos($article, "\n") + 1); + } + + //TODO Code detection + + echo Parsedown::instance() + ->setBreaksEnabled(true) + ->text($article); + + echo "
" . "\n"; + + } + +} diff --git a/res/Parsedown.php b/res/php/Parsedown.php similarity index 100% rename from res/Parsedown.php rename to res/php/Parsedown.php diff --git a/res/SocialBar.php b/res/php/SocialBar.php similarity index 71% rename from res/SocialBar.php rename to res/php/SocialBar.php index 13ccc08..1674ccf 100644 --- a/res/SocialBar.php +++ b/res/php/SocialBar.php @@ -6,9 +6,9 @@
- + - + - +
\ No newline at end of file diff --git a/res/hrefgenerator.php b/res/php/hrefgenerator.php similarity index 97% rename from res/hrefgenerator.php rename to res/php/hrefgenerator.php index dd8e904..b42e141 100644 --- a/res/hrefgenerator.php +++ b/res/php/hrefgenerator.php @@ -29,7 +29,7 @@ * This is a small tool for converting the title of a post into someting usable * as an url. This is used for the article urls. * - * @author Marcel Kapfer + * @author mmk2410 */ class HrefGenerator {