aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Ritter <xeno@thehappy.de>2009-05-17 23:19:07 +0200
committerStefan Ritter <xeno@thehappy.de>2009-05-17 23:19:07 +0200
commita38cb989fa843def08fd6d18bc301e62941aa63c (patch)
tree51dd490feee7ab1a309de477f59e24263e46ac17
parentaf872acbd30f49a6f1a96573b27072d2a4c11de4 (diff)
Rewrite session Part 1
-rwxr-xr-xblogthon.cgi88
-rw-r--r--styles/blogthon.css300
-rw-r--r--styles/blogthon_img/header_background.jpgbin0 -> 19014 bytes
-rw-r--r--styles/blogthon_img/title_background.pngbin327 -> 0 bytes
4 files changed, 252 insertions, 136 deletions
diff --git a/blogthon.cgi b/blogthon.cgi
index bc246ab..4cdfe55 100755
--- a/blogthon.cgi
+++ b/blogthon.cgi
@@ -6,7 +6,8 @@
# To Public License, Version 2, as published by Sam Hocevar. See
# http://sam.zoy.org/wtfpl/COPYING for more details.
-# Author: Stefan Ritter <xeno@thehappy.de>
+# Authors: Stefan Ritter <xeno@thehappy.de>
+# Adrian Vondendriesch <disco-stu@disco-stu.de>
# Description: A simple blogging software
import cgi, os, time, glob, re, md5, sys, random
@@ -190,6 +191,7 @@ if feed_display == "atom":
# Generate regular page
else:
document_header("xhtml-transitional")
+ # XHTML Header
print ' <head>'
print ' <title>' + blog_title + '</title>'
print ' <meta http-equiv="content-type" content="text/html; charset=utf-8" />'
@@ -198,65 +200,93 @@ else:
print ' <link rel="stylesheet" type="text/css" href="styles/' + style + '" />'
print ' </head>'
print ' <body>'
- print ' <div class="title"><a href="?" class="title">' + blog_title + '</a></div>'
- print ' <div class="feeds">'
- print ' <a href="?feed=rss"><img src="styles/images/rss.png" alt="rss" /></a>'
- print ' <a href="?feed=atom"><img src="styles/images/atom.png" alt="atom" /></a>'
+ print ''
+ # Site header
+ print ' <div class="header">'
+ print ' <div class="header_title">'
+ print ' <a href="?" class="header_link">' + blog_title + '</a>'
+ print ' </div>'
print ' </div>'
+ print ''
+ # RSS feed
+ print ' <div class="rss">'
+ if os.path.exists('styles/' + style.replace('.css', '') + '_img/rss.jpg'):
+ print ' <a href="?feed=rss"><img src="styles/' + style.replace('.css', '') + '_img/rss.jpg"></a>'
+ else:
+ print ' <a href="?feed=rss" class="rss_link">rss</a>'
+ print ' </div>'
+ print ''
+ # Atom feed
+ print ' <div class="atom">'
+ if os.path.exists('styles/' + style.replace('.css', '') + '_img/atom.jpg'):
+ print ' <a href="?feed=atom"><img src="styles/' + style.replace('.css', '') + '_img/atom.jpg></a>'
+ else:
+ print ' <a href="?feed=atom" class="atom_link">atom</a>'
+ print ' </div>'
+ print ''
- print ' <div class="screen"><div class="sidebar">'
-
- # Sidebar: Staticpages
+ # Staticpages
if staticpages == "True":
staticpages = []
staticpages_list = glob.glob(staticpages_dir + '*')
staticpages_list.sort()
- print ' <div class="sidebarentry">'
- print ' <small>pages</small><br />'
+ print ' <div class="pages">'
+ print ' <div class="pages_title">pages</div>'
+ print ' <div class="pages_list">'
+ print ' <ul class="pages_list">'
for staticpage in staticpages_list:
title = re.sub('\w+?\/\d+?-', '', staticpage)
link = re.sub('\w+?\/', '', staticpage)
- # The ultimative lookshe-hack *g*
- if title == "lookshe":
- print ' &nbsp;<a href="?s=' + link + '">/me</a>&nbsp;<br />'
- else:
- print ' &nbsp;<a href="?s=' + link + '">' + title + '</a>&nbsp;<br />'
-
- if monthlist == "True": print ' <br />'
+ print ' <li class="pages_list_entry"><a href="?s=' + link + '" class="pages_list_entry">' + title + '</a></li>'
+ print ' </ul>'
print ' </div>'
+ print ' <div class="pages_footer"></div>'
+ print ' </div>'
+ print ''
- # Sidebar: Monthlist
+ # Monthlist
if monthlist == "True":
olddate = ""
- print ' <div class="sidebarentry">'
- print ' <small>months</small><br />'
+ print ' <div class="months">'
+ print ' <div class="months_title">months</div>'
+ print ' <div class="months_list">'
+ print ' <ul class="months_list">'
for entry in entries:
date = time.strftime("%m%Y", entry[0])
date_display = time.strftime("%h %Y", entry[0])
if not olddate == date:
- print ' &nbsp;<a href="?m=' + date + '">' + date_display + '</a>&nbsp;<br />'
+ print ' <li class="months_list_entry"><a href="?m=' + date + '" class="months_list_entry">' + date_display + '</a></li>'
olddate = date
- if linklist == "True": print ' <br />'
+ print ' </ul>'
print ' </div>'
+ print ' <div class="months_footer"></div>'
+ print ' </div>'
+ print ''
- # Sidebar: Linklist
+ # Linklist
if linklist == "True":
- print ' <div class="sidebarentry">'
- print ' <small>links</small><br />'
+ print ' <div class="linklist">'
+ print ' <div class="linklist_title">links</div>'
+ print ' <div class="linklist_list">'
+ print ' <ul class="linklist_list">'
try:
content = open("linklist", "r")
for line in content:
if line.strip() is "":
- print ' <br />'
+ print ''
else:
- print ' &nbsp;<a href="' + line.split(" ")[0] + '" target="_blank">' + line.split(" ", 1)[1].strip() + '</a>&nbsp;<br />'
+ print ' <li class="linklist_list_entry"><a href="' + line.split(" ")[0] + '" target="_blank" class="months_list_entry">' + line.split(" ", 1)[1].strip() + '</a></li>'
content.close()
except:
- print ' <br />'
+ print ''
+ print ' </ul>'
print ' </div>'
+ print ' <div class="linklist_footer"></div>'
+ print ' </div>'
+ print ''
- print ' </div>'
print ' <div class="content">'
+ print '<br><br><br><br><br><br><br>'
if static_display != "": # Show Staticpage
content = open(staticpages_dir + static_display, "r")
diff --git a/styles/blogthon.css b/styles/blogthon.css
index 4adb10d..472d8a8 100644
--- a/styles/blogthon.css
+++ b/styles/blogthon.css
@@ -1,107 +1,193 @@
-.html, body {
- background: #000;
- color: #FFF;
- margin: 0px;
- overflow-x: hidden;
-}
-
-img {
- border: 0;
-}
-
-a:link, a:active, a:visited, a:hover {
- font-family: Verdana;
- font-size: 12px;
- color: #FC3;
- text-decoration: none;
-}
-
-a.title:link, a.title:hover, a.title:active, a.title:visited {
- position: absolute;
- text-align: center;
- width: 100%;
- height: 25px;
- background-image: url(blogthon_img/title_background.png);
- font-family: Verdana;
- font-weight: bold;
- font-size: 18px;
- color: #FC3;
-}
-
-.screen {
- position: relative;
- margin: auto;
- top: 30px;
-}
-
-.content { /* Container for entrytitle and entry */
- margin-left: 15px;
-}
-
-.entrytitle {
- font-family: Verdana;
- font-weight: bold;
- font-size: 14px;
- color: #335599;
- text-decoration: underline;
-}
-
-a.entrytitle:link, a.entrytitle:hover, a.entrytitle:visited, a.entrytitle:active {
- font-family: Verdana;
- font-weight: bold;
- font-size: 12px;
- color: #335599;
- text-decoration: underline;
-}
-
-.entry {
- font-family: Verdana;
- font-size: 12px;
- color: #FFF;
- margin: 15px;
- width: 600px;
-}
-
-.sidebar {
- margin-right: 15px;
- margin-left: 20px;
- margin-bottom: 20px;
- float: right;
-}
-
-.sidebarentry {
- font-family: Verdana;
- font-size: 12px;
- color: #5577BB;
- text-align: center;
- padding-left: 8px;
- padding-right: 8px;
- background: #111;
-}
-
-a.comment:link, a.comment:hover, a.comment:active, a.comment:visited {
- font-family: Helvetica;
- font-size: 10px;
-}
-
-input, textarea {
- font-family: Verdana;
- font-size: 10px;
- display: block;
- width: 300px;
- background: #333;
- color: #FFF;
- border: thin dotted;
-}
-
-input#submit {
- width: 120px;
-}
-
-.feeds {
- position: absolute;
- top: 4px;
- right: 5px;
-}
-
-# vim: set tw=0 ts=4:
+/*
+* Author: Adrian Vondendriesch <disco-stu@disco-stu.de>
+*/
+
+body {
+ font-family: Verdana, Times New Roman, Courier New;
+ font-size: 10px;
+ margin: 0px;
+ padding: 0px;
+ }
+
+img {
+ border: 0px;
+ }
+
+div.header {
+ height: 120px;
+ width: 99%;
+ margin: auto;
+ margin-top: 5px;
+ text-align: center;
+ display: table;
+ border: 3px double #000000;
+ background-image: url("blogthon_img/header_background.jpg");
+ background-repeat: no-repeat;
+ }
+
+ div.header_title {
+ font-size: 18px;
+ letter-spacing: 5px;
+ vertical-align: middle;
+ display: table-cell;
+ }
+
+ div.header_subtitle {
+ font-size: 14px;
+ vertical-align: middle;
+ }
+
+ a.header_link {
+ text-decoration: none;
+ color: #395434;
+ font-weight: bold;
+ font-style: italic;
+ }
+
+div.rss {
+ display: inline;
+ height: 25px;
+ position: absolute;
+ top: 15px;
+ right: 41px;
+ }
+
+ a.rss_link {
+ text-decoration: none;
+ color: #AAAAAA;
+ }
+
+div.atom {
+
+ display: inline;
+ height: 25px;
+ position: absolute;
+ top: 15px;
+ right: 14px;
+ }
+
+ a.atom_link {
+ text-decoration: none;
+ color: #AAAAAA;
+ }
+
+div.pages {
+ width: 100%;
+ position: absolute;
+ top: 110px;
+ }
+
+ div.pages_title {
+ text-align: center;
+ display: none;
+ font-weight: bold;
+ font-size: 14px;
+ letter-spacing: 2px;
+ }
+
+ div.pages_list {
+ }
+
+ ul.pages_list {
+ text-align: center;
+ list-style-type: none;
+ margin-top: 0px;
+ margin-bottom: 0px;
+ padding: 0px;
+ }
+
+ li.pages_list_entry {
+ display: inline;
+ margin-right: 10px;
+ }
+
+ a.pages_list_entry {
+ color: #000000;
+ text-decoration: none;
+ font-size: 12px;
+ font-style: italic;
+
+ }
+
+ div.pages_footer {
+ float: none;
+ }
+
+div.months {
+ width: 100px;
+ }
+
+ div.months_title {
+ color: #999999;
+ font-weight: bold;
+ font-size: 14px;
+ letter-spacing: 1px;
+ }
+
+ div.months_list {
+ }
+
+ ul.months_list {
+ text-align: center;
+ list-style-type: none;
+ margin-top: 0px;
+ margin-bottom: 0px;
+ padding: 0px;
+ margin-left: -40px;
+ }
+
+ li.months_list_entry {
+ margin-right: 10px;
+ }
+
+ a.months_list_entry {
+ color: #000000;
+ text-decoration: none;
+ font-size: 12px;
+ font-style: italic;
+
+ }
+
+ div.months_footer {
+ float: none;
+ }
+
+div.linkslist {
+ width: 100px;
+ }
+
+ div.linklist_title {
+ color: #999999;
+ font-weight: bold;
+ font-size: 14px;
+ letter-spacing: 1px;
+ }
+
+ div.linklist_list {
+ }
+
+ ul.linklist_list {
+ text-align: center;
+ list-style-type: none;
+ margin-top: 0px;
+ margin-bottom: 0px;
+ padding: 0px;
+ margin-left: -40px;
+ }
+
+ li.linklist_list_entry {
+ margin-right: 10px;
+ }
+
+ a.linklist_list_entry {
+ color: #000000;
+ text-decoration: none;
+ font-size: 12px;
+ font-style: italic;
+
+ }
+
+ div.linklist_footer {
+ float: none;
+ }
+
diff --git a/styles/blogthon_img/header_background.jpg b/styles/blogthon_img/header_background.jpg
new file mode 100644
index 0000000..943214d
--- /dev/null
+++ b/styles/blogthon_img/header_background.jpg
Binary files differ
diff --git a/styles/blogthon_img/title_background.png b/styles/blogthon_img/title_background.png
deleted file mode 100644
index 961d0fe..0000000
--- a/styles/blogthon_img/title_background.png
+++ /dev/null
Binary files differ