Changing the way users are cataloged in the ‘uploads’ directory.
In my File Manager, I can find all uploads in the directory wp-content/uploads/album. The users are identified by their id numbers. I was wondering if there was any way to change this, and catalog them by their actual usernames? It would make searching their uploads much simpler.
I’m not sure if this is a simple tweak, or even a possible one. If it’s going to be something quite complicated, I’ll find another way to work with it.
Any help would be greatly appreciated!
This would be problematic for several reasons:
1) Users can change their names
2) User names in I18n systems could contain characters that are illegal in the server’s file system
3) User names can be very long, which would eat up space in the server’s file allocation table
4) It would require an extra database look-up to map the user’s ID back to their username
To avoid these problems, we use the numeric user ID for the subdirectory name. We also use the numeric album id for the subdirectory name within it.
Why do you need to search your user’s uploads?
Ah, thanks. It does sound like it would cause more complication than is necessary, so I’ll just leave it as is.
Also, to answer your question, I needed to search their uploads because I had planned to create a monthly gallery on one of my pages, containing certain photos from different users. Since I have not yet found a function that will automatically do this with BP-Album, I had planned on doing it manually, downloading user photos and uploading them to the gallery. I just thought that searching through user IDs would be frustrating and time-consuming, but I can do it, if need be.
Actually, BP-Album+ already has this capability. Here’s how to use it:
Actually, I am using the Global Media Page on another page, and it is quite useful.
The gallery I am planning on making is going to contain ten or so photos that have received the most votes for that month (and I’m still trying to figure out how to incorporate a voting function). The photos will change every month.
0.1.9 already has voting and “sort-by-vote” capability.
Keep in mind though, making the voting process resistant to cheating is incredibly database-intensive, because the site has to store every voter’s IP address our User ID. If a site has hundreds of thousands of users and hundreds of thousands of media items, it means the database has to store *hundreds of billions* of data items.
Ah, I see. Thank you very much for the info!
I’m on sort of a deadline, so I’m trying to get a beta version up and running as soon as possible. As I can’t really wait until November for the 0.1.9 functionality, I’ve been working at doing some things manually, even though I know it’s going to be somewhat difficult.
@tnd , I’m not that falmiliar with album+, but it really shouldn’t be too difficult to do a database query for most popular images. If you can work out the voting part, you are almost done. (there are buddypress plugins for this that you can have a look at, you’ll just have to add the feature for albums) I don’t know what kind of beta you are working on, but I think dealing with vote-cheaters can be done later. Also, are you absolutely sure you need voting and featured content in the beta? As a rule of thumb, the minimum viable product is about 1/8 or less feature-rich compared to the beta stuff people usually build. Of course if you were hired by others to build the site, that’s different.
I’m still working on getting the voting system up and running on my site, managed to get the exif working okay on my own, but the voting and viewing count is tricky I reckon I’ll be out sourcing the work to a developer lol.
@vizslah: Yeah, I figured my next chore would be to research some voting plugins that’ll work with the album. And I’d like the test site to be as functional as possible, so that my test users and I can work out as many bugs as possible. This is my first experience building a website, so I’m not 100% sure what I’m doing, but I’d like to tackle some of the bigger problems early on.
@4colourprogress: Ah, I wish you luck with it!
@vizslah: Actually, did you have any specific voting plugins in mind? I seem to be having some trouble finding a compatible one…
@tnd , Maybe I was a bit confusing, sorry about that. I don’t think there are any voting plugins that are compatible with album+ out of the box. What I meant was that you could look at the way they work by reading the code, and you could try to implement the feature to album images by copy-pasting some code, with some modifications.
It usually takes a few nights to get it right, and of course it depends on your level of knowledge, but trust me, I knew (almost) nothing about php when summer started, and I managed to do quite a few tweaks like that on plugins. Actually, I have my own plugin now. And I’m far from a real coder. So don’t freak out, get your hands dirty!
About feature set, try to think about the beta test as an experiment. If you have too many variables (features), you won’t be able to tell why users didn’t like the site, and what you should change. (frankly, nobody ever gets it right for the first time. you will have to do some iterations) The more stuff you offer, the harder it will be to 1. interpret feedback, 2. keep up with bugs 3. decide how the next iteration should look like.
My advice is: add fancy features later, get the core right asap. The core is always smaller than you think.
A good place to start learning the less-technical sides of building a website is the Stanford entrepreneurship corner. For example:
another must-read thing is “Getting real” from 37signals:
@vizslah, Ah, I see. No problem, I just misread your post. I’ve had to take a sink-or-swim approach to php lately, but I was hesitant to go too far with any tweaking. I suppose that’s how people learn to do things, though, eh?
Thank you so much for the help and advice, and I will definitely check out those links!
- The topic ‘Changing the way users are cataloged in the ‘uploads’ directory.’ is closed to new replies.