Created
February 9, 2012 16:46
-
-
Save janv/1781021 to your computer and use it in GitHub Desktop.
Wordpress imgly-gallery fix
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<? | |
function imgly_pics($username = '', $num = 4, $linked = true, $size = 75, $margin = 5, $border = 0, $bordercolor = '#FFFFFF') { | |
$file = @file_get_contents("http://img.ly/images/".$username.".rss"); | |
preg_match_all('/<link>http:\/\/img.ly\/(\w+)<\/link>/i', $file, $matches); | |
$imageids = $matches[1]; | |
for($i = 0; $i < $num; ++$i) { | |
$imageid = $imageids[$i]; | |
if($linked == true) { | |
echo '<a href="http://img.ly/'.$imageid.'" target="_blank">'; | |
} | |
echo '<img src="http://img.ly/show/mini/'.$imageid.'" width="'.$size.'" height="'.$size.'" style="margin: '.$margin.'px; border: '.$border.'px solid '.$bordercolor.';" class="imgly" />'; | |
if($linked == true) { | |
echo '</a>'; | |
} | |
echo "\n\n"; | |
} | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment