aboutsummaryrefslogtreecommitdiffstats
path: root/blogthon.cgi
diff options
context:
space:
mode:
Diffstat (limited to 'blogthon.cgi')
-rwxr-xr-xblogthon.cgi20
1 files changed, 18 insertions, 2 deletions
diff --git a/blogthon.cgi b/blogthon.cgi
index 215c7fd..9d83df5 100755
--- a/blogthon.cgi
+++ b/blogthon.cgi
@@ -242,7 +242,15 @@ entries = []
entries_list = glob(entries_dir + '*.' + entries_suffix)
for entry in entries_list:
- timestamp = os.stat(entry)
+ title = entry.replace(entries_dir, '', 1)
+ title = title.replace('.' + entries_suffix, '')
+
+ stampfile = os.path.join(entries_dir, title + '.stamp')
+ if os.path.exists(stampfile):
+ timestamp = os.stat(stampfile)
+ else:
+ timestamp = os.stat(entry)
+
timestamp = time.localtime(timestamp[8])
entry = timestamp, entry
entries.append(entry)
@@ -468,9 +476,17 @@ else:
date = time.strftime("%c", entry[0])
date_to_compare = time.strftime("%m%Y", entry[0]) # Needed for permalinks
entry = entry[1]
- title = entry.replace('entries/', '', 1)
+ title = entry.replace(entries_dir, '', 1)
title = title.replace('.' + entries_suffix, '')
+ stampfile = os.path.join(entries_dir, title + '.stamp')
+ if not os.path.exists(stampfile):
+ stamp = open(stampfile, 'w')
+ stamp.close()
+ else:
+ date = time.localtime(os.stat(stampfile)[8])
+ date = time.strftime("%c", date)
+
if month_display == date_to_compare or not month_display:
if post_display == title.replace(' ', '-') or not post_display:
if allentries_display == "1" or entry_counter < entries_per_page: