aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNathan Lasseter <nathan@4574.co.uk>2012-10-29 23:17:12 +0000
committerNathan Lasseter <nathan@4574.co.uk>2012-10-29 23:17:12 +0000
commit84cfb101931e84e52d49e85147296602708049e3 (patch)
tree9bb401a40b40686c7e5a64d52cb0404c4e4db6f8
parent6d3ce1d38378d64858b5aceee4f2058064918762 (diff)
Tweet button
-rw-r--r--.gitignore1
-rw-r--r--styles.css7
-rw-r--r--viewpost.php7
3 files changed, 13 insertions, 2 deletions
diff --git a/.gitignore b/.gitignore
index 1c5103b..5f247ad 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,2 +1,3 @@
.htpasswd
posts/
+*.swp
diff --git a/styles.css b/styles.css
index 335fa40..f72669f 100644
--- a/styles.css
+++ b/styles.css
@@ -19,6 +19,13 @@ a.title {
font-weight: normal;
}
+#tweet {
+ font-size: 8pt;
+ font-weight: normal;
+ text-decoration: none;
+ color: black;
+}
+
a.toplink {
font-size: 14pt;
letter-spacing: -1px;
diff --git a/viewpost.php b/viewpost.php
index e4c6cab..d07399b 100644
--- a/viewpost.php
+++ b/viewpost.php
@@ -8,8 +8,11 @@
$file = $_GET['post'];
echo "<div>\n";
- echo "<a class=\"title\" href=\"{$blogRoot}post/" . urlencode($file) . "\">$file <span id=\"perma\">[Permalink]</span></a>\n";
-
+ echo "<a class=\"title\" href=\"{$blogRoot}post/" . urlencode($file) . "\">$file <span id=\"perma\">[Permalink]</span></a> ";
+?>
+ <a href="https://twitter.com/share" class="twitter-share-button" id="tweet" data-via="twitterapi" data-lang="en">[Tweet]</a>
+ <script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0];if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src="https://platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");</script>
+<?php
$stat = stat("{$blogPosts}$file");
$date = date('d-m-Y H:i T', $stat['mtime']);
echo "<span class=\"date\">$date</span>\n";