|
<?php |
|
function show_flickr_feed_gallery_by_tags($tags = null, $limit = null) { |
|
$gallery = new Flickr_Feed_Gallery(); |
|
$options = $gallery->get_flickr_feed_options(); |
|
if($tags) { |
|
$options->tags = $tags; |
|
} |
|
if($limit) { |
|
$options->image_limit = $limit; |
|
} |
|
$url = $gallery->get_flickr_json_url($options); |
|
echo ("<span id='ffg_marker_span' style='display:none;'></span>"); |
|
echo ("<script> var ffg_options = ['".$gallery->get_flickr_json_url($options)."','".$options->image_size."','".$options->image_limit."']; </script>"); |
|
echo ("<style>"); |
|
include('flickr-feed-gallery.css'); |
|
echo ("</style>"); |
|
?> |
|
<script> |
|
(function() { |
|
jQuery(document).ready(ffg_show_image_content); |
|
})(); |
|
function ffg_show_image_content() { |
|
jQuery.getJSON(ffg_options[0], |
|
function(result) { |
|
jQuery.each(result.items, |
|
function(i,item) { |
|
ffg_append_img_content(i,item); |
|
if(i+1>=ffg_options[2]) return false; |
|
} |
|
) |
|
} |
|
); |
|
} |
|
|
|
function ffg_append_img_content(i,item) { |
|
var img_url = item.media.m; |
|
var iu = img_url.replace("_m",ffg_options[1]); |
|
var content = '<a title="'+item.title+'" href="'+item.link+'" class="ffg_link_css" id="ffg_link_'+i+'">' |
|
content = content+ '<img alt="'+item.title+'" class="ffg_img_css" id="ffg_img_'+i+'"'+' src="'+iu+'">'; |
|
content = content + '</a>'; |
|
jQuery(content).insertAfter('#ffg_marker_span'); |
|
} |
|
</script> |
|
<?php |
|
} |
|
|
|
function show_flickr_feed_gallery() { |
|
$gallery = new Flickr_Feed_Gallery(); |
|
$options = $gallery->get_flickr_feed_options(); |
|
$url = $gallery->get_flickr_json_url($options); |
|
echo ("<span id='ffg_marker_span' style='display:none;'></span>"); |
|
echo ("<script> var ffg_options = ['".$gallery->get_flickr_json_url($options)."','".$options->image_size."','".$options->image_limit."']; </script>"); |
|
echo ("<style>"); |
|
include('flickr-feed-gallery.css'); |
|
echo ("</style>"); |
|
?> |
|
<script> |
|
(function() { |
|
jQuery(document).ready(ffg_show_image_content); |
|
})(); |
|
function ffg_show_image_content() { |
|
jQuery.getJSON(ffg_options[0], |
|
function(result) { |
|
jQuery.each(result.items, |
|
function(i,item) { |
|
ffg_append_img_content(i,item); |
|
if(i+1>=ffg_options[2]) return false; |
|
} |
|
) |
|
} |
|
); |
|
} |
|
|
|
function ffg_append_img_content(i,item) { |
|
var img_url = item.media.m; |
|
var iu = img_url.replace("_m",ffg_options[1]); |
|
var content = '<a title="'+item.title+'" href="'+item.link+'" class="ffg_link_css" id="ffg_link_'+i+'">' |
|
content = content+ '<img alt="'+item.title+'" class="ffg_img_css" id="ffg_img_'+i+'"'+' src="'+iu+'">'; |
|
content = content + '</a>'; |
|
jQuery(content).insertAfter('#ffg_marker_span'); |
|
} |
|
</script> |
|
<?php |
|
} |
|
|
|
?> |