+ * @license MIT License
+ * @link http://marcel-kapfer.de/rangitaki
+ */
class BlogListGenerator
{
-
/**
* A function to generate a blog nav item
*
- * @param string $directory The directory of the blog file
- * @param string $blogname The name of the blog file
- * @param string $blogmaintitle The name of the main blog
+ * @param string $directory The directory of the blog file
+ * @param string $blogname The name of the blog file
+ * @param string $blogmaintitle The name of the main blog
+ *
+ * @return None
*/
function listBlog($directory, $blogname, $blogmaintitle)
{
- $blog = file_get_contents($directory . $blogname); // get content of the blog file
- $blog = $blog . "\n"; // add a line break as a security measurement
- if (substr($blog, 0, 6) == "%TITLE") { // check if the first line includes a title
- $blog = substr($blog, 8, strpos($blog, "\n") - 8); // grab the title
- if ($blog == "main") { // if on main blog
- echo "$blogmaintitle"; // create a nav item to the main blog
+ // get content of the blog file;
+ $blog = file_get_contents($directory . $blogname);
+ // add a line break as a security measurement
+ $blog = $blog . "\n";
+ // check if the first line includes a title
+ if (substr($blog, 0, 6) == "%TITLE") {
+ // grab the title
+ $blog = substr($blog, 8, strpos($blog, "\n") - 8);
+ // if on main blog
+ if ($blog == "main") {
+ // create a nav item to the main blog
+ echo "$blogmaintitle";
} else {
- $link = "./?blog=" . substr($blogname, 0, -3); // create a link to the blog
- echo "$blog"; // create a nav item to the blog
+ // create a link to the blog
+ $link = "./?blog=" . substr($blogname, 0, -3);
+ // create a nav item to the blog
+ echo "$blog";
}
}
}
@@ -65,16 +63,46 @@ class BlogListGenerator
/**
* A function to get the name of a blog
*
- * @param string $file The path of the blog file
- * @return string
+ * @param string $file The path of the blog file
+ *
+ * @return string
*/
function getName($file)
{
- $blog = file_get_contents($file); // get the content of the blog file
- $blog = $blog . "\n"; // add a line break as a securit measure
- if(substr($blog, 0, 6) == "%TITLE") { // check if first line includes a title
- $blog = substr($blog, 8, strpos($blog, "\n") - 8); // grab the title
- return $blog; // return it
+ // get the content of the blog file
+ $blog = file_get_contents($file);
+ // add a line break as a securit measure
+ $blog = $blog . "\n";
+ // check if first line includes a title
+ if (substr($blog, 0, 6) == "%TITLE") {
+ // grab the title
+ $blog = substr($blog, 8, strpos($blog, "\n") - 8);
+ return $blog;
+ }
+ }
+
+ /**
+ * A function to recieve the amount of articles
+ * of a blog
+ *
+ * @param string $blog the blog name
+ *
+ * @return int Amount of files
+ */
+ static function getArticleAmount($blog)
+ {
+ $directory = "./articles/" . $blog . "/";
+ if (!file_exists($directory)) {
+ return 0;
+ } else {
+ $i = 0;
+ $handle = opendir($directory);
+ while (($file = readdir($handle)) !== false ) {
+ if (!in_array($file, array('.','..'))) {
+ $i++;
+ }
+ }
+ return $i;
}
}
diff --git a/res/php/Pagination.php b/res/php/Pagination.php
new file mode 100644
index 0000000..c97678d
--- /dev/null
+++ b/res/php/Pagination.php
@@ -0,0 +1,58 @@
+
+ * @license MIT License
+ * @link http://marcel-kapfer.de/rangitaki
+ */
+require_once "BlogListGenerator.php";
+
+if ($pagination) {
+?>
+
+
diff --git a/themes/background-img.css b/themes/background-img.css
index 91b312e..29a9588 100644
--- a/themes/background-img.css
+++ b/themes/background-img.css
@@ -137,6 +137,47 @@ body{
box-shadow: 0px 1px 1.5px 1.5px rgba(62, 62, 62, 0.3);
}
+.button {
+ border-width: 1px;
+ border-style: solid;
+ box-shadow: 0px 1px 1.5px 1.5px rgba(42, 42, 42, 0.65);
+ -moz-box-shadow: 0px 1px 1.5px 1.5px rgba(42, 42, 42, 0.65);
+ -webkit-box-shadow: 0px 1px 1.5px 1.5px rgba(42, 42, 42, 0.65);
+ border-radius: 2px;
+ letter-spacing: 0.4px;
+ font-weight: 700;
+ font-size: 14px;
+ transition-property: box-shadow;
+ transition-delay: 50ms;
+ transition-duration: 125ms;
+ transition-timing-function: ease;
+ -moz-transition-property: box-shadow;
+ -moz-transition-delay: 50ms;
+ -moz-transition-duration: 125ms;
+ -moz-transition-timing-function: ease;
+ -webkit-transition-property: box-shadow;
+ -webkit-transition-delay: 50ms;
+ -webkit-transition-duration: 125ms;
+ -webkit-transition-timing-function: ease;
+}
+
+.button:hover, .button:hover {
+ box-shadow: 0.5px 1.8px 2.1px 1.4px rgba(32, 32, 32, 0.85);
+ -moz-box-shadow: 0.5px 1.8px 2.1px 1.4px rgba(32, 32, 32, 0.85);
+ -webkit-box-shadow: 0.5px 1.8px 2.1px 1.4px rgba(32, 32, 32, 0.85);
+}
+
+.pag_next{
+ background-color: #ff4415;
+ border-color: #ff4415;
+}
+
+.pag_prev{
+ background-color: #fff;
+ border-color: #fff;
+ color: #383838;
+}
+
.footer{
font-size: 12px;
text-align: center;
diff --git a/themes/material-dark.css b/themes/material-dark.css
index 884b794..a984ef9 100644
--- a/themes/material-dark.css
+++ b/themes/material-dark.css
@@ -133,6 +133,47 @@ body{
box-shadow: 0px 1px 1.5px 1.5px rgba(42, 42, 42, 0.65);
}
+.button{
+ border-width: 1px;
+ border-style: solid;
+ box-shadow: 0px 1px 1.5px 1.5px rgba(42, 42, 42, 0.65);
+ -moz-box-shadow: 0px 1px 1.5px 1.5px rgba(42, 42, 42, 0.65);
+ -webkit-box-shadow: 0px 1px 1.5px 1.5px rgba(42, 42, 42, 0.65);
+ border-radius: 2px;
+ letter-spacing: 0.4px;
+ font-weight: 700;
+ font-size: 14px;
+ transition-property: box-shadow;
+ transition-delay: 50ms;
+ transition-duration: 125ms;
+ transition-timing-function: ease;
+ -moz-transition-property: box-shadow;
+ -moz-transition-delay: 50ms;
+ -moz-transition-duration: 125ms;
+ -moz-transition-timing-function: ease;
+ -webkit-transition-property: box-shadow;
+ -webkit-transition-delay: 50ms;
+ -webkit-transition-duration: 125ms;
+ -webkit-transition-timing-function: ease;
+}
+
+.button:hover, .button:hover {
+ box-shadow: 0.5px 1.8px 2.1px 1.4px rgba(32, 32, 32, 0.85);
+ -moz-box-shadow: 0.5px 1.8px 2.1px 1.4px rgba(32, 32, 32, 0.85);
+ -webkit-box-shadow: 0.5px 1.8px 2.1px 1.4px rgba(32, 32, 32, 0.85);
+}
+
+.pag_next{
+ background-color: #ff4415;
+ border-color: #ff4415;
+}
+
+.pag_prev{
+ background-color: #424242;
+ border-color: #424242;
+ color: #CCCCCC;
+}
+
.footer{
font-size: 12px;
text-align: center;
diff --git a/themes/material-light.css b/themes/material-light.css
index 46df0d5..fff3a0c 100644
--- a/themes/material-light.css
+++ b/themes/material-light.css
@@ -137,6 +137,47 @@ body{
box-shadow: 0px 1px 1.5px 1.5px rgba(62, 62, 62, 0.3);
}
+.button {
+ border-width: 1px;
+ border-style: solid;
+ box-shadow: 0.4px 1px 1.5px 1px #aaa;
+ -moz-box-shadow: 0.4px 1px 1.5px 1px #aaa;
+ -webkit-box-shadow: 0.4px 1px 1.5px 1px #aaa;
+ border-radius: 2px;
+ letter-spacing: 0.4px;
+ font-weight: 700;
+ font-size: 14px;
+ transition-property: box-shadow;
+ transition-delay: 50ms;
+ transition-duration: 125ms;
+ transition-timing-function: ease;
+ -moz-transition-property: box-shadow;
+ -moz-transition-delay: 50ms;
+ -moz-transition-duration: 125ms;
+ -moz-transition-timing-function: ease;
+ -webkit-transition-property: box-shadow;
+ -webkit-transition-delay: 50ms;
+ -webkit-transition-duration: 125ms;
+ -webkit-transition-timing-function: ease;
+}
+
+.button:hover, .button:hover {
+ box-shadow: 0.5px 1.8px 2.1px 1.4px #aaa;
+ -moz-box-shadow: 0.5px 1.8px 2.1px 1.4px #aaa;
+ -webkit-box-shadow: 0.5px 1.8px 2.1px 1.4px #aaa;
+}
+
+.pag_next{
+ background-color: #ff4415;
+ border-color: #ff4415;
+}
+
+.pag_prev{
+ background-color: #fff;
+ border-color: #fff;
+ color: #383838;
+}
+
.footer{
font-size: 12px;
text-align: center;