Advanced search  

News:

CPG Release 1.6.26
Correct PHP8.2 issues with user and language managers.
Additional fixes for PHP 8.2
Correct PHP8 error with SMF 2.0 bridge.
Correct IPTC supplimental category parsing.
Download and info HERE

Pages: [1]   Go Down

Author Topic: [MOD / HACK] (1/2) Uploadez d'un coup toutes vos images  (Read 17771 times)

0 Members and 1 Guest are viewing this topic.

Pascal YAP

  • Moderator
  • Coppermine addict
  • ****
  • Country: fr
  • Offline Offline
  • Gender: Male
  • Posts: 13833
  • Hello World :-)
    • CPG 1.5.x ExperiMental website
[MOD / HACK] (1/2) Uploadez d'un coup toutes vos images
« on: February 21, 2005, 06:22:45 pm »

Uploadez d'un coup toutes vos images C . P . G  1.3.2
Il n'est pas improbable que ce MOD fasse partie de la version Coppermine 1.4.0 !

DIFFICULTE 10/10, Niveau requis EXPERT !

   Ce MOD basé sur deux contributions distinctes.

   Un premier MOD de Frogfoot : "Select album upload pulldown list sorted, organized and formated" ( ICI )
suivit de celui de mstralka : "CPG 1.3.2 - Upload files and edit them all at once " ( ICI )
Ces deux MOD sont totalement indissociables, et sont donc réunis et "mixés" ci-après.
Suivez le "pas-à-pas" du bout des doigts  ;)

Quote
VOTRE PROFIL CONCERNANT CE MOD !

  • Vous téléchargez de nombreuses images !
  • L'Upload de Coppermine livré d'origine vous irrite ?
  • Choisissez le ou les Albums où vous téléchargerez vos images, d'un coup !
  • Editez vos commentaires d'images sur la même page.
  • et TOUT CECI sur une unique page, quelque soit le nombre d'images !
  • Soyez soigneux avec ce MOD !
[/color]

( A ) Insérez à votre base de données (Database query) (par expl avec phpMyAdmin):
Faites correspondre `cpg132_config` à votre configuration !
Code: [Select]
INSERT INTO `cpg132_config` ( `name` , `value` )
VALUES (
'allow_assign_multiple_photos', '0'
);

( B ) Les fichiers suivant seront à modifier :
(CONSEILS : faites des sauvegardes de vos fichiers d'origne avant d'éditer quoique ce soit)
Coppermine/lang/Votre_Langue_ou_French.php
upload.php
searchnew.php


1/ Ouvrez french.php et trouvez : (ou votre_langage.php)
Code: [Select]
// ------------------------------------------------------------------------- //
// File db_input.php
// ------------------------------------------------------------------------- //

if (defined('DB_INPUT_PHP')) $lang_db_input_php = array(
et tout de suite après placez le code suivant :
Code: [Select]
 'album_not_selected' => 'You forgot to select an album. Please go back to the previous page and select an album.', //cpg1.3.1, album pulldown mod, added by frogfoot
2/ Trouvez le code suivant :
Code: [Select]
// ------------------------------------------------------------------------- //
// File searchnew.php
// ------------------------------------------------------------------------- //

if (defined('SEARCHNEW_PHP')) $lang_search_new_php = array(
et après placez le code suivant :
Code: [Select]
 'albums_no_category' => 'Albums with no category', //cpg1.3.1, album pulldown mod, added by frogfoot
  'personal_albums' => '* Personal albums', //cpg1.3.1, album pulldown mod, added by frogfoot

3/ Trouvez le code suivant :
Code: [Select]
// ------------------------------------------------------------------------- //
// File upload.php
// ------------------------------------------------------------------------- //

if (defined('UPLOAD_PHP')) $lang_upload_php = array(
et tout de suite après, placez le code suivant :
Code: [Select]
 'select_album' => 'Select album', //cpg1.3.1, album pulldown mod, added by frogfoot
  'albums_no_category' => 'Albums with no category', //cpg1.3.1, album pulldown mod, added by frogfoot
  'personal_albums' => '* My personal albums', //cpg1.3.1, album pulldown mod, added by frogfoot

4/ Trouvez le code ci-dessous :
Code: [Select]
 'User settings',
  array('Allow new user registrations', 'allow_user_registration', 1),
  array('User registration requires email verification', 'reg_requires_valid_email', 1),
et à la fin de la section user_setting , ajoutez la ligne suivante :
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.2NOTE : En ajoutant le code ci-dessus, une nouvelle Option OUI / NON sera désormais disponible dans les Paramètres Utilisateur.
La valeur par défaut de Coppermine étant NON, cela reviendrait à continuer d'utiliser l'Upload d'origine.
Mais en donnant OUI comme argument, ce MOD sera alors pleinement fonctionnel.

5/ Ouvrez Upload.php
Trouvez dans upload.php la fonction suivant "function form_alb_list_box($text, $name) {"
Remplacez l'intégralité de cette fonction par les deux nouvelles ci-après :
Code: [Select]
// The function to create the album list drop down.
function form_alb_list_box($text, $name,$onChange='') {
// frogfoot re-wrote this function to present the list in categorized, sorted and nicely formatted order

    // Pull the $CONFIG array and the GET array into the function
    global $CONFIG, $HTTP_GET_VARS, $lang_upload_php;

    // Also pull the album lists into the function
    global $user_albums_list, $public_albums_list;

    // Check to see if an album has been preselected by URL addition. If so, make $sel_album the album number. Otherwise, make $sel_album 0.
    $sel_album = isset($HTTP_GET_VARS['album']) ? $HTTP_GET_VARS['album'] : 0;

if (!empty($onChange)) {
$onChange = " onChange=\"$onChange\" ";
}
    // Create the opening of the drop down box
    echo <<<EOT
    <tr>
        <td class="tableb">
            $text
        </td>
        <td class="tableb" valign="top">
            <select name="$name" class="listbox" $onChange>

EOT;

    // Reset counter
    $list_count = 0;

    // Cycle through the User albums
    foreach($user_albums_list as $album) {

        // Add to multi-dim array for later sorting
        $listArray[$list_count][cat] = $lang_upload_php['personal_albums'];
        $listArray[$list_count][aid] = $album['aid'];
        $listArray[$list_count][title] = $album['title'];
        $list_count++;
    }

    // Cycle through the public albums
    foreach($public_albums_list as $album) {

        // Set $album_id to the actual album ID
        $album_id = $album['aid'];

        // Get the category name
        $vQuery = "SELECT cat.name FROM " . $CONFIG['TABLE_CATEGORIES'] . " cat, " . $CONFIG['TABLE_ALBUMS'] . " alb WHERE alb.aid='" . $album_id . "' AND cat.cid=alb.category";
        $vRes = mysql_query($vQuery);
        $vRes = mysql_fetch_array($vRes);

        // Add to multi-dim array for sorting later
        if ($vRes['name']) {
            $listArray[$list_count][cat] = $vRes['name'];
        } else {
            $listArray[$list_count][cat] = $lang_upload_php['albums_no_category'];
        }
        $listArray[$list_count][aid] = $album['aid'];
        $listArray[$list_count][title] = $album['title'];
        $list_count++;
    }

    // Sort the pulldown options by category and album name
    $listArray = array_csort($listArray,'cat','title');

    // Finally, print out the nicely sorted and formatted drop down list
    $alb_cat = '';
    echo '                <option value="">' . $lang_upload_php['select_album'] . "</option>\n";
    foreach ($listArray as $val) {
        if ($val[cat] != $alb_cat) {
if ($alb_cat) echo "                </optgroup>\n";
            echo '                <optgroup label="' . $val[cat] . '">' . "\n";
            $alb_cat = $val[cat];
        }
        echo '                <option value="' . $val[aid] . '"' . ($val[aid] == $sel_album ? ' selected' : '') . '>   ' . $val[title] . "</option>\n";
    }
    if ($alb_cat) echo "                </optgroup>\n";

    // Close the drop down
    echo <<<EOT
            </select>
        </td>
    </tr>

EOT;
}


6/ un petit bugfix maintenant :
Trouvez le code suivant et supprimez le premier "&"
Code: [Select]
function& spring_cleaning($directory_path, $cache_time = 86400, $exclusion_list = array('index.html')) {comme ceci :
Code: [Select]
function spring_cleaning($directory_path, $cache_time = 86400, $exclusion_list = array('index.html')) {
7/ Trouvez le code suivant :
Code: [Select]
   // Check for incoming album placement data.
    if ((isset($_POST['album'])) and (isset($_POST['unique_ID']))) {
et ajoutez immédiatement après le code suivant :
Code: [Select]
       // Check if user selected an album to upload picture to. If not, die with error.
        // added by frogfoot
        $album = (int)$HTTP_POST_VARS['album'];
        if (!$album)cpg_die(ERROR, $lang_db_input_php['album_not_selected'], __FILE__, __LINE__);

8/ Trouvez le code suivant :
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;
}
remplacez-le par celui-ci :
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;
}

9/ Trouvez la ligne suivante :
Code: [Select]
       // Create array index.
        $index = count($escrow_array) - 1;
et ajoutez à sa suite par le code ci-après :
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.

10/ Trouvez la ligne suivante et ajoutez :
Code: [Select]
       // We have incoming placement data. Let's capture it.
Code: [Select]
$x = $index;
if ((int)$CONFIG['allow_assign_multiple_photos'] == 0) {
$x = 0;
} else {
$x = $index;
}

11/ Trouvez ce qui suit :
Code: [Select]
$album = (int)$HTTP_POST_VARS['album'];
$title = addslashes($HTTP_POST_VARS['title']);
$caption = addslashes($HTTP_POST_VARS['caption']);
$keywords = addslashes($HTTP_POST_VARS['keywords']);
$user1 = addslashes($HTTP_POST_VARS['user1']);
$user2 = addslashes($HTTP_POST_VARS['user2']);
$user3 = addslashes($HTTP_POST_VARS['user3']);
$user4 = addslashes($HTTP_POST_VARS['user4']);
et remplacez ce que vous avez trouvé par le code suivant :
Code: [Select]
$album = (int)$HTTP_POST_VARS['album'][$x];
$title = addslashes($HTTP_POST_VARS['title'][$x]);
$caption = addslashes($HTTP_POST_VARS['caption'][$x]);
$keywords = addslashes($HTTP_POST_VARS['keywords'][$x]);
$user1 = addslashes($HTTP_POST_VARS['user1'][$x]);
$user2 = addslashes($HTTP_POST_VARS['user2'][$x]);
$user3 = addslashes($HTTP_POST_VARS['user3'][$x]);
$user4 = addslashes($HTTP_POST_VARS['user4'][$x]);

SUITE POST SUIVANT :
« Last Edit: February 22, 2005, 09:35:24 am by PYAP »
Logged

Pascal YAP

  • Moderator
  • Coppermine addict
  • ****
  • Country: fr
  • Offline Offline
  • Gender: Male
  • Posts: 13833
  • Hello World :-)
    • CPG 1.5.x ExperiMental website
Re: (1/2) Uploadez d'un coup toutes vos images (CPG 1.3.2 MOD / HACK)
« Reply #1 on: February 21, 2005, 06:24:17 pm »

SUITE DU POST PRECEDENT :
Nous sommes toujours dans le fichier UPLOAD.PHP

12/ Trouvez le code :
Code: [Select]
       // Check to see if this is the last one.
        if(count($escrow_array) == '0') {

            // Create the final message.
            if ($PIC_NEED_APPROVAL) {

                if ($file_placement == 'no') {

                    $final_message = ''.$lang_upload_php['no_place'].'<br /><br />'.$lang_db_input_php['upload_success'];

                } else {

                    $final_message = ''.$lang_upload_php['yes_place'].'<br /><br />'.$lang_db_input_php['upload_success'];

                }

            } else {

                if ($file_placement == 'no') {

                    $final_message = ''.$lang_upload_php['no_place'].'<br /><br />'.$lang_upload_php['process_complete'];

                } else {

                    $final_message = ''.$lang_upload_php['yes_place'].'<br /><br />'.$lang_upload_php['process_complete'];

                }

            }

            // 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($CONFIG['gallery_admin_email'], 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'].'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;

        }
et remplacez-le par celui-ci :
Code: [Select]
// Check to see if this is the last one.
if(count($escrow_array) == '0') {

// Create the final message.
if ($PIC_NEED_APPROVAL) {

if ($file_placement == 'no') {

$final_message = ''.$lang_upload_php['no_place'].'<br /><br />'.$lang_db_input_php['upload_success'];

} else {

$final_message = ''.$lang_upload_php['yes_place'].'<br /><br />'.$lang_db_input_php['upload_success'];

}

} else {

if ($file_placement == 'no') {

$final_message = ''.$lang_upload_php['no_place'].'<br /><br />'.$lang_upload_php['process_complete'];

} else {

$final_message = ''.$lang_upload_php['yes_place'].'<br /><br />'.$lang_upload_php['process_complete'];

}

}

if ((int)$CONFIG['allow_assign_multiple_photos'] == 0) {
// 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($CONFIG['gallery_admin_email'], 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'].'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;
}
} //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($CONFIG['gallery_admin_email'], 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'].'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;
}
}

13/ Trouvez ceci :
Code: [Select]
   // Create array index.
    $index = count($escrow_array) - 1;
et ajoutez le code suivant :
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++) {

14/ Trouvez ceci :
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']);
et remplacez par :
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']);

15/ Trouvez le code suivant :
Code: [Select]
$form_array = array(
array($lang_upload_php['album'], 'album[]', 2),
array($lang_upload_php['pic_title'], 'title[]', 0, 255, 1),
array($captionLabel, 'caption', 3, $CONFIG['max_img_desc_length']),
array($lang_upload_php['keywords'], 'keywords[]', 0, 255, 1));

// Check for user defined fields.
if(!empty($CONFIG['user_field1_name'])) {
$form_array[] = array($CONFIG['user_field1_name'], 'user1', 0, 255, 1);
}

if(!empty($CONFIG['user_field2_name'])) {
$form_array[] = array($CONFIG['user_field2_name'], 'user2', 0, 255, 1);
}

if(!empty($CONFIG['user_field3_name'])) {
$form_array[] = array($CONFIG['user_field3_name'], 'user3', 0, 255, 1);
}

if(!empty($CONFIG['user_field4_name'])) {
$form_array[] = array($CONFIG['user_field4_name'], 'user4', 0, 255, 1);
}
puis remplacez-le par celui-ci :
Code: [Select]
$form_array = array(
array($lang_upload_php['album'], 'album[]', 2),
array($lang_upload_php['pic_title'], 'title[]', 0, 255, 1),
array($captionLabel, 'caption', 3, $CONFIG['max_img_desc_length']),
array($lang_upload_php['keywords'], 'keywords[]', 0, 255, 1));
if ((int)$CONFIG['allow_assign_multiple_photos'] == 0) {
$form_array[] = array('control', 'phase_2', 4);
$form_array[] = array('unique_ID', $_POST['unique_ID'], 4);
}

// Check for user defined fields.
if(!empty($CONFIG['user_field1_name[]'])) {
$form_array[] = array($CONFIG['user_field1_name[]'], 'user1', 0, 255, 1);
}

if(!empty($CONFIG['user_field2_name'])) {
$form_array[] = array($CONFIG['user_field2_name[]'], 'user2', 0, 255, 1);
}

if(!empty($CONFIG['user_field3_name'])) {
$form_array[] = array($CONFIG['user_field3_name[]'], 'user3', 0, 255, 1);
}

if(!empty($CONFIG['user_field4_name'])) {
$form_array[] = array($CONFIG['user_field4_name[]'], 'user4', 0, 255, 1);
}

16/ Recherchez ceci :
Code: [Select]
   // Create the form and echo more instructions.
create_form($form_array);
et ajoutez ceci :
Code: [Select]
}//end loop over pictures
17/ Trouvez le code suivant :
Code: [Select]
   // More instructions.
    if(count($escrow_array) > '1') {

        form_statement($lang_upload_php['place_instr_2']);

    }
puis ajoutez le code ci-après :
Code: [Select]
if ((int)$CONFIG['allow_assign_multiple_photos'] == 1) {
$form_array = array(
array('control', 'phase_2', 4),
array('unique_ID', $_REQUEST['unique_ID'], 4),
);
create_form($form_array);
}


18/ Ouvrez searchnew.php
et trouvez la fonction "function albumselect($id = "album")"
et remplacer-la entièrement par cette nouvelle fonction :
Code: [Select]
function albumselect($id = "album") {
// frogfoot re-wrote this function to present the list in categorized, sorted and nicely formatted order

    global $CONFIG, $lang_search_new_php;
    static $select = "";

    // Reset counter
    $list_count = 0;

    if ($select == "") {
        $result = db_query("SELECT aid, title FROM {$CONFIG['TABLE_ALBUMS']} WHERE category = 0");
        while ($row = mysql_fetch_array($result)) {
            // Add to multi-dim array for later sorting
            $listArray[$list_count][cat] = $lang_search_new_php['albums_no_category'];
            $listArray[$list_count][aid] = $row['aid'];
            $listArray[$list_count][title] = $row['title'];
            $list_count++;
        }
        mysql_free_result($result);

        $result = db_query("SELECT DISTINCT a.aid as aid, a.title as title, c.name as cname FROM {$CONFIG['TABLE_ALBUMS']} as a, {$CONFIG['TABLE_CATEGORIES']} as c WHERE a.category = c.cid AND a.category < '" . FIRST_USER_CAT . "'");
        while ($row = mysql_fetch_array($result)) {
            // Add to multi-dim array for later sorting
            $listArray[$list_count][cat] = $row['cname'];
            $listArray[$list_count][aid] = $row['aid'];
            $listArray[$list_count][title] = $row['title'];
            $list_count++;
        }
        mysql_free_result($result);

        if (defined('UDB_INTEGRATION')) {
            $sql = udb_get_admin_album_list();
        } else {
            $sql = "SELECT aid, CONCAT('(', user_name, ') ', title) AS title " . "FROM {$CONFIG['TABLE_ALBUMS']} AS a " . "INNER JOIN {$CONFIG['TABLE_USERS']} AS u ON category = (" . FIRST_USER_CAT . " + user_id)";
        }
        $result = db_query($sql);
        while ($row = mysql_fetch_array($result)) {
            // Add to multi-dim array for later sorting
            $listArray[$list_count][cat] = $lang_search_new_php['personal_albums'];
            $listArray[$list_count][aid] = $row['aid'];
            $listArray[$list_count][title] = $row['title'];
            $list_count++;
        }
        mysql_free_result($result);

        $select = '<option value="0">' . $lang_search_new_php['select_album'] . "</option>\n";

        // Sort the pulldown options by category and album name
        $listArray = array_csort($listArray,'cat','title');

        // Create the nicely sorted and formatted drop down list
        $alb_cat = '';
        foreach ($listArray as $val) {
            if ($val[cat] != $alb_cat) {
         if ($alb_cat) $select .= "</optgroup>\n";
                $select .= '<optgroup label="' . $val[cat] . '">' . "\n";
                $alb_cat = $val[cat];
            }
            $select .= '<option value="' . $val[aid] . '"' . ($val[aid] == $sel_album ? ' selected' : '') . '>   ' . $val[title] . "</option>\n";
        }
        if ($alb_cat) $select .= "</optgroup>\n";
    }

    return "\n<select name=\"$id\" class=\"listbox\">\n$select</select>\n";
}

// Multi-dim array sort, with ability to sort by two and more dimensions
// Coded by Ichier2003, available at php.net
// syntax:
// $array = array_csort($array [, 'col1' [, SORT_FLAG [, SORT_FLAG]]]...);
function array_csort() {
   $args = func_get_args();
   $marray = array_shift($args);

   $msortline = "return(array_multisort(";
   foreach ($args as $arg) {
       $i++;
       if (is_string($arg)) {
           foreach ($marray as $row) {
               $sortarr[$i][] = $row[$arg];
           }
       } else {
           $sortarr[$i] = $arg;
       }
       $msortline .= "\$sortarr[".$i."],";
   }
   $msortline .= "\$marray));";

   eval($msortline);
   return $marray;
}

FIN

PYAP
Logged

showa

  • Coppermine newbie
  • Offline Offline
  • Gender: Male
  • Posts: 8
    • Devloweb
Re: [MOD / HACK] (1/2) Uploadez d'un coup toutes vos images
« Reply #2 on: March 06, 2005, 04:18:14 am »

Bonjour

Jai fait la modif, c'est pas une rigolage
pas de message d'erreur, mais dans la fenetre uplaod effectuer, la petite fenetre de droite reste vide de toute instruction et me plante la
impossible d'allee plus loin

d'ou peut provenir l'erreur?

merci
Logged

Pascal YAP

  • Moderator
  • Coppermine addict
  • ****
  • Country: fr
  • Offline Offline
  • Gender: Male
  • Posts: 13833
  • Hello World :-)
    • CPG 1.5.x ExperiMental website
Re: [MOD / HACK] (1/2) Uploadez d'un coup toutes vos images
« Reply #3 on: March 07, 2005, 10:20:16 am »

Bonjour Showa,

Quote
Jai fait la modif, c'est pas une rigolage
Vrai ! Il faut prendre pas mal de précautions pour en arriver à bout  ;)

Quote
d'ou peut provenir l'erreur?
Impossible à dire dans l'état actuel des renseignements fournis !
Depuis le Panneau de Configuration de Coppermine, il faut tout en bas de page activer le Mode Debug. Ainsi, les erreurs invisibles le deviennent !
Passez en Mode Debug quelques instants, faites un copier/coller des messages d'erreurs et postez tout ça ici !

A bientôt

PYAP
Logged

mister_sam

  • Coppermine novice
  • *
  • Offline Offline
  • Gender: Male
  • Posts: 28
Re: [MOD / HACK] (1/2) Uploadez d'un coup toutes vos images
« Reply #4 on: March 07, 2005, 08:21:18 pm »

Mod très interressant mais très (trop) lourd à mettre en place ! :o

Merci PYAP tout de même ! ;)

De mon côté, Je vais attendre la V 1.4 de coppermine ;D
Logged

Cisi

  • Coppermine newbie
  • Offline Offline
  • Gender: Male
  • Posts: 14
Re: [MOD / HACK] (1/2) Uploadez d'un coup toutes vos images
« Reply #5 on: April 03, 2005, 11:42:14 pm »

Very nice . But i have some trouble .
Please check here :
http://www.celebrityforum.tv/gallery/upload1.php
try to upload .
Would be very nice if you post entire upload.php code . Maybe in attachment .
Sorry for my french .
Greetings .

now french  :o :o

Très jolie mod. Mais j'ai un certain ennui. Svp contrôle ici : http://www.celebrityforum.tv/gallery/upload1.php essayez de télécharger. Soyez très gentil si vous signalez le code entier d'upload.php. Peut-être dans l'attachement. Désolé pour mon Français. Salutations.
Logged

Pascal YAP

  • Moderator
  • Coppermine addict
  • ****
  • Country: fr
  • Offline Offline
  • Gender: Male
  • Posts: 13833
  • Hello World :-)
    • CPG 1.5.x ExperiMental website
Re: [MOD / HACK] (1/2) Uploadez d'un coup toutes vos images
« Reply #6 on: April 03, 2005, 11:58:39 pm »

Ciao Cisi  ;)

Votre fichier Upload1.php retourne une erreur fatale à la ligne 222
Code: [Select]
Fatal error: Call to undefined function:  array_csort() in /web/htdocs/www.celebrityforum.tv/home/gallery/upload1.php on line 222Que contient cette ligne dans votre fichier upload1.php ?

PYAP
Logged

nol33t

  • Contributor
  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 244
  • Exploring Coppermine in every directions
    • tieum's pics
Re: [MOD / HACK] (1/2) Uploadez d'un coup toutes vos images
« Reply #7 on: April 04, 2005, 01:05:45 am »

il te manque la fonction array_csort dans ton fichier include/functions.inc.php

a la fin de ce fichier, avant  "?>", essaye d'ajouter ceci:

Code: [Select]
/**
* Multi-dim array sort, with ability to sort by two and more dimensions
* Coded by Ichier2003, available at php.net
* syntax:
* $array = array_csort($array [, 'col1' [, SORT_FLAG [, SORT_FLAG]]]...);
**/
function array_csort() {
   $args = func_get_args();
   $marray = array_shift($args);

   $msortline = "return(array_multisort(";
   foreach ($args as $arg) {
       $i++;
       if (is_string($arg)) {
           foreach ($marray as $row) {
               $sortarr[$i][] = $row[$arg];
           }
       } else {
           $sortarr[$i] = $arg;
       }
       $msortline .= "\$sortarr[".$i."],";
   }
   $msortline .= "\$marray));";

   eval($msortline);
   return $marray;
}

François Keller

  • Moderator
  • Coppermine addict
  • ****
  • Country: fr
  • Offline Offline
  • Gender: Male
  • Posts: 9094
  • aka Frantz
    • Ma galerie
Re: [MOD / HACK] (1/2) Uploadez d'un coup toutes vos images
« Reply #8 on: April 18, 2005, 07:32:16 am »

Bonjour à tous,

Je viens d'installer ce mod mais, si j'ai bien la nouvelle option dans le panneau de configuration, je n'arrive pas à trouver comment faire pour charger les photos en une fois  ???

Ou plutôt, je n'ai pas la liste des albums lorsqu'il s'agit de définir vers quels albums les envoyer ???

J'ai du oublier quelque chose ou alors je suis très fatigué ;)
« Last Edit: April 18, 2005, 07:42:24 am by Frantz »
Logged
Avez vous lu la DOC ? la FAQ ? et cherché sur le forum avant de poster ?
Did you read the DOC ? the FAQ ? and search the board before posting ?
Mon Blog

Pascal YAP

  • Moderator
  • Coppermine addict
  • ****
  • Country: fr
  • Offline Offline
  • Gender: Male
  • Posts: 13833
  • Hello World :-)
    • CPG 1.5.x ExperiMental website
Re: [MOD / HACK] (1/2) Uploadez d'un coup toutes vos images
« Reply #9 on: April 19, 2005, 10:19:54 am »

Frantz,

je pense que l'éditeur de texte que j'utilise injecte des retours chariot invisibles !
Nous avions déjà constaté ce problème avec chtito il y a longtemps !
Tente de vérifier si il n'y a pas d'espace et de retour chariot en fin de chaque ligne.

Tout fonctionne en local pour moi, mais je n'ai pas placé ce MOD en ligne... Y aurait-il une différence de comportement

PYAP
Logged

François Keller

  • Moderator
  • Coppermine addict
  • ****
  • Country: fr
  • Offline Offline
  • Gender: Male
  • Posts: 9094
  • aka Frantz
    • Ma galerie
Re: [MOD / HACK] (1/2) Uploadez d'un coup toutes vos images
« Reply #10 on: April 19, 2005, 11:32:04 am »

Je vais essayer de voir ça.
 je vous tiens au courrant
Logged
Avez vous lu la DOC ? la FAQ ? et cherché sur le forum avant de poster ?
Did you read the DOC ? the FAQ ? and search the board before posting ?
Mon Blog

François Keller

  • Moderator
  • Coppermine addict
  • ****
  • Country: fr
  • Offline Offline
  • Gender: Male
  • Posts: 9094
  • aka Frantz
    • Ma galerie
Re: [MOD / HACK] (1/2) Uploadez d'un coup toutes vos images
« Reply #11 on: April 19, 2005, 09:46:54 pm »

Re bonjour,

J'ai essayé de trouver des caractères cachés dans le script mais je n'ai rien trouvé  ???

Je crois que je vais reprendre à zero, j'ai peut être oublié quelque chose :-\\
Logged
Avez vous lu la DOC ? la FAQ ? et cherché sur le forum avant de poster ?
Did you read the DOC ? the FAQ ? and search the board before posting ?
Mon Blog

Youpi

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 21
Re: [MOD / HACK] (1/2) Uploadez d'un coup toutes vos images
« Reply #12 on: May 25, 2005, 03:42:21 pm »

est ce que le mod marche alors ?
Logged

François Keller

  • Moderator
  • Coppermine addict
  • ****
  • Country: fr
  • Offline Offline
  • Gender: Male
  • Posts: 9094
  • aka Frantz
    • Ma galerie
Re: [MOD / HACK] (1/2) Uploadez d'un coup toutes vos images
« Reply #13 on: May 25, 2005, 04:51:04 pm »

Je ne sais pas, je l'ai désinstallé et n'ai pas encore eu le  temps de le remettre en ligne
Logged
Avez vous lu la DOC ? la FAQ ? et cherché sur le forum avant de poster ?
Did you read the DOC ? the FAQ ? and search the board before posting ?
Mon Blog

Pascal YAP

  • Moderator
  • Coppermine addict
  • ****
  • Country: fr
  • Offline Offline
  • Gender: Male
  • Posts: 13833
  • Hello World :-)
    • CPG 1.5.x ExperiMental website
Re: [MOD / HACK] (1/2) Uploadez d'un coup toutes vos images
« Reply #14 on: May 25, 2005, 06:20:49 pm »

Bonjour,

C'est insensé cette affaire  ???
Avez-vous fait correspondre ceci correctement :

`cpg132_config` à votre configuration !

Code: [Select]
INSERT INTO `cpg132_config` ( `name` , `value` )
VALUES (
'allow_assign_multiple_photos', '0'
);

Je n'ai pas installé ce MOD en ligne, je redoute le pire maintenant !
(et en local, j'ai déinstallé le Coppermine qui me servait de testeur et ce MOD qui allait très bien avec :-\\ )

@Youpi
Quote
est ce que le mod marche alors ?
Pour le savoir désormais, installez-le et donnez-nous la réponse  :D

PYAP
Logged

Bastox

  • Coppermine newbie
  • Offline Offline
  • Posts: 8
Re: [MOD / HACK] (1/2) Uploadez d'un coup toutes vos images
« Reply #15 on: February 17, 2007, 08:02:41 am »

Bonjour a tous.

Je me permet de poster car je souhaiterais savoir ce qu'il en est de ca :
Quote
Il n'est pas improbable que ce MOD fasse partie de la version Coppermine 1.4.0 !
Je voudrais savoir si cela a ete fais.
Car quand j'upload des fichiers je dois indiquer les album images par images et c'est pas tres pratique.
J'ai fais l'install en local et j'ai effectivement la case pour mettre toute les image dans le meme album mais ca bug. Alors je viens au news.
 :)

Merci de votre attention.
Logged

Pascal YAP

  • Moderator
  • Coppermine addict
  • ****
  • Country: fr
  • Offline Offline
  • Gender: Male
  • Posts: 13833
  • Hello World :-)
    • CPG 1.5.x ExperiMental website
Re: [MOD / HACK] (1/2) Uploadez d'un coup toutes vos images
« Reply #16 on: February 17, 2007, 02:26:39 pm »

Bonjour,

Vuos avez fait remonté à la surface un sujet qui daait de 2005 ! Nous vous en remercions.
Beaucoup de choses ont changé depuis !
Ce que vous désirez faire peut s'effectuer au moyen de "Jupload".
C'est une appli JAVA qui mérite votre attention.
Le développeur est Français.

PYAP
Logged
Pages: [1]   Go Up
 

Page created in 0.039 seconds with 20 queries.