Please upgrade here. These earlier versions are no longer being updated and have security issues.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.

Problem with pictures (avatars and uploads)

1356

Comments

  • also look for the mp3 file in the media table and see if the Path points to

    /FileUpload/xx/xxxxxxxxxxxxxx.mp3

    yes, the link is in the format you suggested.

    also make sure

    uploads/thumbnails/Fileupload allows files to be written to it and

    make sure it has same permissions and owner as

    uploads/Fileupload

    permissions are set at 777 for the all the upload folders including the thumbnail folder. The owner is the same for both the upload and thumbnail folders.

  • around line 34.

    https://github.com/vanillaforums/Addons/blob/851e2f1f5b882add5e5e2250e0be82164a9e65a3/plugins/FileUpload/views/fileupload_functions.php

    for v 1.7.1

    plugins / FileUpload / views / fileupload_functions.php

    you could decho

      }
    
     //  insert these 2 debugging lines  between close bracket and $Result ....
      decho($Src);
      decho($Media);
    
          $Result = Img($Src, array('class' => 'ImageThumbnail', 'width' => GetValue('ThumbWidth', $Media), 'height' => GetValue('ThumbHeight', $Media)));
    

    and post your results.

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

  • I tried your suggestion but it didn't seem to have any impact.

  • peregrineperegrine MVP
    edited April 2014

    it should echo out information. if you are in admin mode and you didn't see extra information on your screen. perhaps you should doublecheck your changes.

    it won't fix the problem but it should present some information to address the problem.

    if decho doesn't work you can make it var_dump. change it take screenshots.

    then comment out the var_dumps after you take screenshots.

    // insert these 2 debugging lines between close bracket and $Result ....
    
        }
        var_dump($Src);
        var_dump($Media);
        $Result = Img($Src, array('class' => 'ImageThumbnail', 'width' => GetValue('ThumbWidth', $Media), 'height' => GetValue('ThumbHeight', $Media)));
    

    post screenshots of the two discussons where you added the gif and mp3. while the decho or var_dump is in place.

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

  • are you sure you have all of the correct files for version 1.7.1

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

  • where would I find 1.8.2? I only see 1.8.1

    1.8.2 is here - I havent tried it though

    https://github.com/vanillaforums/Addons/blob/master/plugins/FileUpload

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

  • I'm not familiar with decho or var_dump. I tried both as you suggested but didn't get any sort of additional info.

    I'm pretty sure I have all the files for FileUplaod 1.7 as I've reinstalled it many times in an attempt to get it to work.

  • 1.8.2 just generates a fatal error when enabled with 2.1b2

  • peregrineperegrine MVP
    edited April 2014

    try this meshugy reinstall 1.7.1

    worked for me on 2.1b2, 2.1b3 and 2.1RC1

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

  • it works!

    What did you change? or did I just have a corrupted version???

  • I think you had bits and pieces of different versions.

    but now you have another issue

    <div class="FilePreview">
    <div class="FileHover">
    <span class="Thumb-Default">
    <span class="Thumb-Extension">mp3</span>
    <img class="ImageThumbnail" height="128" src="/forum/forum/plugins/FileUpload/images/file.png">
    </span>
    <div class="FileMeta">
    

    look at the duplicated forum in src.

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

  • sorry, I don't quite understand. Are you saying there is a problem with the MP3s? The seem to work....

  • can you download it?

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

  • if your image src was this

    <span class="Thumb-Extension">mp3</span>
    <img class="ImageThumbnail" height="128" src="/forum/plugins/FileUpload/images/file.png">
    </span>
    <div class="FileMeta">
    

    you would actually see the correct png file loaded as an icon, your site has two forums in the src image.

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

  • Yes, I see that the png image doesn't display (I was so used to not having any thumbs that it didn't bother me!)

    However, it would be nice if it worked correctly.

    What do you mean by "duplicated forum?" I only have one that I know of....

  • He means the url to the image is this

    src="/forum/forum/plugins/FileUpload/images/file.png

  • meshugymeshugy ✭✭
    edited April 2014

    yes, i see the problem now. I have no idea why the link for the png has "forum/forum" in it. Perhaps some redirect my developer did at some point? Not sure.

  • are you running ssl ? could be due to prettyUrl also...

    found something relating to that

    http://www.mojoportal.com/Forums/Thread.aspx?pageid=5&t=8733~-1

  • peregrineperegrine MVP
    edited April 2014

    in views/fileupload_functions.php

    I changed this function and it seems to work.

    from

    function DefaultMediaThumbnail($Media) {
      $Result = '<span class="Thumb-Default">'.
       '<span class="Thumb-Extension">'.pathinfo($Media['Name'], PATHINFO_EXTENSION).'</span>'.
       Img(Asset('/plugins/FileUpload/images/file.png'), array('class' => 'ImageThumbnail', 'height' => GetValue('ThumbHeight', $Media))).
       '</span>';
    
       return $Result;
    }
    

    to this

        function DefaultMediaThumbnail($Media) {
          $Result = '<span class="Thumb-Default">'.
           '<span class="Thumb-Extension">'.pathinfo($Media['Name'], PATHINFO_EXTENSION).'</span>'.
           Img('plugins/FileUpload/images/file.png', array('class' => 'ImageThumbnail', 'height' => GetValue('ThumbHeight', $Media))).
           '</span>';
    
           return $Result;
        }
    

    display the correct image now.

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

  • I can't click and download the mp3 as a guest.

    do you give guests the permission to download on your site.

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

Sign In or Register to comment.