Author Topic: creating folders with names instead of numbers  (Read 3213 times)

0 Members and 1 Guest are viewing this topic.

Offline trout7

  • album.pl Donor
  • album.pl User
  • *
  • Posts: 14
  • Karma: +0/-0
    • ngto.org
creating folders with names instead of numbers
« on: November 21, 2002, 11:16:19 »
One really cool enhancement for UBB integration would be to create the user upload folders with their UBB name instead of their UBB number.  That would allow users to upload their own photos and the admin wouldn't have to move them afterwards!  Plus it would be *pretty*  :)
« Last Edit: December 31, 1969, 19:00:00 by 1039064400 »

Offline Mike Bobbitt

  • album.pl Author
  • Administrator
  • I Spend Too Much Time Here
  • *****
  • Posts: 3381
  • Karma: +35/-2
    • Mike's Development Archive
Re: creating folders with names instead of numbers
« Reply #1 on: November 21, 2002, 16:38:39 »
Move them? The admins shouldn't have to move them... The reason I used number is that a UBB member can change their name repeatedly, but their number always stays the same. So this way when smith becomes jsmith, his photos follow him...

Sounds like you might be having some problems though...
« Last Edit: December 31, 1969, 19:00:00 by 1039064400 »

Offline trout7

  • album.pl Donor
  • album.pl User
  • *
  • Posts: 14
  • Karma: +0/-0
    • ngto.org
Re: creating folders with names instead of numbers
« Reply #2 on: November 21, 2002, 18:06:40 »
Sounds logical...  theoretically if I wanted to do this could you point me to a code block?  I am a pretty good Perl progammer so I bet I could figure it out....
« Last Edit: December 31, 1969, 19:00:00 by 1039064400 »

Offline trout7

  • album.pl Donor
  • album.pl User
  • *
  • Posts: 14
  • Karma: +0/-0
    • ngto.org
Re: creating folders with names instead of numbers
« Reply #3 on: November 21, 2002, 18:33:50 »
In case anyone is interested... here is the change to make this work (as Mike said, you will lose portability since ubb member numbers are more reliable), but you might want to do it this way....

In this block:

# UBB categories are user numbers, all others are user names
           if ($authentication_type eq 2)
           {
                 
                 $category=$usernumber;
                                                     
           }


just change:

$category=$usernumber;


to:

$category=$username;
« Last Edit: December 31, 1969, 19:00:00 by 1039064400 »

Offline Mike Bobbitt

  • album.pl Author
  • Administrator
  • I Spend Too Much Time Here
  • *****
  • Posts: 3381
  • Karma: +35/-2
    • Mike's Development Archive
Re: creating folders with names instead of numbers
« Reply #4 on: November 21, 2002, 19:20:52 »
Yep, that'll do it... :)

How come you move the photos around? Are they not uploaded in the right spot to begin with?
« Last Edit: December 31, 1969, 19:00:00 by 1039064400 »

Offline trout7

  • album.pl Donor
  • album.pl User
  • *
  • Posts: 14
  • Karma: +0/-0
    • ngto.org
Re: creating folders with names instead of numbers
« Reply #5 on: November 23, 2002, 17:42:38 »
My case is probably not too common... the only reason I would be moving them around is because I am migrating from a static photo page with about 30 different member photo areas (which are by ubb name).  So to keep that same theme I wanted it to create the new directories by name as new members uploaded their photos... and my hope was that the existing members directories would be used for new uploads from those members (since they would already be there)... haven't tested that theory yet...

BTW - did I tell you how much this script rocks!
« Last Edit: December 31, 1969, 19:00:00 by 1039064400 »

Offline Mike Bobbitt

  • album.pl Author
  • Administrator
  • I Spend Too Much Time Here
  • *****
  • Posts: 3381
  • Karma: +35/-2
    • Mike's Development Archive
Re: creating folders with names instead of numbers
« Reply #6 on: November 23, 2002, 17:55:41 »
Ahhh, I get it. Makes sense, and your theory should work out... (about re-using the existing directories for uploads)

And hey, thanks!
« Last Edit: December 31, 1969, 19:00:00 by 1039064400 »