Categories
uncategorized

eureka!

how stupid of me! all this time, it was right under my nose! i have this file, see? and the purpose of it is to sniff out the user’s platform and send the appropriate CSS for certain variables that are called in the dynamic CSS files for the various templates. so, for instance (and this is what it’s almost exclusively used for), if you were on Browser X, in Operating System Y (heh… “OS X” is already taken… stupid Apple), and looking at the “moon surface” template, the background for the text and menu blocks would be maybe a GIF, or a PNG, or an alpha filter… well, the problem is that to do this, i have a loop, and lots of things going on inside that loop.

i thought that i would have a separate include file for each of the several variations that i’m shooting for, that would be injected by the template detector… but this would have to be handled by logic within logic, which works, but isn’t the prettiest thing in the world to try and debug.

but it just now came to me that what i need to do is just have several of these sniffer files… one for each template… and the template detector would then pick up the correct one and use that… one shot, no mess! bonus! this would also decrease the size of the loops, since each one currently has the various code for several templates all at once… $tcss1a through $tcss9d (granted, with some gaping holes in between, but you get the idea). but this new way would have only the relevant code for the current template, and that’s it. simple, clean, and best of all, efficient!

sometimes things are a whole lot less complicated than they seem.

now, to get back to staring at the screen and waiting for code to write itself….

By jae

jae lethe (he/she/they) is a blogger, musician, artist, poet, web developer/designer, armchair philosophizer, teller of tales, and gadabout. Also, something he calls a "behavioral artist." (Not sure.) She has plans. BIG plans.

Among the things that he has done for a laugh are minor fractures, cuts, scrapes, and various scabs. Though she's quick to point out that they're no imbecile, we're fairly certain that he thinks the word means some kind of medieval pharmacist.

This is her latest home on teh internets - where jae stores their swear words, when they're not hurling them at the sun in vain.