Comments by disqus added

master
Stefan Krulj 15 years ago
parent a1d47787b5
commit f307babfd0
  1. 20
      pylog.py
  2. 34
      pylog_config.py
  3. 13
      style.css

@ -98,7 +98,11 @@ def disp_file_dict(d,keys):
'disp':os.path.normpath(f)}).replace('&','&')+'">')
print name+'</a> - <span class="entrydate">',
print datetime.fromtimestamp(int(k)).strftime(cfg.datefmt),
print '</span></h1>'
print '</span>&nbsp;'
sys.stdout.write('<a class="commentcount" href="'+cfg.topurl+script+'?')
sys.stdout.write(urllib.urlencode({'path': os.path.normpath(os.path.dirname(f)), \
'disp':os.path.normpath(f)}).replace('&','&amp;')+'#disqus_thread"></a>')
print '</h1>'
prev_actions[typ](f)
@ -256,9 +260,17 @@ try:
disp_actions[typ](validdisp)
else:
disp_list(path)
except OSError:
pass
except OSError as ose:
# This is here for various errors that
# may occur when accessing files
print '<span style="color:#f00>-- [!]&nbsp;Error&nbsp;[!] --<br>'
print ose.strerror + '</span>'
if 'disp' in form:
print '<hr>'
print '<div id="footer">'
print cfg.footer
print '</div>'
print '</div>'
print '</body>'
print '</html>'

@ -1,17 +1,47 @@
title = 'PyLog' # Title displayed on the browser window
title = 'PyLog' # Title displayed on the browser window/tab
blogtitle= 'Plog' # The blog's title
subtitle=u'produced py Powertomato \xb0\u0DF4\xb0' # The text to be displayed under the blog title
header="""
<link rel="stylesheet" type="text/css" href="style.css" />
<link rel="stylesheet" type="text/css" href="source.css" />
<script type="text/javascript">
/* * * CONFIGURATION VARIABLES: EDIT BEFORE PASTING INTO YOUR WEBPAGE * * */
var disqus_shortname = 'pylog'; // required: replace example with your forum shortname
/* * * DON'T EDIT BELOW THIS LINE * * */
(function () {
var s = document.createElement('script'); s.async = true;
s.type = 'text/javascript';
s.src = 'http://' + disqus_shortname + '.disqus.com/count.js';
(document.getElementsByTagName('HEAD')[0] || document.getElementsByTagName('BODY')[0]).appendChild(s);
}());
</script>
""" # This header will be printed in the <head> section of the html file
footer="""
<div id="disqus_thread"></div>
<script type="text/javascript">
/* * * CONFIGURATION VARIABLES: EDIT BEFORE PASTING INTO YOUR WEBPAGE * * */
var disqus_shortname = 'pylog'; // required: replace example with your forum shortname
/* * * DON'T EDIT BELOW THIS LINE * * */
(function() {
var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true;
dsq.src = 'http://' + disqus_shortname + '.disqus.com/embed.js';
(document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);
})();
</script>
<noscript>Please enable JavaScript to view the <a href="http://disqus.com/?ref_noscript">comments powered by Disqus.</a></noscript>
<a href="http://disqus.com" class="dsq-brlink">blog comments powered by <span class="logo-disqus">Disqus</span></a>
""" # This footer will be printed at the end of the <body> tag
datefmt='%Y-%m-%d' # format of the date which is displayed next to the entry
# See pythons manual reference for time.strptime for details
contentdir="cnt" # directory where the content is located
numofposts=5 # number of previews on the base site
numfeed=5 # number of previews in the feed
numfeed=5 # number of entries in the feed
topurl="http://n0g.at/~powertomato/pylog/" # The URL which specifies the scripts location
# if someone knows how to obtain it using CGI

@ -176,6 +176,15 @@ h4 {
counter-increment: subsubkap;
}
#footer h2:before, #footer h3:before, #footer h4:before {
content: '';
}
#dsq-footer {
display: none;
}
.entryheader {
color:#5598ca;
}
@ -185,6 +194,10 @@ h4 {
color:#cccccc;
}
.commentcount {
font-size:9pt;
}
#content {
padding:5px;
background-color:#f6f6f6;

Loading…
Cancel
Save