• [MOD] multiupload 5 0 5 1
Currently:  

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

0 Members and 1 Guest are viewing this topic.

Offline zellenblog

  • Pre-Newbie
  • Posts: 3
    • View Profile
Re: [MOD] multiupload
« Reply #30 on: July 27, 2005, 03:03:20 PM »
Hi rroc,

PM is in your inbox.

Thanks for your help

Offline zellenblog

  • Pre-Newbie
  • Posts: 3
    • View Profile
Re: [MOD] multiupload
« Reply #31 on: July 27, 2005, 03:38:09 PM »
Found it ! Or them ;)

Used BeyondCompare with your attached .txt file and my member.php, corrected the differences and VOILA! It works now.

Thanks mate.

Offline rroc

  • Pre-Newbie
  • Posts: 8
    • View Profile
Re: [MOD] multiupload
« Reply #32 on: July 27, 2005, 08:56:32 PM »
maziggy, ctforums:
Here you go... I created the extension to the original mod. (be sure to use the latest version...).
(The modified member.php is included below, if you use beyondcompare...)

[MOD] multiupload + descriptions

1. Apply the original mod...

2. Do the two changes in members.php:

2.1.1 difficult to explain... but
FIND
Code: [Select]
if ($action == "uploadimage" || $action=="multiuploadimage") {

2.1.2 ...leave it be, and find the next text below and replace it as described
(make sure it is this, because it exist in other place in the file as well)

REPLACE:
Code: [Select]
$image_description = un_htmlspecialchars(trim($HTTP_POST_VARS['image_description']));

BY:
Code: [Select]
  $image_description = "";
//  $image_description = un_htmlspecialchars(trim($HTTP_POST_VARS['image_description'])); --> MOVED TO MULTIDESCRIPTION

2.2 Final part for member.php:
This implements functionality that if only the first description is given it will be used for the all items.
FIND:
Code: [Select]
while(isset($HTTP_POST_FILES['media_file'.$fileext]))
{

ADD BELOW THAT:
Code: [Select]
    // MULTIDESCRIPTION
    //If only one description has been provided use it, otherwise read the POSTed value
$image_description = ($image_description!="" && empty($HTTP_POST_VARS['image_description'.$fileext]))?$image_description:un_htmlspecialchars(trim($HTTP_POST_VARS['image_description'.$fileext]));

3. html update
Replace the old member_multiuploadform.html with the new one, which is provided below. There were added the description fields.


All should be working now. I provided also the member.php, to ease up by using beyondcompare or similar tool. (it contains both the original mod and the description addon)

Offline ctforums

  • Newbie
  • *
  • Posts: 12
    • View Profile
Re: [MOD] multiupload
« Reply #33 on: July 27, 2005, 11:09:31 PM »
thanks rroc. Great work and very much appreciated.

Offline ctforums

  • Newbie
  • *
  • Posts: 12
    • View Profile
Re: [MOD] multiupload
« Reply #34 on: July 28, 2005, 07:58:45 PM »
Would it be simple to allow multiple file names also? or am I pushing my luck  :wink:

Offline rroc

  • Pre-Newbie
  • Posts: 8
    • View Profile
Re: [MOD] multiupload
« Reply #35 on: July 29, 2005, 01:00:41 AM »
ctforums:
LOL! ... and finally after this issue, you would probably ask if it is possible to add multiple items for keywords as well... Hehee. The idea was to ease the upload process by not having to enter all the information one by one...

Well, if you truly desire, that should be possible in almost the exact same way than the description mod above...

1. ADD the needed fields to a place you desire in the MEMBER_MULTIUPLOADFORM.HTML i.e.
Code: [Select]
<input type="text" name="image_name"  size="30" value="{image_name}" class="input" />
<input type="text" name="image_name2"  size="30" value="{image_name}" class="input" />
<input type="text" name="image_name3"  size="30" value="{image_name}" class="input" />
<input type="text" name="image_name4"  size="30" value="{image_name}" class="input" />
<input type="text" name="image_name5"  size="30" value="{image_name}" class="input" />


2. In MEMBER.PHP, Add this line after the lines that were added before

FIND the following section:
Code: [Select]
// MULTIDESCRIPTION
//If only one description has been provided use it, otherwise read the POSTed value
$image_description = ($image_description!="" && empty($HTTP_POST_VARS['image_description'.$fileext]))?$image_description:un_htmlspecialchars(trim($HTTP_POST_VARS['image_description'.$fileext]));

ADD BELOW that:
Code: [Select]
//If only one name has been provided use it, otherwise read the POSTed value
$image_name = ($image_name!="" && empty($HTTP_POST_VARS['image_name'.$fileext]))?$image_name:un_htmlspecialchars(trim($HTTP_POST_VARS['image_name'.$fileext]));


3. If you don't want those numbers after the names you should replace the next line...(it was added in the original mod)

REPLACE this:
Code: [Select]
$imgname = ($fileext!="")?"$image_name $fileext":$image_name;
BY this:
Code: [Select]
$imgname = $image_name;
...I didn't care to test it, as I don't know where to insert all those text fields in my html layout, hehee. But it should work... if you have problems just ask.

BUT I WILL NOT do the multi keyword thing!!!  :wink:

Offline ctforums

  • Newbie
  • *
  • Posts: 12
    • View Profile
Re: [MOD] multiupload
« Reply #36 on: July 29, 2005, 11:56:08 AM »
hehe!
Well, as ever, you've delivered. More karma coming you're way  :wink:

Thanks very much for all your help on this MOD.

Offline winterl

  • Newbie
  • *
  • Posts: 14
    • View Profile
Re: [MOD] multiupload
« Reply #37 on: July 30, 2005, 01:48:19 PM »
hallo, folgendes problem:

ich habe den mulitupload mod (http://www.4homepages.de/forum/index.php?topic=8517.0) gemacht. das multiupload fenster und alles funktioniert auch. nur wenn ich in die normale admin oberfläche gehe, und eine neue kategorie eröffnen oder eine bestehende bearbeiten, bekomme ich nur folgende fehlermeldungen:

Warning: main(./global.php): failed to open stream: No such file or directory in /home/httpd/vhosts/winterlife.com/httpdocs/4images/admin/categories.php on line 30

Warning: main(): Failed opening './global.php' for inclusion (include_path='.:/usr/share/pear') in /home/httpd/vhosts/winterlife.com/httpdocs/4images/admin/categories.php on line 30

Warning: main(./includes/sessions.php): failed to open stream: No such file or directory in /home/httpd/vhosts/winterlife.com/httpdocs/4images/admin/categories.php on line 31

Fatal error: main(): Failed opening required './includes/sessions.php' (include_path='.:/usr/share/pear') in /home/httpd/vhosts/winterlife.com/httpdocs/4images/admin/categories.php on line 31


dabei habe ich an der stelle in der categories absolut nichts geändert. die sessions.php und global.php gar nicht angerührt.


wäre super wenn mir jemand da weiter helfen könnte.

besten dank im voraus!!!

Offline dieter

  • Newbie
  • *
  • Posts: 14
    • View Profile
Re: [MOD] multiupload
« Reply #38 on: July 30, 2005, 02:27:43 PM »
@rroc: i have added the code
Code: [Select]
<input type="text" name="image_name"  size="30" value="{image_name}" class="input" />
<input type="text" name="image_name2"  size="30" value="{image_name}" class="input" />
<input type="text" name="image_name3"  size="30" value="{image_name}" class="input" />
<input type="text" name="image_name4"  size="30" value="{image_name}" class="input" />
<input type="text" name="image_name5"  size="30" value="{image_name}" class="input" />

and the other code.

now there is one problem:

when i upload 5 images, all pictures have the same image name. where is the mistake?

Offline dieter

  • Newbie
  • *
  • Posts: 14
    • View Profile
Re: [MOD] multiupload
« Reply #39 on: July 30, 2005, 02:32:25 PM »
i have also this question:

which code is neccessary that the user`s MUST fill the fields "image_name2", image_name3", .... ?

when one of the 5 fields (image_name) is empty, it should appear a error massage.

Offline Jan Senf

  • Newbie
  • *
  • Posts: 22
    • View Profile
    • event-pics.de und ihr seid dabei !
Re: [MOD] multiupload
« Reply #40 on: July 30, 2005, 07:39:35 PM »
... is there already a solution for the annotation mod ?

I get an error when uploading more then one picture, so i have to annote new pictures manually in the acp !!!  :(

JanSenf

Offline karimun

  • Newbie
  • *
  • Posts: 49
    • View Profile
    • http://www.at6pm.com
Re: [MOD] multiupload
« Reply #41 on: July 31, 2005, 05:35:32 PM »
rroc, it works now. Many thanks for this mod.

One thing:
Have you already tested whether your mod can also be combined with the ´upload limit´ mod of SLL?
http://www.4homepages.de/forum/index.php?topic=3607.0

Great Work!

Offline rroc

  • Pre-Newbie
  • Posts: 8
    • View Profile
Re: [MOD] multiupload
« Reply #42 on: July 31, 2005, 11:09:02 PM »
winterl:
I'm sorry that I cannot write German(I did undestand your problem however)... Your problem doesn't seem to be related to the multiupload MOD, on my test site where there is nothing more running than this addon, the admin panel seems to work correctly. Could it be that you have made somekind of typing error, when copying stuff to categories.php? Did you download the file and used that, or did you make the changes by yourself? If you can send me the files you have modified, I could investigate your problem further.

Jan Senf:
Annotation mod? hmm... If this is the mod you refer to, I think that problem has been fixed in the current version of the MOD(since July 27)... Or when did you get the MOD?

diater:
do you still have the problem with all names being the same?... Your second posting seems to imply that it works correctly? The MOD should work that way, that if you only enter one name it is used for all, and if there are no names it gives the error. If you would like to FORCE the users to enter each name, you have to

1. REPLACE the line you added before:
Code: [Select]
$image_name = ($image_name!="" && empty($HTTP_POST_VARS['image_name'.$fileext]))?$image_name:un_htmlspecialchars(trim($HTTP_POST_VARS['image_name'.$fileext]));
2. BY:
Code: [Select]
if (empty($HTTP_POST_VARS['image_name'.$fileext])) 
    {
    $error = 1;
    $field_error = preg_replace("/".$site_template->start."field_name".$site_template->end."/siU",
                        str_replace(":", "", $lang['image_name']), $lang['field_required']);
    $msg .= (($msg != "") ? "<br />" : "").$field_error;
    $action = "uploadform";
    $sendprocess = 1;
    break;
    }
else
    {
    $image_name = un_htmlspecialchars(trim($HTTP_POST_VARS['image_name'.$fileext]));
    }
...I think that should do the trick.

Offline Jan Senf

  • Newbie
  • *
  • Posts: 22
    • View Profile
    • event-pics.de und ihr seid dabei !
Re: [MOD] multiupload
« Reply #43 on: August 01, 2005, 10:41:00 AM »
Quote
Jan Senf:
Annotation mod? hmm... If this is the mod you refer to, I think that problem has been fixed in the current version of the MOD(since July 27)... Or when did you get the MOD?

I´ve installed the mod months ago and also the update in the last days (http://www.4homepages.de/forum/index.php?topic=3808.0)

The problem is the automatic annotation when uploading. If this is marked YES in the ACP and then uploading more than whan one picture, there is an error - uploading only one pictures works how expected ...

Offline dieter

  • Newbie
  • *
  • Posts: 14
    • View Profile
Re: [MOD] multiupload
« Reply #44 on: August 01, 2005, 10:54:52 AM »
@rroc: yes, i still have the problem.

i have 5 fields to enter the image name:

field1: image name 1
field2: image name 2
field3: image name 3
field4: image name 4
field5: image name 5

the upload does work, but all images have the same name "image name1"

can you help me?