Hi All,
I am having an issue with my image rotating PHP function code which I have attached below.
1% of the time it can rotate through 3 of the 10 pics before stopping. 99% of the time it doesn't work at all.
The issue that is popping up in the Developer console of Firefox is "[12:25:28.802] Image corrupt or truncated: http://www.mywebsite.com/wp-content/uploads/script-thumbs/79/7979_5.jpg @ http://www.mywebsite.com/wp-content/uploads/script-thumbs/79/7979_5.jpg".
It is not specific to Firefox.
Any assistance would be appreciated.
function script_thumb($prefix,$title){
$saved_thmb = get_post_meta( get_the_ID(),'saved_thmb',true);
$subPath = tubeace_sub_dir_path(get_the_ID());
$upload_dir = wp_upload_dir();
$thumb_url = $upload_dir[baseurl]."/script-thumbs/".$subPath."/";
if($saved_thmb==1){
$thumb = $thumb_url."/".get_the_ID()."_1.jpg";
} elseif($saved_thmb>1) {
$def_thmb = get_post_meta( get_the_ID(),'def_thmb',true);
$thumb = $thumb_url."/".get_the_ID()."_".$def_thmb.".jpg";
$rotate_thumbs = "onmouseover=\"thumbStart('$prefix-".get_the_ID()."', $saved_thmb, '$thumb_url');\"
onmouseout=\"thumbStop('$prefix-".get_the_ID()."', '$thumb_url', '$def_thmb');\"";
} else {
return;
}
$thumb = "<img class=\"img-responsive\" src=\"$thumb\" $rotate_thumbs id=\"$prefix-".get_the_ID()."\" alt=\"".esc_attr($title)."\">";
return $thumb;
}
Cheers,
Shaun