• [MOD] multiupload 5 0 5 1
Currently:  

Author Topic: [MOD] multiupload  (Read 298727 times)

0 Members and 1 Guest are viewing this topic.

Offline Schublero

  • Newbie
  • *
  • Posts: 22
    • View Profile
    • Currywürste Mannheim
Re: [MOD] multiupload
« Reply #75 on: October 23, 2005, 12:23:44 AM »
In addition to my question above, I figured out, that the whole categories.html seems to broken as soon as I change something. It doesnt matter whether I add for example {multiupload_button} or something else. Any change in the categories.html causes the described problems. How can that happen?

Offline Nasser

  • Full Member
  • ***
  • Posts: 105
    • View Profile
Re: [MOD] multiupload
« Reply #76 on: October 27, 2005, 11:35:31 AM »
I use it for V 1.7 and it's working .. thank you

Offline Nasser

  • Full Member
  • ***
  • Posts: 105
    • View Profile
Re: [MOD] multiupload
« Reply #77 on: October 30, 2005, 08:03:31 PM »
I need a help please
an error occured while a user used the MOD :

Fatal error: Cannot redeclare ann_rename() (previously declared in /home/emarati2/public_html/gallery/includes/annotate.php:9) in /home/emarati2/public_html/gallery/includes/annotate.php on line 9


and this is the file annotate.php
Code: [Select]
<?php

# v.1.4a - updated by v@no - im fix * file rename fix

if (!defined('ROOT_PATH')) {
  die(
"Security violation");
}

=====>> function 
ann_rename($old$new){
  
$oldWD getcwd();
  
chdir(realpath(dirname($old)));
  
$ok = (rename(basename($old), basename($new))) ? 0;
  
chdir($oldWD);
  return 
$ok;
}

function 
annotate_image($file) {
  global 
$convert_options$config$ann_user_name$ann_dest;

  
$ann_dest $file;
  
$file_bak $file.".bak";
  if (!
ann_rename($file$file_bak)) {
    return 
false;
  }
  if (
annotate_it($file_bak$file$convert_options['convert_tool'])) {
    @
chmod($fileCHMOD_FILES);
    @
unlink($file_bak);
    return 
true;
  }
  else {
    
ann_rename($file_bak$file);
    return 
false;
  }
 }

function 
ImageColorResolveAlphaHex($image$color$alpha){
 
$color str_replace("#","",$color);
 
$red hexdec(substr($color,0,2)); $green hexdec(substr($color,2,2)); $blue hexdec(substr($color,4,2));
 
$out ImageColorAllocate($image$red$green$blue);
 
$out ImageColorResolveAlpha($image$red$green$blueround($alpha 127));
return(
$out);
}

function 
annotate_it($ann_src$ann_dest$ann_tool) {
  global 
$convert_options$config$ann_user_name$ann_dest$script_url;

$ann_mode $config['annotation_mode'];
$ann_embed_image $config['annotation_embed_image'];
$annotation_embed_image_opacity $config['annotation_embed_image_opacity'];
$annotation_embed_image_bg $config['annotation_embed_image_bg'];
$ann_text $config['annotation_text'];
$ann_font_path $config['annotation_font'];
$ann_font_size $config['annotation_font_size'];
$ann_image_quality $config['annotation_image_quality'];
$use_shadow $config['annotation_use_shadow'];
$shadow_offset $config['annotation_shadow_offset'];
$ann_fill_color $config['annotation_fill_color'];
$ann_shadow_color $config['annotation_shadow_color'];
$ann_fill_alpha $config['annotation_fill_alpha'];
$ann_shadow_alpha $config['annotation_shadow_alpha'];
$ann_top_offset $config['annotation_top_offset'];
$ann_bottom_offset $config['annotation_bottom_offset'];
$ann_left_offset $config['annotation_left_offset'];
$ann_right_offset $config['annotation_right_offset'];
$vertical $config['annotation_v_alignment'];
$horisontal $config['annotation_h_alignment'];

$ann_url str_replace ("http://"""$script_url);
$ann_date date($config['date_format']);
$ann_time date($config['time_format']);
$ann_site_name $config['site_name'];
$ann_user $user_info['user_id'];
$ann_vars = array ("'%D'""'%T'""'%N'""'%H'""'%U'""'%S'""'%B'");
$ann_repl = array ("$ann_date""$ann_time""$ann_site_name""$script_url""$ann_url""$ann_user_name""\n\r");
$ann_text str_replace ($ann_vars$ann_repl$ann_text);

if (
'IN_CP') {
   
$ann_user_name "Administrator";
   
$ann_text str_replace ("/admin/plugins"""$ann_text);
   }

if (
$ann_tool == "im") { $ann_text str_replace ("\n\r""\\n\r"$ann_text); }

switch (
$ann_mode) {
   case 
"text"      $use_text 1$use_image 0; break;
   case 
"image"   $use_text 0$use_image 1; break;
}

$isz 0;  $isz= @getimagesize($ann_src);

if (
$use_text) {

 if (
$ann_tool != "netpbm") {

   
$ann_box ImageTTFBBox($ann_font_size0$ann_font_path$ann_text);
   
$ann_text_width=$ann_box[4]-$ann_box[6]; $ann_text_height=$ann_box[0]-$ann_box[7];

   switch (
$horisontal) {
      case 
"left"         $h_offset $ann_left_offset; break;
      case 
"center"       $h_offset = (($isz[0]/2) - ($ann_text_width/2)); break;
      case 
"right"      $h_offset = ($isz[0] - $ann_text_width $ann_right_offset); break;
   }
   switch (
$vertical) {
      case 
"top"         $v_offset $ann_text_height $ann_top_offset; break;
      case 
"middle"       $v_offset = (($isz[1]/2) - ($ann_text_height/2)); break;
      case 
"bottom"      $v_offset $isz[1] - ($ann_text_height/2) - $ann_bottom_offset; break;
   }
  } else {

   switch (
$horisontal) {
      case 
"left"         $h_offset $ann_left_offset$h_align="-align=left";  break;
      case 
"center"       $h_offset $ann_left_offset$h_align="-align=center";  break;
      case 
"right"      $h_offset 0-$ann_right_offset$h_align="-align=right";  break;
   }
   switch (
$vertical) {
      case 
"top"         $v_offset $ann_top_offset$v_align="-valign=top";  break;
      case 
"middle"       $v_offset $ann_top_offset$v_align="-valign=middle";  break;
      case 
"bottom"      $v_offset 0-$ann_bottom_offset$v_align="-valign=bottom";  break;
   }
  }
}
else {
   
$ann_box = @getimagesize($ann_embed_image);
   
$ann_text_width=$ann_box[0]; $ann_text_height=$ann_box[1];

   switch (
$horisontal) {
      case 
"left"         $h_offset $ann_left_offset; break;
      case 
"center"       $h_offset = (($isz[0]/2) - ($ann_text_width/2)); break;
      case 
"right"      $h_offset = ($isz[0] - $ann_text_width $ann_right_offset); break;
   }

   switch (
$vertical) {
      case 
"top"         $v_offset $ann_top_offset; break;
      case 
"middle"       $v_offset = (($isz[1]/2) - ($ann_text_height/2)); break;
      case 
"bottom"      $v_offset $isz[1] - $ann_text_height $ann_bottom_offset; break;
   }
}

$h_offset round($h_offset);  $v_offset round($v_offset);
if (
$isz[0] > $ann_text_width) {

if (
$ann_tool == "im") {

if (
$use_image) {
   
$command $convert_options['convert_path']." -quality ".$ann_image_quality." -draw \"image CopyOpacity $h_offset,$v_offset 0,0 $ann_embed_image\" \"$ann_src\" \"$ann_dest\"";
   
system($command);
} else {

if (!
$use_shadow) {
   
$command $convert_options['convert_path']." -quality ".$ann_image_quality." -antialias -density 90 -font '$ann_font_path' -fill '$ann_fill_color' -pointsize $ann_font_size -draw \"text $h_offset,$v_offset '$ann_text'\"  \"$ann_src\" \"$ann_dest\"";
   
system($command);
   } else {
   
$command $convert_options['convert_path']." -quality "100 ." -antialias -density 90 -font '$ann_font_path' -fill '$ann_shadow_color' -pointsize $ann_font_size -draw \"text $h_offset,$v_offset '$ann_text'\"  \"$ann_src\" \"$ann_dest\"";
   
system($command);

  
$file_shd $ann_dest.".shd";
  
ann_rename('./'.$ann_dest'./'.$file_shd);

 
$h_offset $h_offset $shadow_offset;  $v_offset $v_offset $shadow_offset;
 
$command $convert_options['convert_path']." -quality ".$ann_image_quality." -antialias -density 90 -font '$ann_font_path' -fill '$ann_fill_color' -pointsize $ann_font_size -draw \"text $h_offset,$v_offset '$ann_text'\"  \"$file_shd\" \"$ann_dest\"";
 
system($command);
 @
chmod($ann_destCHMOD_FILES);
 @
unlink($file_shd);
 }
}

} else if (
$ann_tool == "gd") {

$tmp_image = @ImageCreateFromJpeg ($ann_src);
$ann_fill_color ImageColorResolveAlphaHex ($tmp_image$ann_fill_color$ann_fill_alpha);
$ann_shadow_color ImageColorResolveAlphaHex ($tmp_image$ann_shadow_color$ann_shadow_alpha);

if (
$use_image) {

 
$ann_embed_image = @ImageCreateFromPNG($ann_embed_image);
 
$ann_image_width=imageSX($ann_embed_image);
 
$ann_image_height=imageSY($ann_embed_image);

 
$bg_color str_replace("#","",$annotation_embed_image_bg);
 
$bg_red hexdec(substr($bg_color,0,2));
 
$bg_green hexdec(substr($bg_color,2,2));
 
$bg_blue hexdec(substr($bg_color,4,2));

 
$bg_trans_color ImageColorAllocate ($ann_embed_image$bg_red$bg_green$bg_blue);
 
ImageColorTransparent($ann_embed_image$bg_trans_color);
 
ImageCopyMerge($tmp_image$ann_embed_image$h_offset$v_offset00$ann_image_width$ann_image_height$annotation_embed_image_opacity);
 
ImageJpeg($tmp_image$ann_dest$ann_image_quality);
 
ImageDestroy($tmp_image);

} else {

  if (
$use_shadow) {ImageTTFText ($tmp_image$ann_font_size0, ($h_offset+$shadow_offset), ($v_offset+$shadow_offset), $ann_shadow_color$ann_font_path$ann_text);}
  
ImageTTFText ($tmp_image$ann_font_size0$h_offset$v_offset$ann_fill_color$ann_font_path$ann_text);
  
ImageJpeg($tmp_image$ann_dest$ann_image_quality);
  
ImageDestroy($tmp_image);
}
} else if (
$ann_tool == "netpbm")  {
 if (
$use_text) {
 
$command  $convert_options['convert_path']."/pbmtext -quiet -font ".$ann_font_path." '".$ann_text."' > ".ROOT_PATH.MEDIA_DIR."/ann-mask.pnm";
 
system($command);
 
$command  $convert_options['convert_path']."/ppmchange -quiet #000000 ".$ann_fill_color." ".ROOT_PATH.MEDIA_DIR."/ann-mask.pnm > ".ROOT_PATH.MEDIA_DIR."/ann-text.pnm";
 
system($command);
 if (
$use_shadow) {$command  $convert_options['convert_path']."/ppmchange -quiet #000000 ".$ann_shadow_color." ".ROOT_PATH.MEDIA_DIR."/ann-mask.pnm > ".ROOT_PATH.MEDIA_DIR."/ann-text-shd.pnm";
 
system($command); }

 
$command  $convert_options['convert_path']."/jpegtopnm -quiet ".$ann_src." | ";
 if (
$use_shadow) { $command .= $convert_options['convert_path']."/pnmcomp -quiet -invert -opacity=".(1-$ann_shadow_alpha)." -alpha ".ROOT_PATH.MEDIA_DIR."/ann-mask.pnm ".$h_align." ".$v_align." -xoff=".($h_offset+$shadow_offset)." -yoff=".($v_offset+$shadow_offset)." ".ROOT_PATH.MEDIA_DIR."/ann-text-shd.pnm | "; }
 
$command .= $convert_options['convert_path']."/pnmcomp -quiet -invert -opacity=".(1-$ann_fill_alpha)." -alpha ".ROOT_PATH.MEDIA_DIR."/ann-mask.pnm ".$h_align." ".$v_align." -xoff=".$h_offset." -yoff=".$v_offset." ".ROOT_PATH.MEDIA_DIR."/ann-text.pnm | ";
 
$command .= $convert_options['convert_path']."/pnmtojpeg -quiet -quality=".$ann_image_quality." -optimize > ".$ann_dest;
 
system($command);

 @
unlink(ROOT_PATH.MEDIA_DIR."/ann-mask.pnm");
 @
unlink(ROOT_PATH.MEDIA_DIR."/ann-text.pnm");
 if (
$use_shadow) {@unlink(ROOT_PATH.MEDIA_DIR."/ann-text-shd.pnm"); }
 } if (
$use_image) {

 
$command  $convert_options['convert_path']."/pngtopnm -quiet  ".$ann_embed_image." > ".ROOT_PATH.MEDIA_DIR."/ann-logo.pnm";
 
system($command);
 
$command  $convert_options['convert_path']."/ppmcolormask -quiet ".$annotation_embed_image_bg." ".ROOT_PATH.MEDIA_DIR."/ann-logo.pnm > ".ROOT_PATH.MEDIA_DIR."/ann-mask.pnm";
 
system($command);

 
$command  $convert_options['convert_path']."/jpegtopnm -quiet ".$ann_src." | ";
 
$command .= $convert_options['convert_path']."/pnmcomp -quiet -opacity=".($annotation_embed_image_opacity/100)." -alpha ".ROOT_PATH.MEDIA_DIR."/ann-mask.pnm -xoff=".$h_offset." -yoff=".$v_offset." ".ROOT_PATH.MEDIA_DIR."/ann-logo.pnm | ";
 
$command .= $convert_options['convert_path']."/pnmtojpeg -quiet -quality=".$ann_image_quality." -optimize > ".$ann_dest;
 
system($command);

 @
unlink(ROOT_PATH.MEDIA_DIR."/ann-mask.pnm");
 @
unlink(ROOT_PATH.MEDIA_DIR."/ann-logo.pnm");
 }
}
return (
file_exists($ann_dest)) ? 0;
}
}
?>


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] multiupload
« Reply #78 on: October 30, 2005, 08:14:30 PM »
I dont know if it will work, but try add above function ann_rename($old, $new){
this:
Code: [Select]
if (function_exists("ann_rename")) return();If this wont work, then you will need use this instead:
Code: [Select]
if (!function_exists("ann_rename")):and then above ?> add:
Code: [Select]
endif;
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 Nasser

  • Full Member
  • ***
  • Posts: 105
    • View Profile
Re: [MOD] multiupload
« Reply #79 on: October 30, 2005, 08:44:26 PM »
the first one didn't work .. but the second one worked !
 :o
thank you very much

Offline anngi

  • Pre-Newbie
  • Posts: 6
    • View Profile
Re: [MOD] multiupload
« Reply #80 on: November 05, 2005, 11:03:02 PM »
hello!

I installed this mod it upload the pictures and all...but I get after the uploading this error:
Code: [Select]
Fatal error: Cannot redeclare convert_special() (previously declared in /srv/www/htdocs/web390/html/galleri/4images/includes/search_utils.php:34) in /srv/www/htdocs/web390/html/galleri/4images/includes/search_utils.php on line 34
can somebody help me because it doesn't look good with this error after the upload.

Offline Jeevan25

  • Pre-Newbie
  • Posts: 7
    • View Profile
Re: [MOD] multiupload
« Reply #81 on: November 09, 2005, 04:40:18 AM »
i am getting this trouble. but two files get uploaded successfully. but i get this trouble when i upload 5 at a time.
Fatal error: Cannot redeclare convert_special() (previously declared in /home/thaaru/public_html/includes/search_utils.php:34) in /home/thaaru/public_html/includes/search_utils.php on line 34

Offline Deven316

  • Jr. Member
  • **
  • Posts: 57
    • View Profile
Re: [MOD] multiupload
« Reply #82 on: November 16, 2005, 10:17:44 PM »
Is there anyway that a user can create their own category and upload multiple images to that category and then the admin can validate that category/images?

Offline Escalope

  • Pre-Newbie
  • Posts: 1
    • View Profile
Re: [MOD] multiupload
« Reply #83 on: November 28, 2005, 11:15:24 AM »
where is my problem?
i get this failure by normal upload an by multiupload:
Warning: Invalid argument supplied for foreach() in /usr/export/www/vhosts/funnetwork/hosting/klassenseite24/bildergalerie/4images/member.php on line 642

Fatal error: Call to undefined function: add_searchwords() in /usr/export/www/vhosts/funnetwork/hosting/klassenseite24/bildergalerie/4images/member.php on line 647

thxs...

Offline rpd

  • Pre-Newbie
  • Posts: 2
    • View Profile
Re: [MOD] multiupload
« Reply #84 on: November 30, 2005, 01:00:56 AM »
thanx a lot for this MOD
everything is working.but i have one question.can someone edit it  for Uploding from Server(URL)?

Offline holojo

  • Pre-Newbie
  • Posts: 4
    • View Profile
Re: [MOD] multiupload
« Reply #85 on: December 03, 2005, 04:00:11 PM »
this is hard to do.

Offline Digital1

  • Pre-Newbie
  • Posts: 3
    • View Profile
Re: [MOD] multiupload
« Reply #86 on: December 23, 2005, 07:22:14 AM »
Hiya Roc, great Mod. Alot of help too along the way... Thanks!

But... I am having the same problem dieter was or is having with the names.

When I upload the files, all of the files come up with the name that image 1 has. I tired fixing that by replacing the code you gave Deiter but that did not work. It came up with an error. So still no luck for me. Did you get that sorted out yet?

Many thanks.

Offline Fragezeichen

  • Jr. Member
  • **
  • Posts: 58
    • View Profile
Re: [MOD] multiupload
« Reply #87 on: February 03, 2006, 01:40:34 AM »
your mod works best as well,thank you so much.
there is just a problem with the combinationof annotation,uploads more than one picture not possible,errormessage in line 9.
same as people before me.
i try to add your bug fixes,there change nothing.
i want use your multiupload but i need the watermark as verry imortant.
should i change the annation to anoher mod or can you give us any other solution please?

Offline gnuga64

  • Pre-Newbie
  • Posts: 1
    • View Profile
Re: [MOD] multiupload
« Reply #88 on: February 06, 2006, 08:34:35 AM »
hi there, thanks 4 the mod

got it working, great, even managed to add the upload form up to 20 upload at one

but one question ; is it possible to change the name numbering

the default are : image , image 1 , image 2 , ... , image 10
but when you have it displyed it all will get cluttered, you know, unsorted because 4images knows for 20 picture uploaded with same naming system, after 1 is not 2, but 1 -> 11

is it possible to modify somewhere so the naming would be 2 digits : 01 , 02 , 03

hope not pushing my luck too far :)
thanks!

Offline Patti666

  • Pre-Newbie
  • Posts: 2
    • View Profile
Re: [MOD] multiupload
« Reply #89 on: March 01, 2006, 05:25:35 PM »
hi,

the mod is great.
I made that what stood in the first contribution
But i got a problem. I can only 1 picture upload.
 If i want more then one, it does not go.
The browser(firefox) change to http.....4images/member.php?sessionid=db0ef163e938a1db5dbd44e0d23931fb
there is no php fault only that

"Fehler: Verbindung unterbrochen
Die Verbindung zum Server wurde zurückgesetzt, während die Seite geladen wurde.
    *   Die Website könnte vorübergehend nicht erreichbar sein, versuchen Sie es bitte später nochmals.

    *   Wenn Sie auch keine andere Website aufrufen können, überprüfen Sie bitte die Netzwerk-/Internetverbindung.

    *   Wenn Ihr Computer oder Netzwerk von einer Firewall oder einem Proxy geschützt wird, stellen Sie bitte sicher,
         dass Firefox auf das Internet zugreifen darf.
"

The pictures size is there equal. Same fault.
1 picture works fine.

My bad English excused will try, I it again in German.

Wie angedroht :D noch mal das ganze in Deutsch.
Ich habe das Problem das ich nur 1 Bild uploaden kann. Sobald ich mehr als 1 Bild nehme wird mir die oben angezeigte Fehlermeldung angezeigt.
Die Größe der Bilder spielt dabei keine Rolle.


Someone has an idea at what I can make? 
I am thankful already once ahead

greetz
Patti