From our Far Too Proud
From our Far Too Proud of Minor Coding Victories Department: the “Recently seen” select menu in the upper right (what do you mean it’s not a select menu? enable JavaScript and reload) is actually a Blogger-powered blog. The highly-detailed template consists of <Blogger><$BlogItemBody$><br></Blogger>. The resulting file is read by a (currently grossly inefficient) PHP function that parses out the urls and link text, sticks them into a <select>, sticks that into a JavaScript document.write, and tacks the unaltered links on the end inside a <noscript> tag. The result? If you have JavaScript enabled, you see a select menu that to the naked eye looks hand coded (the source is another matter, since I didn’t bother with newlines). If you hate me, and have JavaScript disabled, or if you are a search engine bot, you see a list of links with a slightly too large heading. The real upside, for me? If I want to add a list of links, I only have to create a new blog (takes a couple of minutes tops, and then I can add links with BlogThis) or a text file of links, and then include it in a page with “echo makeselect(“New list label”, “newlistfilename.inc”);”. Oh, how I love PHP, the Weekend Programmer’s friend.
No comments yet.