Advanced search  

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Pages: 1 2 3 [4] 5   Go Down

Author Topic: CPG 1.3.2 - Upload files and edit them all at once  (Read 99107 times)

0 Members and 1 Guest are viewing this topic.

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47844
  • aka "GauGau"
    • gaugau.de
Re: CPG 1.3.2 - Upload files and edit them all at once
« Reply #60 on: October 19, 2005, 07:21:56 am »

if people don't reply they probably don't know the answer. Why don't you find out and tell us? Just make a backup before you start, so you can safely go back if it fails.
Logged

u-n-i

  • Coppermine newbie
  • Offline Offline
  • Posts: 11
Re: CPG 1.3.2 - Upload files and edit them all at once
« Reply #61 on: October 20, 2005, 10:43:54 am »

thnanks
nice idea for backup :)

gonna try it
Logged

willstein

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 120
    • mansei
Re: CPG 1.3.2 - Upload files and edit them all at once
« Reply #62 on: October 30, 2005, 01:50:49 am »

After installing the Mod, it looked fine, but only would display one picture at a time (still having to go to 'next' each time)


Then in Admin-->Config (as stated earlier in this thread) I changed it to allow users to edit many at a time.

But, it doesnt seem to be working completely.
It looks fine, but after submission, the successful info does not show (the successful text pulled from language files).
Also, it only submits the first picture, the rest don't go in.
Finally, "Description" is always 'g', regardless of what I put.

IE and Mozilla produce similiar results.
Admin and User produce similiar results.

Second,
If in Admin-->Config I change the setting to allow many at a time to: "No"
It submits all the photos correctly except (but I have to continue each time)
"Description" seems limited to the first character inputted.

I hope from the above information I can give some experts an idea of what could be wrong.
Also perhaps others can learn who are in the same boat as me.

Any ideas?
Logged

Guerrilla

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 24
Re: CPG 1.3.2 - Upload files and edit them all at once
« Reply #63 on: October 31, 2005, 04:46:46 pm »

Hi guys !!!
I run CPG 1.3.3 and want to ask is this Mod working with version 1.3.3 or only with 1.3.2 ???
This feature is very nice and many of my users have mentioned before that it would be nice to have the feature like that. If someone have CPG 1.3.3 and using this Mod, please, let me know how is that working. I'm ready to give a try ;D

Thanx in advance,

Guerrilla 
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47844
  • aka "GauGau"
    • gaugau.de
Re: CPG 1.3.2 - Upload files and edit them all at once
« Reply #64 on: November 01, 2005, 05:16:50 pm »

should work with all cpg1.3.x versions. See my reply above
Logged

Guerrilla

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 24
Re: CPG 1.3.2 - Upload files and edit them all at once
« Reply #65 on: November 01, 2005, 07:40:26 pm »

Okey ... I will try and write here later is everything okey or not ... I think this function would be nice to have in the next CPG version.

Cheers,
Guerrilla
Logged

willstein

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 120
    • mansei
Re: CPG 1.3.2 - Upload files and edit them all at once
« Reply #66 on: November 09, 2005, 05:35:16 pm »

So I've tried a third time on this mod and it doesnt seem to be working.

Everything LOOKS good, but when it's uploaded, only the first image actually uploads.
Title, and Keywords are fine, but Description only lets the first letter through
Finally, the final show on upload.php where it says "complete" doesnt whow any text. Just "INFORMATION" and then white space and "continue"


any ideas?

thanks.
Logged

alanlai

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Posts: 53
    • Goddess
Re: CPG 1.3.2 - Upload files and edit them all at once
« Reply #67 on: November 11, 2005, 09:01:40 pm »

the working one is not working on cpg 1.3.5

can anyone post a proper working one here?

:(

ganeshcp

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 33
Re: CPG 1.3.2 - Upload files and edit them all at once
« Reply #68 on: November 20, 2005, 02:48:37 pm »

ditto that......this is a very useful mod if someone can post a final version.
Logged

legend107

  • Coppermine newbie
  • Offline Offline
  • Posts: 1
Re: CPG 1.3.2 - Upload files and edit them all at once
« Reply #69 on: November 29, 2005, 01:34:22 pm »

Here my working upload.php file...

I hope It can be useful!

Enjoy ^_^

Confirming it works fine. Thank you :D
Tested on CPG 1.3.5  : 2005 Nov 29
Logged

AWJunkies

  • Contributor
  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 130
Re: CPG 1.3.2 - Upload files and edit them all at once
« Reply #70 on: January 27, 2006, 02:53:46 am »

HELL YA! It works for Stand alone Stable 1.4.3 PLEASE UPDATE! If anyone would like the upload.php file let me know. I started with the non-moded 1.4.3 upload.php file and edited it to work. Off to add JUpload to it now. Thanks again for this thread and everyones posts.
Logged

Guerrilla

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 24
Re: CPG 1.3.2 - Upload files and edit them all at once
« Reply #71 on: January 28, 2006, 11:51:18 pm »

HELL YA! It works for Stand alone Stable 1.4.3 PLEASE UPDATE! If anyone would like the upload.php file let me know. I started with the non-moded 1.4.3 upload.php file and edited it to work. Off to add JUpload to it now. Thanks again for this thread and everyones posts.

Hi !!!
This Mod sounds very good !!! ... That is exactly what I need for my gallery !!!
Couple you, please, share this file with me ?
You may send it to guerrilla_33@yahoo.com

Thanx in advance !!!
Logged

AWJunkies

  • Contributor
  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 130
Re: CPG 1.3.2 - Upload files and edit them all at once
« Reply #72 on: January 29, 2006, 12:00:15 am »

This is my current file with adding JUpload. SO I don't actually have the file before this mod was applied. I accidently deleted it when I was starting fresh to install the JUpload. However if you instal JUpload as well you will have the upload.php already done for it.

The instructions on this thread if you follow them it is all the same but the }}}} you only need 3 }}} and the mod will work. Also need to apply the [] stuff like noted in thread. So you can follow the instructions on first page then update the stuff later stated in thread and instead of doing the 4 close outs do 3 and all good. Little bit of tweaking and you have it. It is a MUCH needed MOD and should have been included in core. This MOD has been around for years I don't know why it didn't make it. Hit me up if you have any trouble. You can use my file as a type of guide.

« Last Edit: January 29, 2006, 08:12:43 pm by AWJunkies »
Logged

Guerrilla

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 24
Re: CPG 1.3.2 - Upload files and edit them all at once
« Reply #73 on: January 29, 2006, 06:20:19 pm »

Hi AWJunkies!!!
Thank you for your upload file ... but there are several problems ...
first, your upload.txt is turned to be upload.html ...
second, some part of the script is missing at the end ...
third, looks like the right curly } is missing somewhere between lines 2449 and 2700

By the way - at the first page of this topic foulu said move   } //end for loop   to end to make this mod work !!! ... In your script it still at the old place ... where that has to be ???
While cheching the script I get now the following error:
Parse error: syntax error, unexpected $end in C:\....\Temp\dzp116.tmp on line 2899

Could you, please, upload your upload.php (as .txt) which is currently rinning and don't have syntax errors.

Appreciate all your effords and looking forward to get the working file ;-))

P.S.  Sorry, didn't nderstand well about JUpload - in the script I see this:
  code="JUpload/startup.class"
  archive="jupload.jar"

Do I need to download these 2 files (startup.class and jupload.jar) and install on my server ... or ... ??? If so, where can I get them ??? Thanx again ;-))
Logged

AWJunkies

  • Contributor
  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 130
Re: CPG 1.3.2 - Upload files and edit them all at once
« Reply #74 on: January 29, 2006, 08:10:54 pm »

Ignore the first page //end loop because it is already moved in the orginal code, that was posted. It was the second page I was refering too. That shows:
}
}
}
}end loop

it needs to be:
}
}
}end loop

Logged

Guerrilla

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 24
Re: CPG 1.3.2 - Upload files and edit them all at once
« Reply #75 on: January 29, 2006, 08:20:23 pm »

Thanx !!! Now I get no errors after syntax check !!!
What about Applet ??? I get "Starting Applet" ... message ... and then "No Applet found"   :'(
« Last Edit: January 29, 2006, 08:26:32 pm by Guerrilla »
Logged

AWJunkies

  • Contributor
  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 130
Re: CPG 1.3.2 - Upload files and edit them all at once
« Reply #76 on: January 29, 2006, 08:39:31 pm »

## MOD Title: Multi-File Uploader
## MOD Author: mstralka < email > (Mark Stralka) http://www.photo-junky.com
## MOD Description: This mod will simplify the upload process by
## letting users see alll of the uploaded photos on one page,
## move them to different albums accordingly (or to the same
## album with 1 click), set descriptions, keywords, etc, instead
## of one image per page.
## Administrator can determine whether users will edit all
## uploaded photos at once, or individually.
## MOD Version: 2.0.0
## Built on CPG 1.3.2 - may work with 1.3.1 MODED by AWJ for 1.4.3
##
## Installation Level: Easy
## Installation Time: 10 minutes
## Files To Edit:   lang/english.php
##               upload.php
## Included Files: (screenshot)
##############################################################
## Author Notes:
## These steps are in order from top to bottom.  You have to
## be careful modding upload.php because a lot of the code is
## duplicated in different sections.

## This mod incorporates Frogfoot's fancy album dropdown MOD.
## You must install it first (takes 5 minutes)

## http://forum.coppermine-gallery.net/index.php?topic=8861.0
## Thanks to DefenceTalk for the MOD Instruction Template
##############################################################
## MOD History:
##
##   2004-08-27 - Version 1.0.0
##      - Original version, was not in line-by-line order,
##      - no Admin option
##
##############################################################
## Before Adding This MOD To Your Site, You Should Back Up All Files
## Related To This MOD

Database query (use phpMyAdmin):
Code: [Select]
INSERT INTO `cpg143_config` ( `name` , `value` )
VALUES (
'allow_assign_multiple_photos', '0'
);

Adding this code will create a Yes/No option on the CONFIG page, under User Settings.  The default value
is No, which means uploads will work just like they do now.  Setting it to Yes will turn on the mod.
lang/english.php
FIND:
Code: [Select]
  'User settings',
  array('Allow new user registrations', 'allow_user_registration', 1),
  array('User registration requires email verification', 'reg_requires_valid_email', 1),
ADD to end of User Settings section:
Code: [Select]
  array('Allow users to assign uploaded photos at once (instead of one-at-a-time)','allow_assign_multiple_photos',1), //Mark Stralka cpg1.3.2

upload.php:
FIND:
Code: [Select]
// The function to create the album list drop down.
function form_alb_list_box($text, $name) {
REPLACE WITH:
Code: [Select]
// The function to create the album list drop down.
function form_alb_list_box($text, $name,$onChange='') {
FIND WITHIN:
Code: [Select]
   // Create the opening of the drop down box.
Before ADD:
Code: [Select]
if (!empty($onChange)) {
$onChange = " onChange=\"$onChange\" ";
}
FIND WITHIN:
Code: [Select]
            <select name="$name" class="listbox">
REPLACE WITH:
Code: [Select]
           <select name="$name" class="listbox" $onChange>
FIND:
Code: [Select]
// The open_form function creates the Javascript verification code and the opening form tags.
// $path hold the form action path.
function open_form($path) {

    echo <<<EOT
    <script language="JavaScript">
    function textCounter(field, maxlimit) {
            if (field.value.length > maxlimit) // if too long...trim it!
            field.value = field.value.substring(0, maxlimit);
    }
    </script>
    <form method="post" action="$path" ENCTYPE="multipart/form-data">
    </td>
EOT;
}
Replace with:
Code: [Select]
// The open_form function creates the Javascript verification code and the opening form tags.
// $path hold the form action path.
function open_form($path,$formName = "") {
if (!empty($formName)) $fn = "name=\"$formName\"";
    echo <<<EOT
    <script language="JavaScript" type="text/javascript">
    function textCounter(field, maxlimit) {
            if (field.value.length > maxlimit) // if too long...trim it!
            field.value = field.value.substring(0, maxlimit);
    }
    </script>
    <form method="post" action="$path" $fn ENCTYPE="multipart/form-data">
    </td>
EOT;
}

FIND:
Code: [Select]
        // Create array index.
        $index = count($escrow_array) - 1;
Add this below:
Code: [Select]
$start = 0;
if ((int)$CONFIG['allow_assign_multiple_photos'] == 1) {
$iCnt = count($_POST["album"]);
} else {
$iCnt = $index + 1;
$start = $index;
}

//Instead of doing one photo at a time, show one page with all of the photos that are being uploaded - this makes it much easier for the users.
for ($index = $start; $index < $iCnt; $index++) {

FIND:
Code: [Select]
        // We have incoming placement data. Let's capture it.
Add this below:
Code: [Select]
$x = $index;
if ((int)$CONFIG['allow_assign_multiple_photos'] == 0) {
$x = 0;
} else {
$x = $index;
}

FIND:
Code: [Select]
$album = (int)$_POST['album'];
$title = addslashes($_POST['title']);
$caption = addslashes($_POST['caption']);
$keywords = addslashes($_POST['keywords']);
$user1 = addslashes($_POST['user1']);
$user2 = addslashes($_POST['user2']);
$user3 = addslashes($_POST['user3']);
$user4 = addslashes($_POST['user4']);
Replace with:
Code: [Select]
$album = (int)$_POST['album'][$x];
$title = addslashes($_POST['title'][$x]);
$caption = addslashes($_POST['caption'][$x]);
$keywords = addslashes($_POST['keywords'][$x]);
$user1 = addslashes($_POST['user1'][$x]);
$user2 = addslashes($_POST['user2'][$x]);
$user3 = addslashes($_POST['user3'][$x]);
$user4 = addslashes($_POST['user4'][$x]);

FIND:
Code: [Select]
            // Delete the temporary data file.
            delete_record($_POST['unique_ID']);
BEFORE ADD:
Code: [Select]
if ((int)$CONFIG['allow_assign_multiple_photos'] == 0) {
FIND:
Code: [Select]
// Exit the script.
exit;
}
AFTER ADD:
Code: [Select]
                                               }
} //end for loop

if ((int)$CONFIG['allow_assign_multiple_photos'] == 1) {

            // Delete the temporary data file.
            delete_record($_POST['unique_ID']);

            // Send e-mail notification to the admin if requested (added by gaugau: 03-11-09).
            if (($CONFIG['upl_notify_admin_email']) and ($PIC_NEED_APPROVAL)) {
                // Encapsulate so included lang file doesn't interfere with global one
                function cpg_send_upload_notification() {
                    global $CONFIG;
                    $lang_db_input_php = cpg_get_default_lang_var('lang_db_input_php');
                    // Get the mail files.
                    include_once('include/mailer.inc.php');

                    // Send the message.
                    cpg_mail('admin', sprintf($lang_db_input_php['notify_admin_email_subject'], $CONFIG['gallery_name']), sprintf($lang_db_input_php['notify_admin_email_body'], USER_NAME,  $CONFIG['ecards_more_pic_target']. (substr( $CONFIG["ecards_more_pic_target"], -1) == '/' ? '' : '/') .'editpics.php?mode=upload_approval' ));
                }
                cpg_send_upload_notification();
            }

            // That was the last one. Create a redirect box.
            pageheader($lang_info);
            msg_box($lang_info, $final_message, $lang_continue, 'index.php', "100%");
            pagefooter();

            // Exit the script.
            exit;

         }
    }
FIND:
Code: [Select]
    // Create array index.
    $index = count($escrow_array) - 1;
ADD:
Code: [Select]

$start = 0;
if ((int)$CONFIG['allow_assign_multiple_photos'] == 1) {
$iCnt = count($escrow_array);
} else {
$iCnt = $index + 1;
$start = $index;
}

// Create upload form headers.
    pageheader($lang_upload_php['title']);
echo <<<EOT
<script type="text/javascript">
function moveAllTo(d,box) {
var f = document.editForm;
for (i = 0; i < f.length; i++) {
if (f[i].type == "select-one" && f[i].name.indexOf(box) >= 0) {
f[i].value = d
}
}
}
</script>
EOT;
    // Open the form table.
    starttable("100%", $lang_upload_php['title'], 2);
echo <<<EOT
<tr>
<td class="tableh2">
All Photos:
</td>
<td class="tableh2">

EOT;
//MOVE TO ALL MOD
form_alb_list_box("Move all photos to:","moveAllTo","moveAllTo(this.value,'album');");
echo <<<EOT
</td>
</tr>
EOT;
    // Direct the request to this script.
    open_form($_SERVER['PHP_SELF'],'editForm');
//Display all of the photos at once for editing
for ($index = $start; $index < $iCnt; $index++) {


FIND and Delete or comment out:
Code: [Select]
    // Create upload form headers.
    pageheader($lang_upload_php['title']);

    // Open the form table.
    starttable("100%", $lang_upload_php['title'], 2);

    // Direct the request to this script.
    open_form($_SERVER['PHP_SELF']);


I DID THIS REALLY FAST SO PLEASE! Let me know if you get any errors and I can fix it within seconds for you guys.
Logged

AWJunkies

  • Contributor
  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 130
Re: CPG 1.3.2 - Upload files and edit them all at once
« Reply #77 on: January 29, 2006, 08:44:39 pm »

Now for the JUpload MOD that is on the upload.txt above you can get the MOD here: http://forum.coppermine-gallery.net/index.php?topic=8199.0
Watch that thread because I will have the issue solved about the cookies soon. So basically make all changes to the other files BUT the upload.php because it is already done on my upload.txt file. Go to the last post I made and you will see the edits for 1.4.3
« Last Edit: January 29, 2006, 09:09:23 pm by AWJunkies »
Logged

Guerrilla

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 24
Re: CPG 1.3.2 - Upload files and edit them all at once
« Reply #78 on: January 29, 2006, 11:41:44 pm »

Hi again !!! ...
So, I had to change 864 from
archive="jupload.jar"
to
archive="./jupload.jar"
Otherwise was getting "Applet not found" error.
So, applet is working now ... I can choose files and click Upload buttom ... it is uploading files ... but after prgress bar shows uploading complete then my browser is trying to send some data to my server ....  and it keeps trying anf trying for aboyt 5 mins till I get "Canot access Database" or something like that ...

I have added one more variable to MySQL - allow_assign_multiple_photos ... changed the language files ... use your upload.php ... and still no luck :-( ...
By the way - how can I change the buttons of the script ??? 3 buttons to ADD, REMOVE and UPLOAD - they are in some Encoding that my brower shows only symbols ... any ideas on it ???

Sorry for bothering you with my questions but you are the one who may help ;-))

Regards,
Guerrilla

P.S. I was using supplied jupload-simple-demo.html for testing ... yes, it is uploading files ... but I cannot find them on my server ... where the hell these files go ??
Logged

farhan

  • Coppermine newbie
  • Offline Offline
  • Posts: 17
Re: CPG 1.3.2 - Upload files and edit them all at once
« Reply #79 on: January 30, 2006, 08:44:58 pm »

thanks to your attached upload.php i got this mod working

thanks  AWJunkies

one thing i don't use the jupload mod, any chance you can point the code that can be removed from upload.php related to that mod ?

Thanks again
Logged
Pages: 1 2 3 [4] 5   Go Up
 

Page created in 0.441 seconds with 19 queries.