Archive for August, 2005

31
Aug

Displaying (vs executing) PHP code on web pages

While working on an earlier post, I needed to find a way to display a PHP module on a web page without having it executed. I knew this was fairly simple and involved the .phps file extension, but I hadn’t done it before. A quick search of the PHP site pointed me to the highlight_file function. About halfway down the page there is a blurb about the MIME type that I needed. It turns out that my web hosting service already has this enabled, so all I needed to do was get a .phps extension on my file. I did it the easy way, with a softlink:

ln -s myfile.php myfile.phps

For those who don’t know Unix, this effectively creates another name for the same file, which is exactly what I want. This leaves the original .php alone, so that it can be run by the web server. But is also allows me to post the code on the web, using the .phps “file” which the web server will display instead of executing. The elegance of this solution is that if/when I modify the original code, I won’t have to make any changes to the displayable code because there is really only one file (with two distinct names).

31
Aug

Footer plugin requirements, notes

A few days ago, Joseph and I were talking about bolting statcounter onto our blogs. He’s the one that pointed out statcounter to me, and all he needed to do was add the statcounter script to his theme’s footer.php file. This would probably work for any single-theme site, but I’m still running multiple themes on my blog. I need to do one of the following if I want to use statcounter:

  1. Drop all but one theme. There are several good reasons for this, most important of which is maintenance. This would allow me to add the statcounter script to the remaining theme’s footer.php and I’d be done.
  2. Add statcounter to all my themes. This probably wouldn’t be too bad, except for maintenance–whenever a new version of one of my themes came out, I’d have to manually reapply my changes.
  3. Write a plugin to insert the statcounter script in the footer of every page. This would be the most work up front, but it would give me a good excuse to learn how to write plugins for WordPress.

I found some useful resources for plugin authoring. The WordPress codex has a section on writing plugins. Owen’s tutorial is a great introduction–just read it and start hacking! :) Carthik’s Plunge into Plugins article has lots of good advice, but isn’t a tutorial–check it out after/while you get started with Owen’s page. More good info is available on the Codex page Writing a Plugin.

I’ve started working on this plugin, and I’ve already been bitten by the “extra blank line” problem. (Admin interface was reporting “Cannot modify header information - headers already sent by…” error. Note to self–scroll to the bottom of each PHP file, and make sure the PHP close tag is right at the bottom of the file.) I have the code to insert arbitrary text into the footer, but I still need to add the Options menu which would allow J. Random User to edit the text to be inserted. (Right now, the text is hard-coded in the “plugin”, which I have installed and activated on this blog. Check the bottom left corner of any blog page for the statcounter.)

I don’t see any reason for this plugin to be statcounter-specific. It would be more useful to provide some sort of generic footer plugin which would allow HTML or javascript to be inserted in the footer. We’ll see how it goes. If I’m happy with it by the end of the night or later this week, I will go ahead and release it.

30
Aug

SK2 blocking multiple pingbacks?

Spam Karma 2 rocks! Have I said that already? Well, not in so few words…

But I just noticed something. I wrote a post last night with multiple references to my own blog–in this case, I refered to two other posts. The first reference correctly generated a pingback, but the second reference doesn’t seem to have been handled. SK2 didn’t log it as spam or a valid comment, and there is no pingback comment in the second post that I linked to. I’m going to disable SK2 for a minute while I post this article, to see if both pingbacks are done correctly, then I’ll contact dr Dave and let him know what I’ve found.

30
Aug

Blacklisting with Spam Karma 2 now

When I originally set up my blog, I installed Farook’s WPBlacklist plugin to help combat blog spam. Then, a few days ago I installed Spam Karma 2 in order to take care of issues that were possibly being caused/exacerbated by WP-Gatekeeper. Today while perusing the management interface for SK2, I discovered that it handles blacklisting as well. I chose to let SK2 handle blacklisting and disabled WPBlacklist because:

  1. I want to use SK2 as my primary spam filter, and
  2. SK2 doesn’t require manual BL updating, as WPBlacklist does.

SK2 can even update the RBL when spammed.

This is turning out to be a pretty spiffy plugin! I get grim satisfaction from looking over the “recent spam harvest” and seeing the blocked attempts.

29
Aug

More books for Modoc Hall OBCZ

siriradha is sending a box of books to the Modoc Hall/Java City OBCZ. Thanks, siriradha! These are being sent fourth class (media mail) from Colorado on Wednesday, 2005-08-31, so they might show up almost any time in September. (Media mail is handled whenever the post office feels like getting around to it, seem like.) As soon as they arrive, they will be journaled on the OBCZ bookshelf.

29
Aug

Eastern Empire

It was too hot to cook again on Friday night, so we went looking for a good Chinese restaurant in our new neighborhood. I think we may have found it–Eastern Empire on Howe near Fair Oaks Blvd. My wife and I ate lunch there a few days ago, and we thought the kids would like the food. It turns out that we were correct.

The sweet & sour pork, foil-wrapped chicken and pork chow mein were all big hits with the kids. My older daughter also liked the chicken with garlic sauce. My wife and I liked the lemon grass beef, but it’s not as good as that available at BoBo’s.

27
Aug

The Green Mile

'The Green Mile' cover image

I found The Green Mile on the bookshelf at work a few days ago, just finished reading it late last night. I’ve never considered myself a Stephan King fan before because I always perceived him as a horror writer, a genre which doesn’t interest me in the slightest. But after reading this book, I started thinking about some of his other stories that I’ve read–Rita Hayworth and the Shawshank Redemption (from Different Seasons), The Running Man (under the Richard Bachman psuedonym), and The Shining. Of these, only ‘The Shining’ really has much of a “horror” feel to it. I think I may have to pay a little more attention to this author, even if he is extremely popular–I hate following a fad, but in this case there may be a reason (other than marketing) for his wild popularity.

Books I’m going to look for by this author include The Dead Zone and The Stand, both of which are available from the Sacramento Public Library.

I’ve seen the movies based on all these books, except for ‘The Green Mile’. I read ‘Shawshank Redemption’ and ‘Running Man’ after seeing the movies, and liked both the movies and the books. I saw ‘The Shining’ after reading it, and was disappointed with the movie. This is almost always the case with me, regardless of author–as long as I haven’t read the books upon which they’re based, the movies stand well on their own, while the books add depth to the story once I get to read them. Because of this, I probably won’t see the movie rendition of ‘Green Mile’.

27
Aug

Spam Karma 2 installed

I read a post today on Nicholas’ blog which indicated that he was having trouble commenting on my site. I’ve had other commenting problems (1, 2) in the past which have been traced to my spam-blocker, WP-Gatekeeper. I haven’t spent any effort on the current problem, I’m just assuming that gatekeeper is at fault, so I disabled this plugin and installed Spam Karma 2 since Nicholas seems to be getting good results with it. I’m not sure what Joseph is using nowadays, but gatekeeper may be doing the trick for him–I found out a few days ago that he hand-rolled his crisp minimalist theme, and perhaps gatekeeper plays well with such a setup.

I’ll run with Spam Karma 2 for a while and see how it goes. I hate to think that people might have tried to post comments here, failed, and given up on this blog. I really have no idea how many people read the crap I post, but I know there are at least a few people out there with too much time on their hands. ;)

27
Aug

Email from Mike Comfort

When I published my review of “Free” by Mike Comfort, I sent him an email letting him know about it. Imagine my surprise when a published artist took the time to write back, almost immediately! I can certainly accept a very small delay in shipping the CD, especially considering such a personal response.

The best thing in the email was the news that Mike is planning to release a new CD next month. The release is scheduled for September 23, to coincide with a show at La Salles in Chico, Calif. There’s a bit of information on La Salles’ calendar app, but I can’t seem to link directly to the show, or even to September–you’ll have to browse the calendar, select “September” on the pull-down list, then click the show link for “Thirst” on September 23rd.

More good news is that Mike is working on getting his CD into stores. I’m happy to support an artist directly–the prices are cheaper because there aren’t any bloodsuckers middlepeople between me and the artist, (except the postal service), hence the artist gets more of the money. However, there are two major problems with direct sales:

  1. The artist has to spend time doing non-artistic things like producing the CD’s and filling orders. All the time spent on this comes at the expense of the art.
  2. Nobody can jet down to the record store and pick up the CD right now. For some people, this may be a deciding factor. Other people may not trust PayPal, or whatever online payment system is employed, and avoid ordering via the web.

I think having the CD in stores would help promote the artist. I won’t be happy with the increased price, but you can’t have it all.

26
Aug

Top-rated games on BoardGameGeek

I stopped by Viking Hobby today and got to chatting with Mark about the top-rated games on the ‘Geek. Until today, I only knew how to find the rank of a particular game, and there’s no Internet access in the store, so I told him that I would check out the ‘Geek after work and see if I could find such a list. It turned out to be pretty easy. To save other folks the trouble, I’ve included a link to the highest-rated games on BoardGameGeek. I’ve printed out the first page (the top 29 games) of this list, so that Mark and Jess can keep it at the store for reference.

I guess it’s sort of predictable that I own the first- and second-ranked games, and the third-ranked game is high on my wish-list.




August 2005
M T W T F S S
« Jul   Sep »
1234567
891011121314
15161718192021
22232425262728
293031  

Tags

abramoff accessibility acetylene activism aerial photo afrofunk aim4tree air america airport express alite alito amtrak andante andy anti failure any browser apache apple applescript arden arcade arden park ariana arnold ashland astronomy attic attika audio avid reader backup baen bart bathroom bbq bee beef begonia bgg bike bike hikers bike journal bikejournal biketalk bill oreilly bittorrent blacklist blog bloggercode blogroll blueberry boardgamegeek boardgames bonjour book bookcrossing boot failure bootcamp borderline chaos bugmenot bush business card cabinetry caira caitlin california candamir caroline carpet cat cateye cdrom celebration cellular phone century cheese chicken chico chimney chinese chipotle chocolate christmas chumby city bikes civilization cjd claire club club fed co op coconut coffee comfort food community computer concord congress conquest conservation consumer reports copyright costco crazybikerchick crepe crock pot cruftbox css csus curl currency custard cvntrak dagoba daniel goetz darwinports datarescue date format death delicious monster democracy now Democrat demolition dessert dickens diff disaster discrimination discworld dishwasher diskwarrior dixie belle dock doors downing street memo drm dryer drywall dump ed burke eff eggs eject election electric car electric truck electrical electricity elvgren email energy efficiency eric meyer esr etext euthanasia facebook family faq faux news feed feedreader fence finder firefox first4internet first amendment fishmeal flash flickr flooring foreign exchange foundation fox and goose framing freebsd freedback fyq garage garden geek geotag geourl gnutar go gonuls google google earth google maps gpl gracenote graywater greek green group concat gtd gunthers gutters gwbush gymnastics hacking halloween handspring hardwood harry potter headmeta high speed photograph high tech inv hoax hobbies hobby hodgins holiday holly home power magazine horcrux houseblogs how to html humor hvac ilovejackdaniels impeach inspection insulation intel internet ipod ipodder iq iraq isight itunes ivins iwantsandy java city javascript joint chiefs joseph jott journalized blue judges cup kctc khs kimkerry kitchen kyocera la salles la times labor landscape laundry law leatherbys legal lego leopard liberal library linkedin ljurban lodi logic logo lungren maaloufs mac macbook mailinator malware map marin markdown mason media media clip media reform meetup metric mexican microsoft mike comfort military milonic mindstorms mlk model railroading modoc hall monterey morning sedition motorcycle movie moving munchkin murray mushroom music mynetflix mysql naked lounge nerd score netflix network new urbanism new year nofollow nutella oatmeal obama obcz occidental occupation omni openssl oracle organic osx owp paint pair palm panasonic parallels party patch peak adventures peak oil pear pedestrian village perl petaluma php ping pingback pingomatic pingomation pingqueue pirate pl sql planet bike plasma playroom entertainment plugin plugin:preview theme plugin:text control plugin:ultimate tag warrior plumbing podcast podsite politics portupgrade potato powerbook printer programming project gutenberg pryde punk puzzle qiana quilt quilt shop quiz quote r5 records racism radio railroad recent comments recipe redalt remodel resaurant resolution restaurant restore review richmond rio americano robotics roger niello ron montana roof rootkit rss sacbee sacog sacramento sacramento spotlight magazine salad san francisco sandwich santa cruz scam scandal school days scplugin security session report shakespeare shuffle sigma siriradha sitemap snl snopes social social network software soma somafab sonicchicken sonicchicken blog sony spam spam karma spellcheck spinach spirit spoiler etiquette spring hill cheese sql sqlserver stairs standards statcounter stephen king stop loss stucco stunt subversion sudoku superbowl superhero supreme court sushi svn sysadmin tacoma tags plugin takara technology telephone television template terms and conditions textcontrol thai kitchen thanksgiving theater theme theme:borderline chaos theme:elvgren theme:elvgren wordpress google code theme:fluid blue theme:fullwidth theme:head theme:journalized theme:journalized blue theme:psycho theme:redoable theme:sharepoint like theme:simple green theme:spirit theme:steam theme:wuhan theme:yadda theme switcher thomas tigris euphrates tile tinfoil hat toc tofu tower theater training transit transit oriented development tribute u haul uneasy rhetoric university village van zant veterans day video vie viking hobby vote smart w3c wall warboss washer washington post weather web web developer web server wikipedia windows wishlist woodworking wordpress workplace wpblacklist wpgatekeeper wsj yaaarr yard