Permalink
Browse files

-Added "annotation" option (defaults to "inline" which is what Google…

… defaults to)

-Updated the script inclusion style to Google's current
  • Loading branch information...
1 parent c806ca8 commit a89fa4f3a259a0c006a3aa5a3ead69f222b975de @therealklanni therealklanni committed Oct 21, 2011
Showing with 11 additions and 3 deletions.
  1. +11 −3 index.php
View
@@ -1,6 +1,7 @@
<?php
$url = isset($_GET['url']) ? $_GET['url'] : "";
$size = isset($_GET['size']) ? $_GET['size'] : "";
+$anno = isset($_GET['annotation']) ? $_GET['annotation'] : "inline";
if(empty($url)) {
echo "Need to specify URL (?url=http://...)";
@@ -22,8 +23,15 @@
<body>
<!-- See http://www.google.com/webmasters/+1/button/index.html -->
<!-- Place this tag where you want the +1 button to render -->
-<g:plusone size="<?php echo htmlspecialchars($size); ?>" href="<?php echo htmlspecialchars($url); ?>"></g:plusone>
-<!-- Place this tag in your head or just before your close body tag -->
-<script type="text/javascript" src="http://apis.google.com/js/plusone.js"></script>
+<g:plusone size="<?php echo htmlspecialchars($size); ?>" annotation="<?php echo htmlspecialchars($anno) ?>" href="<?php echo htmlspecialchars($url); ?>"></g:plusone>
+
+<!-- Place this render call where appropriate -->
+<script type="text/javascript">
+ (function() {
+ var po = document.createElement('script'); po.type = 'text/javascript'; po.async = true;
+ po.src = 'https://apis.google.com/js/plusone.js';
+ var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(po, s);
+ })();
+</script>
</body>
</html>

0 comments on commit a89fa4f

Please sign in to comment.