I haxored the edit_all_props script that I found floating around. I commented out all the changes it was making and added this
$gallery->album->setOwner(3);
I may clean it up so each option has a checkbox and you can select the owner UID from a list if I get a chance. But this worked nicely.
(not cleaned up - but did change all the owners in this case to a user with UID 3
<!-- BBCode Start --><TABLE BORDER=0 ALIGN=CENTER WIDTH=85%><TR><TD><font class="pn-sub">Code:</font><HR></TD></TR><TR><TD><FONT class="pn-sub"><PRE> <?php
/*
* edit_all_properties.php: Change settings for multiple albums
* By Beckett Madden-Woods (beck@beckettmw.com)
*
* Version 0.1
* November 25, 2002
*
* Adaptation for:
* Gallery - a web based photo album viewer and editor
* Copyright (C) 2000-2002 Bharat Mediratta
* http://gallery.sourceforge.net/
*
*/
/* Hack prevention. */
if (!empty($HTTP_GET_VARS["GALLERY_BASEDIR"]) ||
!empty($HTTP_POST_VARS["GALLERY_BASEDIR"]) ||
!empty($HTTP_COOKIE_VARS["GALLERY_BASEDIR"])) {
print "Security violation
";
exit;
}
require($GALLERY_BASEDIR . "init.php");
/* defines */
define("LOAD_PHOTOS", TRUE);
define("DONT_LOAD_PHOTOS", FALSE);
define("INCLUDE_HIDDEN", TRUE);
$albumDB = new AlbumDB(LOAD_PHOTOS);
/* scan album for sub-albums */
function scanAlbum($albumName) {
global $gallery;
global $albumDB;
$album = $albumDB->getAlbumbyName($albumName);
$numPhotos = $album->numPhotos(INCLUDE_HIDDEN);
for ($i = 1; $i <= $numPhotos; $i++) {
$nestedAlbum = $album->isAlbumName($i);
if ($nestedAlbum) {
print "<tr><td></td><td align="left">
" .
"<table border="0" cellpadding="0" cellspacing="0">" .
"<tr><td align="center" class="fineprint">" .
"<input type="checkbox" name="gall[]" value="$nestedAlbum"" .
" checked /></td><td align="left" class="fineprint">" .
"$nestedAlbum</td></tr>
";
scanAlbum($nestedAlbum);
print "</table></td></tr>
";
}
}
}
?>
<html>
<head>
<title>Edit Properties</title>
<?php echo getStyleSheetLink() ?>
</head>
<body>
<?php
/* change properties */
if ($save) {
print "<center><b>Changing Album Properties</b></center><br /><br />
";
foreach ($gall as $albumName) {
$gallery->album = $albumDB->getAlbumbyName($albumName);
print "<b>Album:</b> $albumName<br />
";
if (!$gallery->user->canWriteToAlbum($gallery->album)) {
print "<span class="error"><b>Error: </b>" .
"You cannot write to this album!</span><br />
";
}
else {
/* $gallery->album->fields["bgcolor"] = $bgcolor;
$gallery->album->fields["textcolor"] = $textcolor;
$gallery->album->fields["linkcolor"] = $linkcolor;
$gallery->album->fields["font"] = $font;
$gallery->album->fields["bordercolor"] = $bordercolor;
$gallery->album->fields["border"] = $border;
$gallery->album->fields["background"] = $background;
$gallery->album->fields["thumb_size"] = $thumb_size;
$gallery->album->fields["resize_size"] = $resize_size;
$gallery->album->fields["returnto"] = $returnto;
$gallery->album->fields["rows"] = $rows;
$gallery->album->fields["cols"] = $cols;
$gallery->album->fields["fit_to_window"] = $fit_to_window;
$gallery->album->fields["use_fullOnly"] = $use_fullOnly;
$gallery->album->fields["print_photos"] = $print_photos;
$gallery->album->fields["use_exif"] = $use_exif;
$gallery->album->fields["display_clicks"] = $display_clicks;
$gallery->album->fields["public_comments"] = $public_comments; */
$gallery->album->setOwner(3);
$gallery->album->save();
}
}
print "<br />
";
print "<center><form>" .
"<input type="submit" value="Dismiss" onClick="opener.location.reload(); parent.close();">" .
"</form></center><br />
";
print "</body></html>";
exit;
}
?>
<script language="javascript">
// <!--
function setCheck(val) {
ufne=document.theform;
len = ufne.elements.length;
for(i = 0 ; i < len ; i++) {
if (ufne.elements[i].name==&#039;gall[]&#039;) {
ufne.elements[i].checked=val;
}
}
}
function invertCheck() {
ufne=document.theform;
len = ufne.elements.length;
for(i = 0 ; i < len ; i++) {
if (ufne.elements[i].name==&#039;gall[]&#039;) {
ufne.elements[i].checked = !(ufne.elements[i].checked);
}
}
}
// -->
</script>
<center>
<b>Edit Properties</b><br /><br />
<?php
print "<table border="0" cellpadding="0" cellspacing="0">
";
/* print out albums with checkboxes */
print "<tr><td width="50%" valign="top">
";
echo makeFormIntro("edit_all_owners.php",
array("name" => "theform",
"method" => "POST"));
print '<input type="hidden" name="save" value="TRUE">' . "
";
print "<table border="0" cellpadding="0" cellspacing="0">
";
print '<tr><td align="center" colspan="3" class="fineprint">'
. '<a href="javascript:setCheck(1)">Check All</a> - '
. '<a href="javascript:setCheck(0)">Clear All</a> - '
. '<a href="javascript:invertCheck()">Invert Selection</a>'
. "</td></tr>
";
print "<tr><td align="center" class="fineprint" " .
"style="font-weight: bold;"> </td><td align="left" " .
"class="fineprint" style="font-weight: bold;">Album Name" .
"</td><td align="center" class="fineprint" style="" .
"font-weight: bold;">Owner</td></tr>
";
$numAlbums = $albumDB->numAlbums($gallery->user);
$noAlbums = 1;
for ($i=1; $i <= $numAlbums; $i++) {
$gallery->album = $albumDB->getAlbum($gallery->user, $i);
$albumName = $gallery->album->fields["name"];
$isRoot = $gallery->album->isRoot();
if ($isRoot) {
$owner = $gallery->album->getOwner();
$user = $owner->getUsername();
}
else {
$user = " ";
}
if ($gallery->user->canWriteToAlbum($gallery->album)) {
$noAlbums = 0;
print "<tr><td align="center" class="fineprint">" .
"<input type="checkbox" name="gall[]" value="$albumName"" .
" checked /></td><td align="left" class="fineprint">" .
"$albumName</td><td align="center" " .
"class="fineprint">$user</td></tr>
";
/* scan album for sub-albums */
scanAlbum($albumName);
}
}
print "</table>
";
/* if no editable albums, print an error message */
if ($noAlbums) {
print "<span class="error"><b>You cannot edit any albums!</b>" .
"</span><br />
";
}
print "</td>
";
?>
<td>
<table border="0" cellpadding="0" cellspacing="0">
<tr>
<td class="fineprint">Background Color</td>
<td class="fineprint"><input type=text name="bgcolor" value="<?php echo $gallery->album->fields["bgcolor"]?>"></td>
</tr>
<tr>
<td class="fineprint">Text Color</td>
<td class="fineprint"><input type=text name="textcolor" value="<?php echo $gallery->album->fields["textcolor"]?>"></td>
</tr>
<tr>
<td class="fineprint">Link Color</td>
<td class="fineprint"><input type=text name="linkcolor" value="<?php echo $gallery->album->fields["linkcolor"]?>"></td>
</tr>
<tr>
<td class="fineprint">Background Image (URL)</td>
<td class="fineprint"><input type=text name="background" value="<?php echo $gallery->album->fields["background"]?>"></td>
</tr>
<tr>
<td class="fineprint">Font</td>
<td class="fineprint"><input type=text name="font" value="<?php echo $gallery->album->fields["font"]?>"></td>
</tr>
<tr>
<td class="fineprint">Borders</td>
<td class="fineprint"><select name="border">
<?php
foreach (array("off", 1, 2, 3, 4) as $opt) {
$sel = "";
if (!strcmp($opt, $gallery->app->default["border"])) {
$sel = " selected";
}
echo "<option$sel>$opt";
}
?>
</select></td>
</tr>
<tr>
<td class="fineprint">Border color</td>
<td class="fineprint"><input type=text name="bordercolor" value="<?php echo $gallery->app->default["bordercolor"]?>"></td>
</tr>
<tr>
<td class="fineprint">Thumbnail size</td>
<td class="fineprint"><input type=text name="thumb_size" value="<?php echo $gallery->app->default["thumb_size"]?>"></td>
</tr>
<tr>
<td class="fineprint">Auto-Resize</td>
<td class="fineprint"><select name="resize_size">
<?
foreach (array("off", 400, 500, 600, 640, 700, 800, 1024) as $opt) {
$sel = "";
if (!strcmp($opt, $gallery->app->default["resize_size"])) {
$sel = " selected";
}
echo "<option$sel>$opt";
}
?>
</select></td>
</tr>
<tr>
<td class="fineprint">Show <i>Return to</i> link</td>
<td class="fineprint"><select name="returnto">
<?
foreach (array("yes", "no") as $opt) {
$sel = "";
if (!strcmp($opt, $gallery->app->default["returnto"])) {
$sel = " selected";
}
echo "<option$sel>$opt";
}
?>
</select></td>
</tr>
<tr>
<td class="fineprint">Rows</td>
<td class="fineprint"><select name="rows">
<?
foreach (array(1, 2, 3, 4, 5, 6, 7, 8, 9) as $opt) {
$sel = "";
if (!strcmp($opt, $gallery->app->default["rows"])) {
$sel = " selected";
}
echo "<option$sel>$opt";
}
?>
</select></td>
</tr>
<tr>
<td class="fineprint">Columns</td>
<td class="fineprint"><select name="cols">
<?
foreach (array(1, 2, 3, 4, 5, 6, 7, 8, 9) as $opt) {
$sel = "";
if (!strcmp($opt, $gallery->app->default["cols"])) {
$sel = " selected";
}
echo "<option$sel>$opt";
}
?>
</select></td>
</tr>
<tr>
<td class="fineprint">Auto fit-to-window for<br>images without a resized copy</td>
<td class="fineprint"><select name="fit_to_window">
<?
foreach (array("yes", "no") as $opt) {
$sel = "";
if (!strcmp($opt, $gallery->app->default["fit_to_window"])) {
$sel = " selected";
}
echo "<option$sel>$opt";
}
?>
</select></td>
</tr>
<tr>
<td class="fineprint">Offer visitors ability to specify<br>preference for full-size or resized images</td>
<td class="fineprint"><select name="use_fullOnly">
<?
foreach (array("yes", "no") as $opt) {
$sel = "";
if (!strcmp($opt, $gallery->app->default["use_fullOnly"])) {
$sel = " selected";
}
echo "<option$sel>$opt";
}
?>
</select></td>
</tr>
<tr>
<td class="fineprint">Which photo printing service<br>do you want to let visitors use?</td>
<td class="fineprint"><select name="print_photos">
<?
foreach (array("none", "shutterfly") as $opt) {
$sel = "";
if (!strcmp($opt, $gallery->app->default["print_photos"])) {
$sel = " selected";
}
echo "<option$sel>$opt";
}
?>
</select></td>
</tr>
<?php
if ($gallery->app->use_exif) {
?>
<tr>
<td class="fineprint">Display EXIF data?</td>
<td class="fineprint"><select name="use_exif"><?php echo selectOptions($gallery->album, "use_exif", array("no", "yes")) ?></select></td>
</tr>
<?php
} // end if
?>
<tr>
<td class="fineprint">Display click counter for this album?</td>
<td class="fineprint"><select name="display_clicks">
<?
foreach (array("yes", "no") as $opt) {
$sel = "";
if (!strcmp($opt, $gallery->app->default["display_clicks"])) {
$sel = " selected";
}
echo "<option$sel>$opt";
}
?>
</select></td>
</tr>
<tr>
<td class="fineprint">Allow public commenting for photos in this album?</td>
<td class="fineprint"><select name="public_comments">
<?
foreach (array("yes", "no") as $opt) {
$sel = "";
if (!strcmp($opt, $gallery->app->default["public_comments"])) {
$sel = " selected";
}
echo "<option$sel>$opt";
}
?>
</select></td>
</tr>
</table>
</td>
</tr>
</table>
<br />
<br />
<input type=submit name="submit" value="Apply">
<input type=reset value="Undo">
<input type=submit name="submit" value="Close" onclick='parent.close()'>
</form>
<script language="javascript1.2">
<!--
// position cursor in top form field
document.theform.bgcolor.focus();
//-->
</script>
</body>
</html>
</TD></TR></TABLE><!-- BBCode End -->