Warning: ini_set() has been disabled for security reasons in /home/a1y33a/public_html/wp-content/plugins/wordpress-flickr-manager/js/wfm-lightbox.php on line 2
Warning: Cannot modify header information - headers already sent by (output started at /home/a1y33a/public_html/wp-content/plugins/wordpress-flickr-manager/js/wfm-lightbox.php:2) in /home/a1y33a/public_html/wp-content/plugins/wordpress-flickr-manager/js/wfm-lightbox.php on line 3
Warning: Cannot modify header information - headers already sent by (output started at /home/a1y33a/public_html/wp-content/plugins/wordpress-flickr-manager/js/wfm-lightbox.php:2) in /home/a1y33a/public_html/wp-content/plugins/wordpress-flickr-manager/js/wfm-lightbox.php on line 4
Warning: Cannot modify header information - headers already sent by (output started at /home/a1y33a/public_html/wp-content/plugins/wordpress-flickr-manager/js/wfm-lightbox.php:2) in /home/a1y33a/public_html/wp-content/plugins/wordpress-flickr-manager/js/wfm-lightbox.php on line 5
function updateFlickrHref(anchor) {
var image = anchor.getElementsByTagName('img');
image = image[0];
var chkClass = image.getAttribute("class");
if (chkClass === null) {
chkClass = image.getAttribute("className");
}
if(chkClass && chkClass.match("flickr-original")) {
anchor.setAttribute("href", image.getAttribute("longdesc"));
} else {
var image_link = image.getAttribute("src");
var imageSize = "";
if(chkClass) {
var testResult = chkClass.match(/flickr\-small|flickr\-medium|flickr\-large/);
switch(testResult.toString()) {
case "flickr-large":
imageSize = "_b";
break;
case "flickr-medium":
imageSize = "";
break;
case "flickr-small":
imageSize = "_m";
break;
}
}
if(image_link.match(/[s,t,m]\.jpg/)) {
image_link = image_link.split("_");
image_link.pop();
image_link[image_link.length - 1] = image_link[image_link.length - 1] + imageSize + ".jpg";
image_link = image_link.join("_");
} else if(!image_link.match(/b\.jpg/)) {
image_link = image_link.split(".");
image_link.pop();
image_link[image_link.length - 1] = image_link[image_link.length - 1] + imageSize + ".jpg";
image_link = image_link.join(".");
}
anchor.setAttribute("href", image_link);
}
}
function prepareWFMImages() {
$('a[@rel*=flickr-mgr]').click(function() {
if($(this).attr("rel") == "flickr-mgr") { // Individual Photo
var origUrl = $(this).attr("href");
updateFlickrHref(this);
$(this).lightbox({
fixedNavigation: true,
fileLoadingImage: "http://dragonlings.com/wp-content/plugins/wordpress-flickr-manager/images/loading-3.gif",
fileBottomNavCloseImage: "http://dragonlings.com/wp-content/plugins/wordpress-flickr-manager/images/closelabel.gif"
});
$(this).attr("rel","");
$(this).lightbox.start(this);
var anchor = this;
setTimeout(function() {
$(anchor).attr("rel","flickr-mgr");
$(anchor).attr("href",origUrl);
}, 100);
} else { // Member of photoset
var origUrls = [];
var setRel = $(this).attr("rel");
$("a").each(function(){
if(this.href && (this.rel == setRel)){
origUrls.push([$(this).attr("href"), $(this).attr("title")]);
updateFlickrHref(this);
}
});
origUrls.reverse();
$(this).lightbox({
fixedNavigation: true,
fileLoadingImage: "http://dragonlings.com/wp-content/plugins/wordpress-flickr-manager/images/loading-3.gif",
fileBottomNavCloseImage: "http://dragonlings.com/wp-content/plugins/wordpress-flickr-manager/images/closelabel.gif"
});
$(this).lightbox.start(this);
// Delay changing the URL's back because Internet Explorer doesn't wait for execution to finish
setTimeout(function() {
$("a").each(function(){
if(this.href && (this.rel == setRel)){
var url = origUrls.pop();
$(this).attr("href",url[0]);
}
});
}, 100);
}
return false;
});
}
$(document).ready(function() {
prepareWFMImages();
});