Users running a non-download version of Vanilla (pulled from github), on branch release/2019.016 or master from the last 2 weeks should upgrade to release/2019.017 or latest master for security reasons. Downloaded official open sources releases are not affected.
Please upgrade here. These earlier versions are no longer being updated and have security issues.

How do i keep images but remove the thumbnail/box?

This discussion is related to the fileupload addon.

I'm a vanilla newby and i just finally finished getting members to not be able to delete, and now i'm hoping to learn how to have the images appear, but not the box with the thumbnail underneath it? Thank you to anyone who could help.

Comments

  • link_files.php

                $this->FireEvent('BeforeFile');
    
                      $haystack=strtolower($this->EventArguments['Object']->Body);
                      $needle=strtolower(Url(MediaModel::Url($Media)));
                      if (!strlen(strstr($haystack,$needle))>0) {    
    

    FileUpload is a bit buggy, but nonetheless is a greatwork done. Thanx to authors.

  • edited May 2012

    One more bug curing - correct thumbs display when editing and posting

    in fileupload.js

    /*                                   
               $('.Comment a.EditComment').click(function() {   
                  $('.Comment > .Attachments', $(this).closest('.Item')).remove();
               });
    */
    

    in \forum\applications\vanilla\js\discussion.js

      +++    function FileUpload_DisplayCorrect(this_)
      +++    {
      +++    x=$('.Comment > .Attachments', $(this_).closest('.Item'));
      +++    if (x.css('display')=='none'){x.show();}else{x.hide();}
      +++    }
    
    
       // Reveal the textarea and hide previews.
       $('a.WriteButton, a.Cancel').livequery('click', function() {
    
         +++ FileUpload_DisplayCorrect(this);
    
    
       // Edit comment
       $('a.EditComment').livequery('click', function() {
    
        +++  FileUpload_DisplayCorrect(this);
    
  • 422422 Developer MVP

    dont use /* and */ to comment out JS or php

  • ?

    hmm, I always use this commenting way.

    P.S. You can look into the discussion.js -
    i've just found there the string '/* Options */'

    Is it an error ? :)

  • 422422 Developer MVP

    You are correct. /* is perfectly acceptable.

    But, most coders would use ( at least all the ones I know ) //

    In js you can use all three commenting systems.

    //
    /* and
    <!--

    But for my usage I always use //

  • hbfhbf wiki guy? MVP

    /* has some utility, but can also trip you up. I usually use it only within a line to comment out a section of a line. I dont use it to comment a full line or a block of lines.

    // is better for full line comments generally. As it is clearer and helps to make each line remain consistant on indent.

  • edited May 2012

    When you debug Your code you may use

    //*

    a large block of code

    //*/

    This form gives you a quick way to comment\uncomment a block
    by the only starting slash.

  • edited May 2012

    in \forum\applications\vanilla\js\discussion.js

    Modifying core files means that your changes will get overwritten during version upgrades. Not a wise idea.

    I can't figure out from your code what changes you are suggesting be made to link_files.php.

    This plugin has been giving me so many headaches for months on end; it is literally shocking how such an important piece of functionality can be handled so cavalierly, and by a core dev, too.

    But I just found a key piece of the puzzle of what's been broken -- part of Vanilla core (uploads) just doesn't work on XAMPP etc on Windows. So there's that, anyway.

  • UnderDogUnderDog Moderator

    From that same thread:

    jetman said:
    Seems a function Gdn_Upload::Parse is broken on Windows.

    Try to comment the line $Name = str_replace('\\', '/', $Name); in library/core/class.upload.php

  • Yep, that works for me on localhost.

  • edited May 2012

    stavthewonderchicken said:

    in \forum\applications\vanilla\js\discussion.js

    Modifying core files means that your changes will get overwritten during version upgrades. Not a wise idea.

    Then you may wait until the same changes are made in public core. And It would be a very wise idea - to have bugs and wait for years.

    stavthewonderchicken said:
    I can't figure out from your code what changes you are suggesting be made to link_files.php.

    For understanding You need to open this little file in the editor to see changes.
    It wouldn't be a problem for some lines of code if you of course have no bad eyesight .

  • edited May 2012

    @johansonlocker Holy hell, man, back off. I realize that other people are snarky and unhelpful around here, but I've never said an unkind thing to you. I just wanted some clarification on the code you posted, was all.

    This sort of attitude is why I stay away from here these days.

  • 422422 Developer MVP

    @stavthewonderchicken

    I think if you re read what he put, he wasnt having a go. I read it differently to you .. I think.

  • I don't understand, then, I guess.

Sign In or Register to comment.