Skip to content

Instantly share code, notes, and snippets.

@travismillerweb
Created July 3, 2012 17:11
Show Gist options
  • Save travismillerweb/3041107 to your computer and use it in GitHub Desktop.
Save travismillerweb/3041107 to your computer and use it in GitHub Desktop.
PHP - Pin It Button Dynamic Add
<?php
//[TM][5/18/2012]
//Pin it button on Image Gallery
//Used along with jQuery Library and Pinterest social buttion JavaScript
//Not Complete. You must add parameters for pinning a specific image and appending to the a href address
$domain = $_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'];
$homepage = "www.[domain].com/";
$containsThis = strpos($domain, "image-galleries/");
if ($containsThis <> false )
{
echo "<a href='http://pinterest.com/pin/create/button/' class='pin-it-button' count-layout='horizontal'><img border='0' src='//assets.pinterest.com/images/PinExt.png' title='Pin It' /></a>";
}
else
{
echo " ";
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment