Aryeh Gregor wrote:
On Fri, Jul 23, 2010 at 8:00 AM, Platonides
<Platonides(a)gmail.com> wrote:
You would need to reparse on edit (which changes
categories) all pages
including the image. Even if the image comes from commons or another
ForeignRepo.
Not as easy, I think, but this is a long wanted proposal, see bug 8298/9616.
Ouch. You're right, I hadn't thought of that. The categories for
each image can't be stored in the parsed text, that will mean updates
don't propagate until the next reparse.
Okay, so how about this instead: when generating the page, the server
retrieves all categories for all images on the page, then checks
against site and user preferences to see if any need to be censored,
and if so, stick a list into the <head>. That should work fine --
Even if you remove censoring ability from anonymous users, you still
need to purge from squid cache all pages that include the images when
category changes.
it should be okay to retrieve the categories (local
and foreign) for each
image on the page on every page load, right?
There are some large galleries.
For instance contains 746 files each with 4-5 categories. That's nearly
3000 categories being retrieved.
However, the image
loading would have to be revised somehow, to not delay the loading of
uncensored images . . . as usual, IE is the problem here. Aside from
older IE versions, we could use attribute selectors,
img[src=http://......], assuming we can get the src easily on the
server side for each image.
Getting the urls for each image should be no problem for us. Note that
we can ban from src beginning with the thumb folder, we don't need the
actual thumb url.
I find going that way over-verbose, though.