4images Forum & Community
4images Modifications / Modifikationen => Mods & Plugins (Releases & Support) => Topic started by: V@no 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: 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: 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: $new_thumb_name = $new_name;
Replace with: $new_thumb_name = (is_remote($new_name)) ? get_file_name($new_name).".".get_file_extension($new_name) : $new_name;
Step 1.3.
Find }
if (!$uploaderror) {
Insert above: if (is_remote($new_name)){
unlink($name);
}
MAKE SURE U INSERTED IT ABOVE CLOSING BRACKET! ( } )
-
What about Step 1.3 if "Auto Image Resizing " is installed?
-
what about it?
-
Step 1.3.
Find Code:
}
if (!$uploaderror) {
but
}
-------------- Here is placed code from your MOD "Auto Image Resizing "---------------------------
if (!$uploaderror) {
many people will have a troubles 8)
-
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...
-
I want to say, what "CLOSING BRACKET" in two cases (with and without MOD "Auto Image Resizing ") not the same. That's all.
-
ah, I see, thanks for letting me know ;)
-
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.
-
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? :?
-
:?
Yes, a question such:
How to change a name of a file if such file already is.
-
The MOD works fine.
Thanks !
-
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????
-
No, not with this mod. This is what you are looking for:
http://www.4homepages.de/forum/index.php?topic=6921.0
-
Thanks, thats it :)
-
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
-
i've got this error :
Warning: chdir(): No such file or directory (errno 2) in /home/****/public_html/includes/annotate.php on line 11
Warning: rename(for_you.jpg,for_you.jpg.bak): Permission denied in /home/****/public_html/includes/annotate.php on line 12
how fix it ?
-
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.
Hallo,
also ich hab das gleiche Problem.
Mal angenommen das thumbnail bild heist bild123.jpg und es wird in die kategorie nr. 3 hochgeladen ..... wenn sich in der kategorie aber bereits ein thumbnail mit dem gleichen namen bild123.jpg befindet dann wird es einfach überschrieben
ist das bei euch so ?
das thumbnail müsste also beim upload umbenannt werden falls es bereits eine datei mit diesem namen gibt
vielleicht mag sich jemand eine lösung ausdenken, würde mir sehr helfen da ich schon seit tagen dran sitze :|
-
Hi -
Is this MOD still included because some folks may have installed it a while back
Isn't the MOD Auto-Thumbnailer v2.3.1 the replacement for this, or am I missing a fundamental concept between the two MOD's?
Thanks for your comments.
Brian