Module Request (Will Pay): Browse gallery by alphabet

BrandonK

Joined: 2006-04-13
Posts: 13
Posted: Tue, 2008-06-03 01:02

I am in charge of loading up a gallery with over 3000 photos (with many more coming each month), and we would like to be able to browse by letter. Ideally, this would work like a Rolodex where you can click on a letter and jump to photos with titles starting with that letter. Here's an exmample: [img]http://gallery.menalto.com/files/gallery-nav.jpg[/img]

Couple easy requirements:
- Letters appear even if photos don't (eg. currently there are no photos for "X". I don't want the nav to go VWYZ). This should be easy, as the navigation can just be static this way.
- Photos should automatically be categorized. I don't want to have to re-upload all of these photos or go to a special page after uploading a new batch.

I know that this module does not already exist, so that's why I am willing to pay to have this created. If any developers feel they can do this (looking for this ASAP), please contact me or post your info and I will contact you. Be willing to quote me a flat rate and not a per-hour fee.

Note to mods: I'm not sure if there is is a better spot to post this, so I went with this forum (feature requests). If I'm in the wrong spot, I apologize.

-Brandon

AttachmentSize
gallery-nav.jpg7.99 KB
 
alecmyers

Joined: 2006-08-01
Posts: 4342
Posted: Tue, 2008-06-03 22:44

I've written (hacked) this for you.

Install it, then use it as follows:

Links of the form ...?g2_view=startswith.StartsWithAlbum&g2_chars=<xxx> will give you a dynamic display of items whose titles start with <xxx> characters.

There's also a url-rewrite entry, for if you're using that - then you can enable a shortforum url gallery-url.com/startswith/<xxx> for the same result.

When I have time I'll write you a block with a template that gives you a list of the a-z links. You'll have to sort out the funky diagonal buttons (and the hilighting of whichever one is selected) yourself.

Notes: there's a limit of the first 100 items. You can adjust that (upwards or downwards) in the code but are you sure you want pages and pages of results?

Remembering Little Bobby Tables, I also haven't checked for SQL injection vulnerabilities. I think Gallery escapes entries from url parameters, but I'll ask about and see.

If you feel the need to dig really deep into your wallet, I'll pm you my paypal details. If it's only a three figure sum you want to pay then please donate it to the Gallery Project funds. There's a button at the bottom of the page.

Any problems, get back to me in this thread. (I've done some basic testing, but who knows what you might throw up.)

Edit: attachment removed - replaced it with a newer version further down the thread.

 
alecmyers

Joined: 2006-08-01
Posts: 4342
Posted: Tue, 2008-06-03 12:29

Actually you might want to hold off doing too much work with this (try it, by all means though) - I'm extending it and changing the name of the module, so it will have two views, 'startsWith' and 'contains'. Pretty obvious what they do.

 
alecmyers

Joined: 2006-08-01
Posts: 4342
Posted: Tue, 2008-06-03 23:32

OK, we're making progress now...

Install this module. Go to your themes config page, and add the Initial Letters block wherever you want it to appear.

In the next couple of days I'll work out how to hilight whichever letter you're currently viewing (anyone know how to access the Gallery url params from Smarty?)

 
BrandonK

Joined: 2006-04-13
Posts: 13
Posted: Wed, 2008-06-04 01:45
alecmyers wrote:
Remembering Little Bobby Tables, I also haven't checked for SQL injection vulnerabilities. I think Gallery escapes entries from url parameters, but I'll ask about and see.

Haha, I'm going to have to dig around on that site; that's absolutely hilarious!

I'm swamped at the moment with other projects, but I will try and get a chance to install that later this week or at the latest, this weekend.

Thanks for helping out with this! I don't have the slightest idea how to write gallery modules.

 
BrandonK

Joined: 2006-04-13
Posts: 13
Posted: Sat, 2008-06-14 04:16

Hey Alec, I got the module installed (in a matter of seconds). I haven't been able to dig through the code yet (will probably do that after I post this), but I'm really impressed that you got this module up and running so quickly. You mentioned you were going to make improvements to this, so I was just seeing if you added anything. Out of the box, this does exactly what I wanted it to, so barring any security problems, I'll probably stick with this module.

Thanks again for helping me out with this.

Brandon

 
alecmyers

Joined: 2006-08-01
Posts: 4342
Posted: Sat, 2008-06-14 10:50

I found a bug yesterday that prevents browsing within the dynamic-album, I should have a fix uploaded on the repository in a day or so. I'm not planning any further improvements beyond that though, at the moment.

Glad it works for you.

 
BrandonK

Joined: 2006-04-13
Posts: 13
Posted: Sun, 2008-06-29 03:07

Glad to see it made it into the plugin repository. One quick question I had was how can I change the text you use in your module (eg. $this->_title = $gallery->i18n('Items that begin with');)? If I hard code what I want it to say in your .inc files, my changes get wiped with any updates.

 
alecmyers

Joined: 2006-08-01
Posts: 4342
Posted: Sun, 2008-06-29 08:04

If your gallery is in the default US English locale then you can't (otherwise you could write/compile/install your own language translation). You'll have to reapply any changes after updating the module. But I can't see that will happen very often.