Author Topic: [Mod] Remote Image Thumbnail Creation  (Read 26590 times)

0 Members and 1 Guest are viewing this topic.

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
[Mod] Remote Image Thumbnail Creation
« on: March 20, 2005, 08:14:48 PM »
This mod will create thumbnails from remote images uploaded through members upload page (not ACP)


Step 1.
Open /member.php
Find:
Code: [Select]
    elseif ($config['auto_thumbnail'] == 1 && !empty($HTTP_POST_FILES['media_file']['tmp_name']) && $HTTP_POST_FILES['media_file']['tmp_name'] != "none" && !$uploaderror) {
      if ($direct_upload) {
        $src = MEDIA_PATH."/".$cat_id."/".$new_name;
        $dest = THUMB_PATH."/".$cat_id."/".$new_name;
      }
      else {
        $src = MEDIA_TEMP_PATH."/".$new_name;
        $dest = THUMB_TEMP_PATH."/".$new_name;
      }
Replace with:
Code: [Select]
    elseif ($config['auto_thumbnail'] == 1 && (!empty($HTTP_POST_FILES['media_file']['tmp_name']) || $new_name) && ($HTTP_POST_FILES['media_file']['tmp_name'] != "none" || $new_name) && !$uploaderror) {
      if (is_remote($new_name)){
        $name = MEDIA_TEMP_PATH."/".md5(time()).".".get_file_extension($new_name);
        if ($infile = fopen ($new_name, "rb")) {
          $outfile = fopen ($name, "wb");
          while (!feof ($infile)) {
            fwrite($outfile, fread ($infile, 4096));
          }
          fclose($infile);
          fclose($outfile);
        }
      }
      if ($direct_upload) {
        $src = (is_remote($new_name)) ? $name : MEDIA_PATH."/".$cat_id."/".$new_name;
        $dest = THUMB_PATH."/".$cat_id."/".((is_remote($new_name)) ? get_file_name($new_name).".".get_file_extension($new_name) : $new_name);
      }
      else {
        $src = (is_remote($new_name)) ? $name : MEDIA_TEMP_PATH."/".$new_name;
        $dest = THUMB_TEMP_PATH."/".((is_remote($new_name)) ? get_file_name($new_name).".".get_file_extension($new_name) : $new_name);
      }


Step 1.2.
Find:
Code: [Select]
            $new_thumb_name = $new_name;Replace with:
Code: [Select]
            $new_thumb_name = (is_remote($new_name)) ? get_file_name($new_name).".".get_file_extension($new_name) : $new_name;

Step 1.3.
Find
Code: [Select]
     }

    if (!$uploaderror) {
Insert above:
Code: [Select]
      if (is_remote($new_name)){
        unlink($name);
      }
MAKE SURE U INSERTED IT ABOVE CLOSING BRACKET! ( } )

Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline vanish

  • Jr. Member
  • **
  • Posts: 60
    • View Profile
    • White Album
Re: [Mod] Remote Image Thumbnail Creation
« Reply #1 on: April 11, 2005, 10:18:23 PM »
What about Step 1.3 if "Auto Image Resizing " is installed?

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
Re: [Mod] Remote Image Thumbnail Creation
« Reply #2 on: April 12, 2005, 12:22:15 AM »
what about it?
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline vanish

  • Jr. Member
  • **
  • Posts: 60
    • View Profile
    • White Album
Re: [Mod] Remote Image Thumbnail Creation
« Reply #3 on: April 12, 2005, 12:32:46 AM »
Quote
Step 1.3.
Find Code:
Code: [Select]
     }


    if (!$uploaderror) {

but
Code: [Select]
     }

-------------- Here is placed code from your MOD "Auto Image Resizing "---------------------------

    if (!$uploaderror) {

many people will have a troubles  8)

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
Re: [Mod] Remote Image Thumbnail Creation
« Reply #4 on: April 12, 2005, 01:45:39 AM »
I put BIG RED note about where the code should be placed...if someone have trouble with that, I'm sorry, but I wouldnt even bother to explain any further...
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline vanish

  • Jr. Member
  • **
  • Posts: 60
    • View Profile
    • White Album
Re: [Mod] Remote Image Thumbnail Creation
« Reply #5 on: April 12, 2005, 09:25:21 AM »
I want to say, what "CLOSING BRACKET" in two cases (with and without MOD  "Auto Image Resizing ") not the same. That's all.

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
Re: [Mod] Remote Image Thumbnail Creation
« Reply #6 on: April 12, 2005, 10:09:30 AM »
ah, I see, thanks for letting me know ;)
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline SAD

  • Newbie
  • *
  • Posts: 23
    • View Profile
    • Туристические ФотоАльбомы
Re: [Mod] Remote Image Thumbnail Creation
« Reply #7 on: November 02, 2005, 03:58:39 PM »
Hi!

if download remote image in one category:

http://wwwwwww/image22.jpg
--> create thumbnailer "image22.jpg"

next download
http://yyyyyyyyyyy/image22.jpg
--> create thumbnailer "image22.jpg"

Result:
one thumbnailer "image22.jpg" for two remote image.
Sergey


Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
Re: [Mod] Remote Image Thumbnail Creation
« Reply #8 on: November 02, 2005, 08:02:26 PM »
Hi!

if download remote image in one category:

http://wwwwwww/image22.jpg
--> create thumbnailer "image22.jpg"

next download
http://yyyyyyyyyyy/image22.jpg
--> create thumbnailer "image22.jpg"

Result:
one thumbnailer "image22.jpg" for two remote image.
is there a question in your reply? :?
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline SAD

  • Newbie
  • *
  • Posts: 23
    • View Profile
    • Туристические ФотоАльбомы
Re: [Mod] Remote Image Thumbnail Creation
« Reply #9 on: November 03, 2005, 07:26:52 AM »
 :?
Yes, a question such:
How to change a name of a file if such file already is.
Sergey


Offline fgallery

  • Newbie
  • *
  • Posts: 46
    • View Profile
    • ::: F-Gallery :: Photobank :::
Re: [Mod] Remote Image Thumbnail Creation
« Reply #10 on: November 08, 2005, 12:52:07 PM »
The MOD works fine.
Thanks !
http://f-gallery.com.ua
Artistic Photography, Fashion Photography, Cities and Streets of The World, Personal Photos of Livejournal Users.

Offline JensF

  • Addicted member
  • ******
  • Posts: 1.028
    • View Profile
    • http://www.terraristik-galerie.de
Re: [Mod] Remote Image Thumbnail Creation
« Reply #11 on: January 06, 2006, 07:07:14 PM »
Hi,

i have install this mod and my question is, i have a lot remote pics with no thumb. but when i search for it with the auto thumbnailer there where not find.
can i create a thumbnail for exist remote pics????
Mit freundlichem Gruß
Jens Funk



-> Sorry for my bad English <-

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
Re: [Mod] Remote Image Thumbnail Creation
« Reply #12 on: January 07, 2006, 04:44:53 AM »
No, not with this mod. This is what you are looking for:
http://www.4homepages.de/forum/index.php?topic=6921.0
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline JensF

  • Addicted member
  • ******
  • Posts: 1.028
    • View Profile
    • http://www.terraristik-galerie.de
Re: [Mod] Remote Image Thumbnail Creation
« Reply #13 on: January 07, 2006, 11:52:53 AM »
Thanks, thats it :)
Mit freundlichem Gruß
Jens Funk



-> Sorry for my bad English <-

Offline mohab

  • Newbie
  • *
  • Posts: 14
    • View Profile
Bug when space is in Jpeg name Remote Image Thumbnail Creation
« Reply #14 on: May 29, 2006, 01:15:09 PM »
Hi V@no
Great mod and mostly perfect runing for a long time.
But know i get a little bug .
For a Remote image witch contain a Space in the filename it will not kreate a working thumbnail.
I know ther shoud be never any space in files for the web ,but some registered user dont know and upload remote image via Url.

To explain   the image  "foto children.jpeg"   --> "foto%children.jpeg"
The Orginal foto is working but the thumb will be a brocken link
any simpel way to exclude this little problem

Thanks a lot
Mohab vienna