Post Thumbnails problem
-
Hi I am using the Video thumbnails plugin and I am editing it to make it support Mpora.com videos aswell as the others it supports. I have done most of the work but have come unstuck on the final bit.
The problem I have is that the URL for the video thumbnail doesn’t have a file extension which makes the plugin not find the video however when if I add for example ‘.jpeg’ to the end of the URL for example ‘$thumbnail = (“https://video.mpora.com/image/EIuyHpM2W/m/.jpeg”); it does find an image but there is an error uploading it i think. basically when I go to the upload URL it displays this:
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN"> <html><head> <title>301 Moved Permanently</title> </head><body> <h1>Moved Permanently</h1> <p>The document has moved <a href="https://video.mpora.com/image/k3jNpUohr/m/.jpg/">here</a>.</p> </body></html>
Making me think there has been some sort of error uploading but I don’t know what.
Here is the code I have added to the plugin:
// Mpora function getMporaThumbnail($id) { $thumbnail = ("https://video.mpora.com/image/EIuyHpM2W/m/.jpg"); return $thumbnail; };
// Mpora if($new_thumbnail==null) { // Find ID from Mpora embed url preg_match('/mporaplayer_([A-Za-z0-9]+)/i', $markup, $matches); // Now if we've found a Mpora video ID, let's set the thumbnail URL if(isset($matches[1])) { $mpora_thumbnail = getMporaThumbnail($matches[1]); $new_thumbnail = $mpora_thumbnail; } }
So basically I can’t work out how to get the image that has no file name according to WordPress and upload it to the site to use.
The rest of the file can be found here: https://www.trick-tips.com/uncategorized/plugin-code
Thanks for any help,
Matt
- The topic ‘Post Thumbnails problem’ is closed to new replies.