<?php
echo $before_widget;
//Widget Title
if ($instance['title']) {
    echo $before_title . $instance['title'] . $after_title;
}
$uniq_id = uniqid();
?>
<?php wp_enqueue_script("jflickrfeed.min.js", THEMEMAKERS_THEME_URI . "/js/jflickrfeed.min.js") ?>

<div class="entry-holder">
	
	<ul id="flickr-badge-<?php echo $uniq_id; ?>" class="clearfix flickr-badge"></ul>
	
	<div class="more text-align-left">
	
		<a target="_blank" href="http://www.flickr.com/photos/64078429@N06">
			<?php _e('View more photos', THEMEMAKERS_THEME_FOLDER_NAME); ?> <span>&raquo;</span>
		</a>
	
	</div>
	
</div><!--/ .entry-holder-->

<script type="text/javascript">
	
    jQuery(document).ready(function() {
        /* Flickr Photos --> Begin */	
        jQuery('ul#flickr-badge-<?php echo $uniq_id; ?>').jflickrfeed({
            limit: <?php echo $instance['imagescount']; ?>,
            qstrings: {
                id: '<?php echo $instance['username']; ?>'
            },
            itemTemplate: '<li><a href="http://www.flickr.com/photos/<?php echo $instance['username']; ?>"><img src="{{image_s}}" alt="{{title}}" /></a></li>'
        }, function() {
            jQuery('#flickr-badge-<?php echo $uniq_id; ?> li:nth-child(3n)').addClass('last');
        });
        /* Flickr Photos --> End */
    });

</script>

</div>

