Batch Add - MOD to list user galleries in drop-down list Batch Add - MOD to list user galleries in drop-down list
 

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]

Main Menu

Batch Add - MOD to list user galleries in drop-down list

Started by jabetcha, April 13, 2007, 08:29:50 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

jabetcha

There are lots of posts about the Batch Add functionality and this seems to have changed in recent versions of Coppermine (some previous versions would allow an admin to batch add into any gallery)

Here's a quick patch for 1.4.10 to display all galleries on the batch add page. Use at your own risk

This file is in the bridge/ folder. This code is in patch -u format. If you don't have patch on your machine, delete the lines with the - in front and paste the ones with the + (delete the '+' though)

--- udb_base.inc.php.orig       2007-04-08 13:14:53.000000000 -0400
+++ udb_base.inc.php    2007-04-12 10:52:18.000000000 -0400
@@ -617,7 +617,9 @@
                         $sql = "SELECT aid, CONCAT('(', {$this->field['username']}, ') ', a.title) AS title
                                                         FROM {$CONFIG['TABLE_ALBUMS']} AS a
                                                         INNER JOIN {$this->usertable} AS u
-                                                        ON category = (" . FIRST_USER_CAT . " + ".USER_ID.") AND {$this->field['user_id']} = ".USER_ID." ORDER BY title";
+                                                        ON category - " . FIRST_USER_CAT . " = {$this->field['user_id']}
+                -- ON category = (" . FIRST_USER_CAT . " + ".USER_ID.") AND {$this->field['user_id']} = ".USER_ID."
+ORDER BY title";
                 } else {
                         $sql = "SELECT aid, IF(category > " . FIRST_USER_CAT . ", CONCAT('* ', title), CONCAT(' ', title)) AS title " . "FROM {$CONFIG['TABLE_ALBUMS']} WHERE category = ".(FIRST_USER_CAT+USER_ID)." ORDER BY title";
                 }
@@ -793,4 +795,4 @@
                }
        }
}
-?>
\ No newline at end of file
+?>

Joachim Müller

The fact that previous versions allowed you to batch-add to user albums actually was a bug that got fixed in a maintenance release. This is a software design question that the dev team hasn't finally decided on yet. Review http://forum.coppermine-gallery.net/index.php?topic=27325.0