Creating a (Better) Fake Post with a WordPress Plugin

I was looking to create a fake page in a WordPress plugin I’m working on in my (all too limited) spare time. It may seem a little silly to try to create a fake page with a plugin but this could be useful for any plugin that will display information to the readers of the blog (outside the admin panel), like statistics, contact pages or about pages. Luckily there is a handy tutorial for creating a fake posts. But although the plugin cleverly tricks WordPress into displaying a post created dynamically by the plugin itself, WordPress is clever enough to know something is wrong and sends a 404 error before sending the plugin-created content. Although many browsers will still display the page, this is a problem for any text-based browser or if you want the page to be indexed by search engines and (for me at least) just kind of grates to know my magnificent new plugin isn’t actually performing correctly. Anyway, this happens because WP->handle_404() called by WP->main() in classes.php checks how many posts were found which, in this case, is 0 since there is no real post for the requested URL. To get around this problem, we need to make sure we trick WordPress before this function is called. Luckily we can catch WordPress immediately after it (unsuccessfully) looks for posts before any other function can figure out anything is wrong by using the the_posts filter.

Continue Reading »

Blogger
Programmer
Web

Comments (34)

Permalink

Toshiba Satellite A70 Power Problems (Again)

Laptop Repair Guy points out that Toshiba has issued a warranty extension resulting from a class action lawsuit. As far as I can tell (I’m not a lawyer so better check for yourself) I’m out of luck since I’m in Canada but definitely better to have Toshiba fix it for free than try yourself.

After I put up a post about repairing my laptop power connector, Laptop Freak left a informative comment:

As you see on the photo above, the positive connector oxidized and almost black. If you put a fresh solder on the connector like this, the power jack problem will reappear very soon. I usually remove the power jack from the system board (with iron gun and solder sucker), clean oxidized pins on the power jack and pads on the motherboard and only after that resolder the power jack.

It turns out, unsurprisingly, that he was right. The power jack started coming loose again after about a month and a half. I was in the middle of a bunch of things so I didn’t really feel like messing with it so I just opened up the computer and threw some more solder on it. When the power jack started jiggling again a few weeks later, I knew I had to do something better to fix it. So I picked up a desoldering sucker and some desoldering wick.

Continue Reading »

Electrical Engineer

Comments (50)

Permalink

Windows’ Hidden Font Improvement

I just found out about ClearType fonts thanks to Download Squad. I’m still debating whether I like them or not. They took me a few hours to get used to. Every time I looked away from my computer, I would come back and feel like my eyes were unfocused. But that blurry effect seems to have gone away and the fonts do look pretty and somehow thicker so I’m thinking I’ll stay with them. I guess they’re not all that hidden but funny how you can go years on a operating system and not know something so basic. Anyway, if you want to try on your computer go to the Display Control Panel. Click on the Appearance tab and click the Effects… button. Then select ClearType from the drop down under “Use the following method to smooth edges of screen fonts:”. You can also find out more about it and see examples at Microsoft’s ClearType Tuner.

Continue Reading »

Programmer

Comments (0)

Permalink

Using quotation marks effectively in Unix

This is pretty basic knowledge but I’ve helped a few people out recently that had been using Unix/Linux for a while and didn’t know and it sure helped me out when I figured it out. If you had asked me how many quotation marks were on a keyboard before I started doing Bash stuff I would have said two. But I, and it seems most non-programmers, often forget the little ` on the same key as the tilde ~ (to the left of the numbers on standard keyboards). So there are actually three types of quotation marks and each one means something different to Unix:

Continue Reading »

Bash/UNIX
Programmer

Comments (8)

Permalink

Toshiba Satellite A70 Power Problems

Laptop Repair Guy points out that Toshiba has issued a warranty extension resulting from a class action lawsuit. As far as I can tell (I’m not a lawyer so better check for yourself) I’m out of luck since I’m in Canada but definitely better to have Toshiba fix it for free than try yourself.

My Toshiba Satellite A70 started having power problems several weeks ago. Although the power cord was plugged in, the computer was not charging and was draining the battery. The little ‘plugged-in’ LED would come up but the battery status LED would still show power coming from the battery. I could jiggle the power cord and it would come back up so I ignored it and got used to jiggling. Unfortunately, the power got more and more touchy and I spent more and more time jiggling the stupid power cord. I first guessed it must be something with my power adaptor but (after cutting open the outer wrap of the cord), I finally put it together that the ‘plugged-in’ LED was coming on but not the battery charging light. This seemed pretty odd. So I finally went out and bought a multimeter. For $20 it was a really good investment and I wish I would have bought one several hours of jiggling frustration earlier. Anyway after the multimeter showed the cord was giving the appropriate 19V without any interruptions, I finally got the bright idea to google the problem and found out that this is a common problem for the A70. Although I have soldered maybe once in my life, the repair didn’t look all that difficult so I thought I’d give it a shot. I ran out and grabbed a crappy Radio Shack iron for $15 and a pack of resistors and circuit board to practice on for $10. You could skip the practice if you were already confident in soldering.

Continue Reading »

Electrical Engineer

Comments (55)

Permalink