finally have the city gallery working

After a couple of days of banging my head against the concrete I finally found a way to get the city galleries to work the way I want them to.

Earlier today I had put out a call for help on the drupal forum, but the answer that I got wasn't much use to me (the guy basically said that I should not want to have it this way but do it his way in case I ever wanted something else than what I was asking for... nice one, answer a question that the asker isn't asking for...). Anyway, he did take the time to answer, which is nice, and he also pointed me to another image module that I had not seen before, but that didn't solve my issues either. I played around for a bit with a modification to the comments system which may have worked (and would have made the images full 'nodes' in the database, which has advantages of it's own, such as very easy integration with the points module wrt to awarding points for posting images) but it seemed overkill for the simple thing I was trying to achieve and the module writer warned against using it in performance critical situations.

The node_images module provided almost all the right functionality, except that it requires the user to have edit permissions and users can modify the titles and weighing of the images owned by other users. So, now I've modified the module a bit to take care of that. That's not really the way to go, but I think that it makes life so much easier that it's worth the slight transgression of 'best practice', the changes were two single lines, nothing major.

While looking through the code I was struck by how totally naive the code is written, for instance, all the images uploaded through this module are stored in a single flat directory. So if you have a million images there will be a million entries in that directory.

I'll need to change that for sure or this is going to break in a bad way when it gets used for serious production.

So, it seems that this particular aspect of the autotagger site has been solved using drupal, that leaves several issues still to be worked out:

- a general purpose review queue and rollback system where we can have users that are higher up in the hierarchy check on the work done at lower levels to make sure that it passes muster, and to make sure we don't become the target of spammers.
- a way to post the points transactions and to only finally award them when we decide to keep a contribution.

Possibly these can be rolled into one using the userpoints transaction approval queue as the base, but it will need to be modified extensively. For instance right now upon review of a transaction the reviewer can modify the number of points awarded.

Overall things like this are pretty messy in drupal, the permissions structure and the various tables do not play nice with each other at all.

cck_field_perms for instance allows you to control almost all the permissions for fields in a record, but not for title or body, which is really annoying...

I think drupal could be made a whole lot more clean and compact if the permissions would be handled by nodeaccess and cck_field_perms exclusively, and if all the extra tables would be made into nodes as well. It would make the whole thing a lot more 'orthogonal', probably easier to maintain and easier to extend. That would require all forms to be cck forms, but I think that would be a good thing rather than to have to different data architectures.

But ok, it is what it is and I'll have to live with it or fork it, and forking drupal does not look like it would be a walk in the park, so for now I'll try to play nice and do it with the modules as they are and modify as little as I can get away with to achieve the desired functionality.