Add multiple albums at one time. Take full directory and al

ladyslipper98201
ladyslipper98201's picture

Joined: 2003-03-06
Posts: 26
Posted: Sat, 2003-03-08 23:14

Is anyone working on this feature? I did see a post about addAllGalleries.pl or something like that but that seems to be a standalone util to create the galleries.

 
headhunter

Joined: 2003-01-13
Posts: 75
Posted: Sun, 2003-03-09 08:15

search for "galleryadd.pl" or talk to "J" better known as "jmullan".

 
ladyslipper98201
ladyslipper98201's picture

Joined: 2003-03-06
Posts: 26
Posted: Tue, 2003-03-11 22:41

Well I've created an add_albums.php (save_albums.php) page that allows you to specify directories and have those directories uploaded and turned into albums - name and title set to the name of the directory - with all pictures in the directory being saved into those albums.

I'll see about creating some diff files and uploading them to source forge as a patch. Since it is separate functionaly from the rest of gallery it shouldn't break anything though there are likely to be some bugs in the code.

 
ladyslipper98201
ladyslipper98201's picture

Joined: 2003-03-06
Posts: 26
Posted: Wed, 2003-03-12 17:47

Alright I've uploaded the patch and the new files.

They are at source forge under this id.

[ 702384 ] Add albums defaults with dirname

 
evoldog

Joined: 2003-03-21
Posts: 6
Posted: Fri, 2003-03-21 22:46

This sounds like just what I need! I have over one hundred folders, each containing about 40 images. How do I find this patch? I don't understand how to find it based on ID number.

Thanks!

 
evoldog

Joined: 2003-03-21
Posts: 6
Posted: Fri, 2003-03-21 22:54

This sounds like just what I need! I have over one hundred folders, each containing about 40 images. How do I find this patch? I don't understand how to find it based on ID number.

Thanks!

 
joan
joan's picture

Joined: 2002-10-21
Posts: 3473
Posted: Sat, 2003-03-22 08:17

<!-- BBCode Start --><A HREF="http://sourceforge.net/tracker/?func=browse&amp;group_id=7130&amp;atid=307130" TARGET="_blank">http://sourceforge.net/tracker/?func=browse&amp;group_id=7130&amp;atid=307130</A><!-- BBCode End -->

 
evoldog

Joined: 2003-03-21
Posts: 6
Posted: Wed, 2003-03-26 15:11

ok, i found the three files and uploaded them to the gallery folder on the server. now how do i run them?

in a browser if i type in the url to add_albums.php i get a blank page.

 
evoldog

Joined: 2003-03-21
Posts: 6
Posted: Wed, 2003-03-26 15:35

ah, i figured out you need to be logged in first. duh.

so now i can load the add_albums.php script in a browser, but after entering a folder name and hitting the upload button, it seems to send me to the save_albums.php page, and it just shows one line:

115d114 <$adminCommands .= '[add albums] ';

where [add albums] is a link... to "#" apparently.

what am i doing wrong?

thanks.

 
opel70

Joined: 2002-11-07
Posts: 79
Posted: Thu, 2003-03-27 03:43

I just had to post to say thanks. This is working perfectly for me. I just need to remember that the directory names can't have spaces in them for Gallery. Can this process be modified to automatically remove any spaces in the directory name?

 
evoldog

Joined: 2003-03-21
Posts: 6
Posted: Mon, 2003-03-31 18:55

so i've got it running but it hasn't worked too well. the photos don't seem to match up to the orignial jpegs in my folders. anyone else have good success with this? it would be really great to have something like this work, because i have around 4000 large jpegs i would like to import into gallery without having to manually create each album.

 
jacksdad
jacksdad's picture

Joined: 2002-08-24
Posts: 95
Posted: Sat, 2003-04-19 15:58
Quote:
Alright I've uploaded the patch and the new files.

They are at source forge under this id.

[ 702384 ] Add albums defaults with dirname

I added add_albums and save_albums and was able to see the add albums screen, however, "Click the Browse button to locate an album to upload. " I don't see a "browse" buttom there, am I lost/confused/just plain weird?

Thanks

 
joan
joan's picture

Joined: 2002-10-21
Posts: 3473
Posted: Sat, 2003-04-19 23:55

Apparently not all browsers can handle file uploads. Can you see the browse button in add_photos.php?

 
jacksdad
jacksdad's picture

Joined: 2002-08-24
Posts: 95
Posted: Sun, 2003-04-20 12:02
Quote:
Apparently not all browsers can handle file uploads. Can you see the browse button in add_photos.php?

Yep, I can see it in add_photos.php but not add_albums.php

I tried IE 5.50 and NS 4.77

Again, I created add_albums.php and save_albums.php did I miss something here.

Here is the add_albums.php file: So, I really can not find what I am missing with the browse button not showing up or am I really lost? Thoughts? Ideas?

I have been playing with the code, and I think it has to do with line 105,
<td><input name="urls[]" type="text" size=40></td></tr>
it is bolded down below.

If I change it to: <input name="userfile[]" type="file" size=40> the browse shows up.

Thanks

?>
<?php
// Hack prevention.
if (!empty($HTTP_GET_VARS["GALLERY_BASEDIR"]) ||
!empty($HTTP_POST_VARS["GALLERY_BASEDIR"]) ||
!empty($HTTP_COOKIE_VARS["GALLERY_BASEDIR"])) {
print "Security violationn";
exit;
}
?>
<?php require($GALLERY_BASEDIR . "init.php"); ?>
<?php
// Hack check
if (!$gallery->user->canCreateAlbums()) {
exit;
}

if (!$boxes) {
$boxes = 1;
}

?>

<html>
<head>
<title>Add Albums</title>
<?php echo getStyleSheetLink() ?>

<script language="Javascript">
<!--
function reloadPage() {
document.count_form.submit();
return false;
}
// -->
</script>
</head>
<body>

<span class="popuphead">Add Albums</span>
<br>
<span class="popup">
Click the <b>Browse</b> button to locate an album to upload.
An album to upload is a directory.
<?php /*
// add zip support later
<span class="admin">
<?php if ($gallery->app->feature["zip"]) { ?>
<br>
  Tip: Upload a ZIP file full of photos and movies!
<?php } ?>
<br>
  (Supported file types: <?php echo join(", ", acceptableFormatList()) ?>)
</span>
*/?>

<br><br>

<?php echo makeFormIntro("add_albums.php",
array("name" => "count_form",
"method" => "POST")); ?>
1. Select the number of albums you want to upload:
<select name="boxes" onChange='reloadPage()'>
<?php for ($i = 1; $i <= 10; $i++) {
echo "<option ";
if ($i == $boxes) {
echo "selected ";
}
echo "value="$i">$in";

} ?>
</select>
<br>
</form>

<?php echo makeFormIntro("save_albums.php",
array("name" => "upload_form",
"enctype" => "multipart/form-data",
"method" => "POST")); ?>
2. Use the Browse button to find the album on your computer
<input type="hidden" name="max_file_size" value="10000000">
<table>
<?php for ($i = 0; $i < $boxes; $i++) { ?>
<tr><td>
Directory</td>
<td><input name="urls[]" type="text" size=40></td></tr>
<tr><td></td></tr>
<?php } ?>
</table>
<input type="checkbox" name="useSymlink">
Use symlinks. If your server is on unix and your images are local to the server and accessible and you would like to have the
server create symlinks to your images instead of copying them to your gallery check this box.
<br>
<center>
<input type="button" value="Upload Now" onClick='document.upload_form.submit()'>
<input type=submit value="Cancel" onclick='parent.close()'>
</center>
</form>
<br>

</body>
</html>

 
jacksdad
jacksdad's picture

Joined: 2002-08-24
Posts: 95
Posted: Sun, 2003-04-20 12:27

Also, Maybe my understanding of this is incorrect, I thought it would upload a full directory from my local computer, not a server, to the albums directory.

Please someone let me know if I am wrong.

Thanks

PS.

W/O the browse button I typed c:windowsWINNTDesktop... path to jpg and hit upload....

The reply was "Fetching Urls...
Could not open url: 'http://C:windows......."

So, I put ../../ path to jpg on my server and hit upload, and that went just fine ...

But No browse button and not from my local machine only from a url or my server.

 
majestique

Joined: 2005-11-03
Posts: 8
Posted: Sat, 2006-12-16 19:38

i'm trying to add multiple albums.. but this isn't working for me.. i couldn't find the files on sourceforge.. i'm using 2.1.2 right now.. can anyone help?

 
majestique

Joined: 2005-11-03
Posts: 8
Posted: Sat, 2006-12-16 19:42

actually.. i read the faq about adding multiple items from backup source :)