• This forum has been archived. New threads and replies may not be made. All add-ons/resources that are active should be migrated to the Resource Manager. See this thread for more information.

[8wayRun.Com] XenMedio (Media)

Status
Not open for further replies.
Hm... You want to do an upload...? Look at... Zend_File_Transfer_Adapter_Http. Here's my upload code for importing BB Codes:
PHP:
		$fileTransfer = new Zend_File_Transfer_Adapter_Http();
		if ($fileTransfer->isUploaded('upload_file'))
		{
			$fileInfo = $fileTransfer->getFileInfo('upload_file');
			$fileName = $fileInfo['upload_file']['tmp_name'];
		}
Do a dump on $fileInfo['upload_file'] to see what's available.
 
I think you're a little confused on what the thumbnail generation does...

1 - it gets the thumbnail URL...
2 - gets thumb information (IMAGETYPE constant) from thumbnail URL
3 - creates image from thumbnail URL and IMAGETYPE
4 - takes newly created image and thumb-crop-centers the image to 160x90px

Steps 2 and 3, dont work with my current code unless fURL is enabled. Without fURL, you can't run processes on external entities hosted on different services. So I can't run "getImageSize" (step 2), and I cant run "createFromFile" (step 3).

So what I need to do is add two new steps:
1.5 - store image from thumbnail URL into temporary file
5 - delete temporary file

How would I do that? There is no "upload" involved.
 
I got response from my host, they are unable to allow "allow_url_fopen" on shared host. :(
if there's no other solution then this mod is useless for me because I can not add video thumbnails into Media Library :(

Hello,
I have put a php.ini file in the root of the forum with the following line:

allow_url_fopen = On

This solves the problem.
I am not an expert and I do not know if this can generate some security problem. I hope the confirmation of one of the experts on the forum ;)
 
Hello,
I have put a php.ini file in the root of the forum with the following line:

allow_url_fopen = On

This solves the problem.
I am not an expert and I do not know if this can generate some security problem. I hope the confirmation of one of the experts on the forum ;)
Hmm mine doesn't work, same error.

Error with modified Thumbs.php file
getimagesize() [function.getimagesize]: URL file-access is disabled in the server configuration

Error with original Thumbs.php file:
Invalid image type given. Expects IMAGETYPE_XXX constant.
 
Maybe this is an issue that you need to ask Kier or Mike about, on how to best implement, as they know their code backwards and the Zend framework.
 
This should be close to what you'd need:
PHP:
// init http client with the thumbnail url, and try to fetch it.
$client = new Zend_Http_Client($thumb);
$response = $client->request();

if ( $response->isSuccessful() ) {
    // load the thumbnail data into $thumbData, put it into a temp file,
    // then getimagesize the temp file.
    $thumbData = $request->getBody();
    $tempFile = tempnam(sys_get_temp_dir(), 'medio');
    file_put_contents($tempFile, $thumbData);
    $imageInfo = getimagesize($tempFile);
    unlink($tempFile);
} else {
    // error (404 not found, etc. I assume)
}
 
Okay... attached is a new version of Modules/Thumbs.php

If you are having problems with thumbnails, upload this new version and see if it works. If it does work, I will include this file in the next package sometime in the coming weeks.
 

Attachments

Okay... attached is a new version of Modules/Thumbs.php

If you are having problems with thumbnails, upload this new version and see if it works. If it does work, I will include this file in the next package sometime in the coming weeks.
oh yes.. it works fine, thanks so much Jaxel. :)
 
Well, Jaxel helped me out with attempting to fix the issue and we can't figure it out. (Thanks for the attempted help, Jaxel)

But, we're still getting the following message...

Forbidden

You don't have permission to access /forum/media/submit on this server.
Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.

And, while testing we had turned off the URL-friendly option and we still got this...

Forbidden

You don't have permission to access /forum/index.php on this server.
Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.

Jaxel suggested going to our hosting company for assistance. Any other suggestions that may help? :confused:
 
Sitemap generation coming in next version:

Code:
<?xml version="1.0" encoding="utf-8"?>
<sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
  <sitemap>
    <loc>http://www.8wayrun.com/data/sitemaps/media_01.xml</loc>
    <lastmod>2010-12-13T01:02:16+00:00</lastmod>
  </sitemap>
</sitemapindex>
 
Okay... attached is a new version of Modules/Thumbs.php
Well, for the Megavideo, being the only one I have issue with, it now allows the import of the media and doesn't fail trying to retrieve it, however; it still gives an error message after submitting, being:

Server Error
Read timed out after 10 seconds
  1. Zend_Http_Client_Adapter_Socket->_checkSocketReadTimeout() in Zend/Http/Client/Adapter/Socket.php at line 467
  2. Zend_Http_Client_Adapter_Socket->read() in Zend/Http/Client.php at line 985
  3. Zend_Http_Client->request() in EWRmedio/Model/Thumbs.php at line 11
  4. EWRmedio_Model_Thumbs->buildThumb() in EWRmedio/Model/Media.php at line 154
  5. EWRmedio_Model_Media->updateMedia() in EWRmedio/ControllerPublic/Media.php at line 954
  6. EWRmedio_ControllerPublic_Media->inputMediaUpdate() in EWRmedio/ControllerPublic/Media.php at line 307
  7. EWRmedio_ControllerPublic_Media->actionMediaSubmit() in XenForo/FrontController.php at line 303
  8. XenForo_FrontController->dispatch() in XenForo/FrontController.php at line 132
  9. XenForo_FrontController->run() in /*******/index.php at line 15
 
I have a funny feeling that Megavideo will never pull an image, because they don't have one on the video page itself, as they run ads and you get the ad instead.
 

This is great! And something that I forgot to mention which used to be in the vB version of your mod/add-on :D

I NEED A NEW COMPUTER! SOMEONE BUY ME ONE!

As soon as we get XenMedio working and the Portal styling fixes (small posts cause style break in portal and Firefox styling issues with dates/replies not displaying correctly) then we will be donating for brand removal :D
 
Upon upgrading to Beta 5, we seem to be missing our tab. I was looking through the thread, but couldn't find it. Can someone point me to the fix, I know it's around here somewhere? :)
 
Status
Not open for further replies.
Top Bottom