1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

[Done] Retrieve image URLs

Discussion in 'Plugin Suggestion Box' started by carlo75, Oct 16, 2009.

Thread Status:
Not open for further replies.
  1. carlo75

    carlo75 Design & Development

    Another interesting plugin request:

    retrieve image URLs like Digg system... and display thumbnails not stretched, but that are cropped to a fixed dimensions to avoid theme and site deforming.

    ziczac.it offers a very nice image retrieve system, if you want to check, try to register and post some news.

    I know this is a very difficult plugin, I try with pligg and curls many and many times with no success. I find also this http://simplehtmldom.sourceforge.net/ to parse tag IMG, or something like that http://www.sastgroup.com/guide-per-il-web/php-scaricare-da-remoto-unimmagine-usando-gd-o-curl with no sucess...
    Last edited by a moderator: Oct 16, 2009
  2. Sunny

    Sunny New Member

    This plug-in would be a great addition.
  3. davidshq

    davidshq Member

    ::bump:: i agree.
  4. nothingman

    nothingman Active Member

    Rated as Excellent :)
  5. newbieone

    newbieone New Member

    Placing images in submissions from URL source

    Hi all, I am new to Hotarucms, but I have been playing around with it, I have managed to include snapshots of the URLs that are submitted for new submissions etc.

    Please please, forgive my attempts at explanation I am not a coder or developer was just mucking about with Hotaru and managed to do it.

    Ok this is how I did it, firstly get an account with websnapr and you will receive a url with your own key in it.

    i.e. http://images.websnapr.com/?size=T&key=xxxxxxxxxi&url=

    this mod requires the use of the Submit plugin for user submissions, go to plugins/submit/templates

    Copy list.php and post.php to your theme folder and edit the copies as below. Don't edit plugin template files directly or you'll lose the edits when you upgrade the template. Hotaru will automatically use the file you put in your theme folder. [Nick]

    In list.php find the following: <?php $hotaru->plugins->pluginHook('submit_pre_show_post'); ?>

    Just after add the following

    <img class='webshot' src='http://images.websnapr.com/?size=T&key=xxxxxxxi&url=<?php echo $hotaru->post->origUrl; ?>' alt="<?php echo $hotaru->post->title; ?>">

    I used the size=T for a smaller image on this section from websnapr

    In post.php find the following: <?php if ($hotaru->post->useContent) { ?>

    Just after add the following:

    <img class='webshot' src='http://images.websnapr.com/?size=S&key=QqxaJv2T2Lqi&url=url<?php echo $hotaru->post->origUrl; ?>' alt="<?php echo $hotaru->post->title; ?>">

    I used the size=S for a larger image on the actual post page for this.

    The pictures themselves are obviously from websnapr but you can use snapcasa etc just change the "src='webshot url of choice=url.

    What about SEO and alt tags? Well this was a problem last night for me as the last thing you want is to have loads of webshots on your website with out alt tags.

    Thats where alt="<?php echo $hotaru->post->title; ?>"> comes in this pulls the submissions post title and labels the image so you do not have loads of images without 'alt text'

    Apologies if I have explained this incorrectly, if you have difficulty please PM me.

    All the best


    Attached Files:

    Last edited by a moderator: Nov 23, 2009
    baadier and williamd like this.
  6. carlo75

    carlo75 Design & Development

    Hi newbieone... welcome!
    Websnapr thumbnails are really attractive, and I think that's your code will help many people, who want to play whit it!

    My request is talking about, something like Digg, that when you try to post a new articles, fetch and retrieve dinamically all (tag) images of the submitted page, and let user to select one to point up his story... but yours solution can be a pretty hack for a static image... thank you.
  7. newbieone

    newbieone New Member

    Hi Carlo75,

    Forgive me this is what I interpreted it to mean, now I know what you mean, yes that would be difficult indeed, and as I mentioned I am not a coder by any stretch of the information.

    thanks for your welcome and your kind words.

  8. carlo75

    carlo75 Design & Development

    I find this interesting
    function to save image from a remote host to the our server, using cURL:

    function save_image($img,$fullpath){
    $ch curl_init ($img);
    curl_close ($ch);
    $fp fopen($fullpath,'x');
    working with:

    If our host has enable allow_url_fopen in php.ini the following method is better:

    $remote_img 'http://www.remotesite.com/images/image.jpg';
    $img imagecreatefromjpeg($remote_img);
    $path 'images/';
    What do you think about that, can help?
  9. sharkbyteusa

    sharkbyteusa New Member

    would be great plugin
  10. Gunaxin

    Gunaxin Well-Known Member

    Post Thumbnails

    Looking to use this platform to replace an existing system, and for our purposes post thumbnails is crucial. This wouldn't be a avatar of the submitting person, but rather a thumbnail from the article that is submitted. Ideally this would just be a field to paste in a URL, and the system would automatically crop and save a version at the proper size and aspect ratio (configurable sizes would be great). I'm new here, but I did do a bit of poking around before I posted this. If its already in the works or exists, I couldn't find it, so please point me in the right direction.

    I'm liking what I am seeing so far, keep up the good work.
  11. Nick

    Nick Well-Known Member

    I think this thread is the closest fit for your suggestion, so I've moved it here.
  12. ties

    ties Theme & Plugin Development

    is someone working one this because im about to start :p it would be a waste of time if someone almost finished it
  13. Nick

    Nick Well-Known Member

    Here's some edited code from Wordpress which is sitting on the SVN doing nothing. I wrapped it up like a plugin so it wouldn't break the Plugin Management section on my dev site, but it's not actually a plugin, just some coding notes. I was thinking of making a Fetch Image plugin, but other things have taken priority.

  14. ties

    ties Theme & Plugin Development

    ok great i'll see what i can do with it
    i was also thinking of making a plugin which allows users to upload avatars, but with this image plugin we might need an images-folder in content (maybe somewhere in the future)
    looking forward to 1.1.2
  15. ties

    ties Theme & Plugin Development

    So i've been working on it today and im this far
    i can add an url and change the image as i like
    i think by tommorrow i'll be finished

    this might be NSFW but its really small and was intended for GUNAXIN

    Attached Files:

  16. PeaceKeeper

    PeaceKeeper New Member

    Nice. This would be a much welcomed plug in. I thought about trying to work on it later, but yours looks great! Good Work, can not wait to try it out.
  17. ties

    ties Theme & Plugin Development

    i will be adding support for:
    size (w*h)
    no default image
    default image - location
    websnapper - api key and size​
    also as the screenshot displayed a form field with 'cropper' for custom thumbs
    more suggestions are welcome
  18. Gunaxin

    Gunaxin Well-Known Member

    It's tough to find a bad crop of Jessica Alba ;)

    Nice work ties, can't wait to get this puppy implemented. Thanks for your hard work.
  19. carlo75

    carlo75 Design & Development

    Ties this is really impressive,
    but I've a question: can you to fetch image directly from link url?
    Some hack to recognize tag <img> and repropose the first 5th images on screen cropped (e.g.)... like Digg

    However this is a really taste plugin!
  20. ties

    ties Theme & Plugin Development

    @Gunaxin: fine indeed :p
    @carlo: good suggestion i might add it to a later function i was thinking about it but some pages have a lot of add and wan't sure how to filter but i'll be definitly considering it!
Thread Status:
Not open for further replies.

Share This Page