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)

1246

Comments

  • meshugymeshugy Musician/Hacker ✭✭

    that did it! thanks a million....

  • peregrineperegrine MVP
    edited April 2014

    try loading a jpg as well to see if it works.

    a 50 x 50 or smaller

    and a 500x500 or bigger.

    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.

  • meshugymeshugy Musician/Hacker ✭✭

    all sizes work! thanks....

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

  • vrijvlindervrijvlinder Papillon-Sauvage MVP

    I guess a guest can't download the music :(

  • meshugymeshugy Musician/Hacker ✭✭
    edited April 2014

    I'm already using your plugin, thanks!

    BTW, how do I mod the "insert image" button to provide BBCode tags. It creates a markdown link for the image but I need BBC as that's what I use in my forum.

  • peregrineperegrine MVP
    edited April 2014

    maybe he doesn't realize it, or he did it for a purpose.

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

  • peregrineperegrine MVP
    edited April 2014

    @meshugy snuck in an extra question that has nothing to do with topic :wink: when he knows he should have started a new discussion under the plugin file uploads

    BTW, how do I mod the "insert image" button to provide BBCode tags. It creates a markdown link for the image but I need BBC as that's what I use in my forum

    personally I think insert should be removed.

    i don't use bbcode.

    take a look at line 510 in the js folder fileupload.js

    I don't know bbcode or use it.

    maybe change this

      var insertimg = '<img src="'+ImageAnchor.attr('href')+'" />';
    
    
    to this
    var insertimg = '[img src="'+ImageAnchor.attr('href')+'" /]';
    

    or maybe

    var insertimg = '[img]'+ ImageAnchor.attr('href')+'[/img]';

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

  • vrijvlindervrijvlinder Papillon-Sauvage MVP
    edited April 2014

    var insertimg = '[img] src="'+ImageAnchor.attr('href')+'"[/img]';

    http://www.bbcode.org/examples/?id=10

  • peregrineperegrine MVP
    edited April 2014

    @vrijvlinder said:
    var insertimg = '[img] src="'+ImageAnchor.attr('href')+'"[/img]';

    http://www.bbcode.org/examples/?id=10

    then my last or maybe example is correct and yours not so correct.

    but until you have tested in bbcode it's really not anything but maybe, maybe.

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

  • vrijvlindervrijvlinder Papillon-Sauvage MVP

    Looks like we posted at the same time, I remember this from other forums in the old days, I dislike bbcode personally , coz it's limited ...

  • vrijvlindervrijvlinder Papillon-Sauvage MVP

    but until you have tested in bbcode it's really not anything but maybe, maybe.

    Yes true.. hope when he comes back he can tell us if it works like that..

  • meshugymeshugy Musician/Hacker ✭✭

    I tried your suggestion but it still inserted the image in html:

    <img src="www.image'jpg"/>
    

    I tried flushing my cache to get java to reload but it didn't seem to make a difference. @peregrine is probably right, it's not that useful a feature so maybe I'll just comment it out.

  • vrijvlindervrijvlinder Papillon-Sauvage MVP

    Yea I think you need to do a preg replace and I am not skilled but this is an idea

    $patterns = array('#\[url](.+)\[/url]#', '#(?<=^|\s|\()(http://[^\s\)]+)#');
    $s = preg_replace($patterns, '[url=$1]$1[/url]', $s);  
    
  • peregrineperegrine MVP
    edited April 2014

    @peregrine is probably right, it's not that useful a feature so maybe I'll just comment it out.

    I hate the feature, people misuse it. attachment is great, but don't force me to look at image by inserting it. I deleted the insert feature it on my localhost :)

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

  • thanks for the effort of sharing some solution. Really helps

  • meshugymeshugy Musician/Hacker ✭✭

    @peregrine thanks again for fixing this issue for me several years ago. I'm now having the same issue with the Advanced Editor. Thumbnails do not display at all for attachments. Otherwise, everything seems to work (i.e. the attachments themselves are created and work properly. The thumbnails also get created but just do not display.) See: http://www.djangobooks.com/forum/discussion/15086/rare-1984-jacques-favino-f-hole-archtop

    I checked permissions and everything seems fine. I tried to adapt the solution you provided below to the Advanced Editor but I can't figure it out. Do you have any ideas how to get Thumbnails working in for me in V 2.2.1?

    Thanks!

    Micel

    @peregrine said:
    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.

  • RiverRiver MVP
    edited August 2016

    The editor should theoretically automatically insert the image instead of attaching it, depending on the format (markdown or html, etc).

    If it were me, I would set up a test install

    I would download 2.3b1 and try the editor plugin 'Version' => '1.7.7', from version from 2.3b1 in vanilla 2.2.1 and see what that does, if problem goes away.

    or possibly I would get editor version 1.7.11 from master on github and insert it in vanilla 2.2.1 and see if you have problems.

    and then be aware that an upgrade will over write your changes.

    I would also zip up the editor plugin from 2.2.1

    Pragmatism is all I have to offer. Avoiding the sidelines and providing centerline pro-tips.

  • meshugymeshugy Musician/Hacker ✭✭

    @River I tried using the Advanced Editor plugin from ver 2.3b.1 but it failed to enable. Seems like that version of the plugin will only work if you're actually running the 2.3b.1 core.

    If anyone else has any ideas on how to get thumbnails to display on ver 2.2.1 it would be much appreciated, thanks!

  • RiverRiver MVP
    edited August 2016

    Clean install of 2.2.1 with html markup and advanced editor that comes with 2.2.1 should show the attachment thumbnail image.

    check folder permissions. use html format. check if thumbnail folder and file is written in editor folder

    maybe interference from other plugins.

    Pragmatism is all I have to offer. Avoiding the sidelines and providing centerline pro-tips.

Sign In or Register to comment.