What Do You Need In The Xf2 Xengallery Version? Vote for your choices here: http://www.sonnb.com/threads/what-do-you-need-in-the-xf2-xengallery-version.1539/

Help Thumbs Not Being Generated

Discussion in 'XenGallery' started by Mehdi, Feb 20, 2017.

  1. Mehdi

    Mehdi Authorized Member Authorized

    I installed the plugin and started creating albums and adding youtube videos, setup the youtube API and everything, tried rebuilding the cache, the albums, etc .. nothing, no thumb wants to appear, and I don't see any error in the server logs, what could it be ?

    https://www.evernote.com/l/AFpdLzBn2M9Jm4e8kRM0pnnlMVbTodQKYxc


    Mehdi
     
  2. Mehdi

    Mehdi Authorized Member Authorized

  3. Mehdi

    Mehdi Authorized Member Authorized

    Hello ? some support possible ? @sonnb
     
  4. sonnb

    sonnb Administrator Staff Member

  5. Mehdi

    Mehdi Authorized Member Authorized

  6. sonnb

    sonnb Administrator Staff Member

    Can you remove the key restriction and try again?
     
  7. Mehdi

    Mehdi Authorized Member Authorized

    Just did and rebuilt albums and thumbnails .. still not working :/
     
  8. sonnb

    sonnb Administrator Staff Member

    Try to add a new video, no need to rebuild. If no success please share me an admin login via conversation. I will try to work on it for you.
     
  9. Mehdi

    Mehdi Authorized Member Authorized

    It worked for the newly added video ..

    Does this mean I have to re-enter all videos ? Cause i've spent quite sometime filling out the galery


    Mehdi
     
  10. sonnb

    sonnb Administrator Staff Member

    Let me work on it Mehdi. Ideally it must be handled by the Rebuild, otherwise it is a bug.
     
  11. Mehdi

    Mehdi Authorized Member Authorized

    Ok no worries, let me know what to do next.
     
  12. sonnb

    sonnb Administrator Staff Member

    If you can wait, wait me for the new update otherwise I will show you how to fix it in the code.
     
  13. Mehdi

    Mehdi Authorized Member Authorized

    When is new update ?

    I'm fairly technical so I should be able to make the change if you show me how :)


    Mehdi
     
  14. sonnb

    sonnb Administrator Staff Member

    Ok. So I will post the modification needed for you tonight.
     
    Mehdi likes this.
  15. Mehdi

    Mehdi Authorized Member Authorized

    Cool, thanx :)
     
  16. sonnb

    sonnb Administrator Staff Member

    I have just tried the rebuilds and it works. Can you show me the screenshot of the rebuild configuration UI you use?
     
  17. Mehdi

    Mehdi Authorized Member Authorized

    rebuildsonnb.jpg

    Also tried with rebuild thumbnail information checked.
     
  18. sonnb

    sonnb Administrator Staff Member

    I saw the issue. The issue is if the thumbnail was not generated when the video was posted, the rebuilder will not rebuild them.

    Could you open library/sonnb/XenGallery/DataWriter/Video.php. Line 112, remove the if condition and retry again?
     
  19. Mehdi

    Mehdi Authorized Member Authorized

    I tried commenting all the ifs in that region nothing works ..

    Code:
    if (!empty($contentData) && $contentData['content_type'] === sonnb_XenGallery_Model_Video::$contentType
                    && empty($contentData['file_size']) && $options['thumbnail'])
            {
                $embedData = $contentDataModel->getEmbedVideoData($videoData['video_type'], $videoData['video_key']);
                if (!empty($embedData['thumbnailUrl'])) {
                    $tempFile = tempnam(XenForo_Helper_File::getTempDir(), 'xf');
                    try
                    {
                        $client = XenForo_Helper_Http::getClient($embedData['thumbnailUrl']);
                        $response = $client->request('GET');
    
                        if ($response->isSuccessful())
                        {
                            @file_put_contents($tempFile, $response->getBody());
                        }
                        else
                        {
                            return;
                        }
                    }
                    catch (Exception $e)
                    {
                        return;
                    }
                    
                    $contentDataModel->createContentDataThumbnailFiles($tempFile, $contentData);
                    @unlink(@$tempFile);
                }
            }
    Please tell me exactly what to change ..


    Mehdi
     
  20. sonnb

    sonnb Administrator Staff Member

    Change to thí:
    PHP:
    if (!empty($contentData) && $contentData['content_type'] === sonnb_XenGallery_Model_Video::$contentType
                    
    && empty($contentData['file_size']) && $options['thumbnail'])
            {
                
    $embedData $contentDataModel->getEmbedVideoData($videoData['video_type'], $videoData['video_key']);
                    
    $tempFile tempnam(XenForo_Helper_File::getTempDir(), 'xf');
                    try
                    {
                        
    $client XenForo_Helper_Http::getClient($embedData['thumbnailUrl']);
                        
    $response $client->request('GET');

                        if (
    $response->isSuccessful())
                        {
                            @
    file_put_contents($tempFile$response->getBody());
                        }
                        else
                        {
                            return;
                        }
                    }
                    catch (
    Exception $e)
                    {
                        return;
                    }
                    
                    
    $contentDataModel->createContentDataThumbnailFiles($tempFile$contentData);
                    @
    unlink(@$tempFile);
            }
     

Share This Page