Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge pull request #1 from therealklanni/patch-1

Adding "annotation" and updating script inclusion
  • Loading branch information...
commit 2dc660e433effeecd2eb6a3102a4e177ad13958a 2 parents c806ca8 + a89fa4f
@olalonde authored
Showing with 11 additions and 3 deletions.
  1. +11 −3 index.php
View
14 index.php
@@ -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>
Please sign in to comment.
Something went wrong with that request. Please try again.