I am crazy. I think I've done most of the hacking I intend to do to the Gallery package; I'm getting into silly stuff now. Yesterday and today I rewrote the code that makes the links to first/previous/next/final thumbnail pages - the original behavior is simply four links, which feels really stupid when there happens on only be four pages in the main illustration gallery!
So I replaced it with some code that just generates a list of links to page X - 1, 2, 3, 4, 5, 6, etc, all link to their respective pages.
This got unwieldy when there are more than about ten pages. Then I discovered that, for some reason, the existing code would figure out a small range of pages around the current page - something like five pages back through five pages ahead. With logic so that it doesn't accidentally direct you to a page off either end of the gallery. Why it has this, I don't know; it's not used.
So after some more work, you get that small span of pages listed; before it you get page 1 (if not in that span) and two pages between 1 and the beginning; after that span you get similar behavior out to the final page.
Then I decided that the simple number links were bad: they're just too small a target. And changing the links to "page x" would feel unaesthetic - too repetitive.
So I coded up a PHP routine just now to convert a number to a string - put in "27" and you get back "twenty-seven". Put in text and you get the text back unchanged; put in anything above 999 and you get the digits back 'cause I don't really anticipate having a thousand pages of thumbnails available any time soon.
I should probably finish it off by wiring up some switches in the settings for an individual section of the gallery to have the first/previous/next/last navigation or the number-list navigation; right now I can only change it for the whole system, by going into the source code, commenting the new method out, and uncommenting the old.
Keep in mind that before touching this thing my knowledge of PHP was absolutely zero. I wasn't even clear on exactly what PHP was. I'm really just going on the fact that nearly every computer language is the same, in both underlying concepts and the grammar you use.
I'm such a geek sometimes...
So I replaced it with some code that just generates a list of links to page X - 1, 2, 3, 4, 5, 6, etc, all link to their respective pages.
This got unwieldy when there are more than about ten pages. Then I discovered that, for some reason, the existing code would figure out a small range of pages around the current page - something like five pages back through five pages ahead. With logic so that it doesn't accidentally direct you to a page off either end of the gallery. Why it has this, I don't know; it's not used.
So after some more work, you get that small span of pages listed; before it you get page 1 (if not in that span) and two pages between 1 and the beginning; after that span you get similar behavior out to the final page.
Then I decided that the simple number links were bad: they're just too small a target. And changing the links to "page x" would feel unaesthetic - too repetitive.
So I coded up a PHP routine just now to convert a number to a string - put in "27" and you get back "twenty-seven". Put in text and you get the text back unchanged; put in anything above 999 and you get the digits back 'cause I don't really anticipate having a thousand pages of thumbnails available any time soon.
I should probably finish it off by wiring up some switches in the settings for an individual section of the gallery to have the first/previous/next/last navigation or the number-list navigation; right now I can only change it for the whole system, by going into the source code, commenting the new method out, and uncommenting the old.
Keep in mind that before touching this thing my knowledge of PHP was absolutely zero. I wasn't even clear on exactly what PHP was. I'm really just going on the fact that nearly every computer language is the same, in both underlying concepts and the grammar you use.
I'm such a geek sometimes...
no subject
Date: 2004-09-02 12:27 pm (UTC)no subject
Date: 2004-09-02 07:22 pm (UTC)Which is why I ended up hacking away...
I now have it working as the root of a virtual egypt.urnash.com that only exists for my machine. Integrate it into the rest of the website I have designed, cut down some animation work for it, and it's ready to go live as soon as I go buy urnash.com...
no subject
Date: 2004-09-02 08:25 pm (UTC)So I coded up a PHP routine just now to convert a number to a string - put in "27" and you get back "twenty-seven".
Heh. Did that on FM, once. numtowords() converted, well, numbers to words. Precisely because it was unaesthetic, to have a few paragraphs of description interspersed with 5 or 6 numerics amongst the alphas. The impetus was, of course, size-changing descs - proportionate ones, at that. Once you can store a value on your self for a height, and make all other props dependant on that value (like {(store:{prop:height}/10},earlength,*me}), then all you needed to do was write a function to increment or decrement it, and your desc would change automagically, whilst remaining all written in prose.
Being written for sizeplay, of course, I always thought of it as the "Macro Macro"...
no subject
Date: 2004-09-02 08:36 pm (UTC)Because "a four hundred and fifty-two thousand, nine hundred and firty-four foot tall spider with LLLLLL-cup breasts" just sounds... absurd. Better than "...452954 foot tall..." but it's still unaesthetic.
no subject
Date: 2004-09-03 05:11 am (UTC)I did consider numtomeaningfulwords{} (with a switch for metric and imperial, of course). It'd be neat to shift seamlessly from feet to yards to furlongs. And of course, then there's area, and how many people really know what a hectare looks like, and weight, which wouldn't be proportionate but more obey an exponential increase based on height... but eventually, I realized I was spending more time contemplating coding and building, and less time.. er, well, mucking.
(Thinks about the image of spiders with car-crushing bewbs for a while o.O)
no subject
Date: 2004-09-03 10:17 am (UTC)Hmmm.
no subject
Date: 2004-09-03 10:21 am (UTC)