• 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.

Dakis

Well-known member
I'm getting this message as I try to upload a YouTube video.

What am I doing wrong?
We are still getting this error trying to submit a video:

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.

I have checked xenmedio permissions for administrators they are all set to "allow" and for registered users they are all set to "allow" except moderate & administrate media which are set to "Default".

Are there any other permissions that need checking or is this some other kind of problem?
 

Sagar

Active member
I am also on shared host. My host asked me to add following line in root .htaccess (not forum root, domain root) and it worked. Try this, else you will have to contact your host.
Code:
php_value allow_url_fopen 1




Thanks, I tried that and got error.
getimagesize() [function.getimagesize]: URL file-access is disabled in the server configuration

I'm on a shared host, it would be difficult to change something in php.ini, what did you add in .htaccess to fix that? may be that work for me too.
 

Veer

Well-known member
I am also on shared host. My host asked me to add following line in root .htaccess (not forum root, domain root) and it worked. Try this, else you will have to contact your host.
Code:
php_value allow_url_fopen 1
Thanks Sagar, I added this but still no change. :(
 

Veer

Well-known member
I asked for my host, but still no response.

Jaxel, bro can you provide a fix or solution?
 

Jaxel

Well-known member
8WayRun.Com has been UPGRADED to XenForo!

This of course means the demo for this mod is now:
http://www.8wayrun.com/media/

Yes, as you can see, I imported my old vB4 data... unfortunately, this import script is not very feasible for public use. Because when you import from vB4 to XF, user_ids are not maintained... I had to go through my entire database and update user_ids for every single media. Thankfully only 80 users had uploaded videos, so it didn't take very long.

However, because I had over 700 comments, they all had to be wiped out.
 

ddmmh

Well-known member
very nice jaxel, looks good. Ill be donating next week as im almost finished my site also :)
 

Veer

Well-known member
Based on my experience, this seems to be an issue with Server Configuration, not sure if Jaxel will be able to help much
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 :(
 

Jaxel

Well-known member
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 :(
I'm trying to figure out a way to do it with Zend_Http instead of URL_fopen, but its confusing me...

Please give me a URL to your forum.
 

Jeremy

Well-known member
I'm trying to figure out a way to do it with Zend_Http instead of URL_fopen, but its confusing me...


Please give me a URL to your forum.
Jaxel. Use Zend_Http_Client (as Shorten_URL does...)

Setup:
PHP:
try
			{
				$client = new Zend_Http_Client('http://apiURL.com/', array(
					'timeout' => $timeout
				));

				$request = $client->request();

				if ($request->isSuccessful())
				{
					return $request->getBody();
				}
			}
			catch (Zend_Http_Client_Exception $e)
			{
				return FALSE;
			}
If you are doing YouTube, I suggest you look at Zend_Gdata_YouTube and Zend_Gdata_YouTube_* for the YouTube URLs. $request->getBody() returns the exact contents of the return, so if its XML you'll need to do a decode on that. Same with JSon.
 

Jaxel

Well-known member
King Kovifor... I have no idea what you just said...

This is the current code:
Code:
    public function buildThumb($mediaID, $thumb)
    {
        $targetLoc = XenForo_Helper_File::getExternalDataPath().'/media/'.$mediaID.'.jpg';
        $imageInfo = getimagesize($thumb);

        if ($image = XenForo_Image_Abstract::createFromFile($thumb, $imageInfo[2]))
        {
            $ratio = 160/90;
            $width = $image->getWidth();
            $height = $image->getHeight();

            if ($width/$height > $ratio)
            {
                $image->thumbnail($width, '90');
            }
            else
            {
                $image->thumbnail('160', $height);
            }

            $width = $image->getWidth();
            $height = $image->getHeight();
            $offWidth = ($width - 160) / 2;
            $offHeight = ($height - 90) / 2;

            $image->crop($offWidth, $offHeight, '160', '90');
            $image->output(IMAGETYPE_JPEG, $targetLoc);
        }
    }
The problem is getimagesize wont work unless fURL is enabled. $thumb is the location of the thumbnail.

Basically, all I need to do is take $thumb, store it in a temporary file... create the thumbnail image, then delete the temporary file... How would I do all this using Zend_Http?
 
Status
Not open for further replies.
Top