Blogtitle in Header

This commit is contained in:
mmk2410 2015-07-03 10:59:54 +02:00
parent cdfccd1754
commit 51cd71846b
6 changed files with 48 additions and 4 deletions

View file

@ -33,7 +33,7 @@ THE SOFTWARE.
$getblog = filter_input(INPUT_GET, "blog"); $getblog = filter_input(INPUT_GET, "blog");
$getarticle = filter_input(INPUT_GET, "article"); $getarticle = filter_input(INPUT_GET, "article");
$gettag = filter_input(INPUT_GET, "tag"); $gettag = filter_input(INPUT_GET, "tag");
$url = "http://" . filter_input(INPUT_SERVER, "HTTP_HOST") . filter_input(INPUT_SERVER, "REQUEST_URI"); $url = "http://" . filter_input(INPUT_SERVER, "HTTP_HOST") . filter_input(INPUT_SERVER, "REQUEST_URI");
?> ?>
<head> <head>
@ -73,7 +73,7 @@ THE SOFTWARE.
if (strlen($blog) >= 3 && substr($blog, -3) == ".md") { if (strlen($blog) >= 3 && substr($blog, -3) == ".md") {
if ($getblog == "") { if ($getblog == "") {
if ($blog != "main.md") { if ($blog != "main.md") {
if(empty($blogmainname)){ if (empty($blogmainname)) {
$blogmaintitle = $blogtitle; $blogmaintitle = $blogtitle;
} else { } else {
$blogmaintitle = $blogmainname; $blogmaintitle = $blogmainname;
@ -82,7 +82,7 @@ THE SOFTWARE.
} }
} else { } else {
if ($getblog . ".md" != $blog) { if ($getblog . ".md" != $blog) {
if(empty($blogmainname)){ if (empty($blogmainname)) {
$blogmaintitle = $blogtitle; $blogmaintitle = $blogtitle;
} else { } else {
$blogmaintitle = $blogmainname; $blogmaintitle = $blogmainname;
@ -114,7 +114,25 @@ THE SOFTWARE.
<div class="main"> <div class="main">
<div class="header"> <div class="header">
<img src="./res/img/menu.svg" class="nav-img" /> <img src="./res/img/menu.svg" class="nav-img" />
<nobr><a href="./" class="title"><?php echo $blogtitle; ?></a></nobr> <nobr><span class="title"><a href="./"><?php echo $blogtitle; ?>
<?php
if (empty($getblog)) {
if (!empty($blogmainname)) {
?>
<?php
echo $blogmainname;
}
} else {
?>
</a>
<a href="<?php echo "./?blog=$getblog"?>">
<?php
echo BlogListGenerator::getName("./blogs/$getblog.md");
}
?>
</a>
</span>
</nobr>
</div> </div>
<?php <?php
if (file_exists("blogs/$blog.md") && $getarticle == "" && $blogintro == "yes" && $gettag == "") { if (file_exists("blogs/$blog.md") && $getarticle == "" && $blogintro == "yes" && $gettag == "") {

View file

@ -67,6 +67,11 @@ body{
left: 75px; left: 75px;
} }
.title > a{
text-decoration: none;
color: #fff;
}
.nav-img{ .nav-img{
height: 26px; height: 26px;
padding: 19px; padding: 19px;

View file

@ -45,4 +45,13 @@ class BlogListGenerator {
} }
} }
function getName($file){
$blog = file_get_contents($file);
$blog = $blog . "\n";
if(substr($blog, 0, 6) == "%TITLE"){
$blog = substr($blog, 8, strpos($blog, "\n") - 8);
return $blog;
}
}
} }

View file

@ -47,6 +47,10 @@ body{
position: absolute; position: absolute;
} }
.title > a{
color: #fff;
}
.nav{ .nav{
background-color: #fff; background-color: #fff;
border-right: 1px solid #e0e0e0; border-right: 1px solid #e0e0e0;

View file

@ -43,6 +43,10 @@ body{
position: absolute; position: absolute;
} }
.title > a{
color: #fff;
}
.nav{ .nav{
background-color: #424242; background-color: #424242;
border-right: 1px solid #1f1f1f; border-right: 1px solid #1f1f1f;

View file

@ -43,6 +43,10 @@ body{
position: absolute; position: absolute;
} }
.title > a{
color: #fff;
}
.nav{ .nav{
background-color: #fff; background-color: #fff;
border-right: 1px solid #e0e0e0; border-right: 1px solid #e0e0e0;