aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Ritter <xeno@goliath.thehappy.de>2009-03-02 01:50:14 +0100
committerStefan Ritter <xeno@goliath.thehappy.de>2009-03-02 01:50:14 +0100
commit6ec1a0bae938440a6dae440930e364104d92f8ff (patch)
tree15021d54c7cab86794897be7c4d68394626b3c96
parent90abea32b64d7f4420e1666ceb59855b729635f6 (diff)
entries_per_page is working now
-rwxr-xr-xblogthon.cgi12
1 files changed, 6 insertions, 6 deletions
diff --git a/blogthon.cgi b/blogthon.cgi
index cb149bb..c82aa3a 100755
--- a/blogthon.cgi
+++ b/blogthon.cgi
@@ -35,11 +35,11 @@ action = cgi.FieldStorage()
month_display = action.getvalue('m')
post_display = action.getvalue('p')
static_display = action.getvalue('s')
-site_display = action.getvalue('i')
+allentries_display = action.getvalue('a')
if not month_display: month_display = ""
if not post_display: post_display = ""
if not static_display: static_display = ""
-if not site_display: site_display = ""
+if not allentries_display: allentries_display = ""
print 'Content-type: text/html\n'
print '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"'
@@ -115,11 +115,10 @@ else: # Show regular entry
entry = entry[1]
title = entry.replace('entries/', '', 1)
title = title.replace('.txt', '')
- entry_counter += 1
if month_display == date_to_compare or not month_display:
if post_display == title or not post_display:
- if entry_counter <= entries_per_page:
+ if allentries_display == "1" or entry_counter < entries_per_page:
content = open(entry, "r")
if permalinks:
print ' <div class="entrytitle"><a href="?p=' + title + '" class="entrytitle">' + title + ' <small>(' + date + ')</small></a></div>'
@@ -131,9 +130,10 @@ else: # Show regular entry
print ' </p></div>'
print ' <br /><br />'
content.close()
+ entry_counter += 1
- if entry_counter > entries_per_page: # Display pagelist
- print ' <div class="entry"><a href=?>[previous page]</a> <a href=?>[next page]</a></div>'
+ if not month_display and not post_display and not allentries_display and entry_counter == entries_per_page: # Display pagelist
+ print ' <div class="entry"><a href=?a=1>View all entries...</a></div>'
print ' </div>'
print ' </body>'