Fun javascript thingy

 Fun javascript thingy  General  Comments Off on Fun javascript thingy
Sep 292004
 

I just (well, a couple of hours ago) finished putting in this nifty javascript that makes for large “title” mouseovers. Try it out on the links over on the right, or any link in this post; I added title attributes to them.

I initially saw this on Kitta.net, on the colophon page. I though it looked really cool, so I took a gander at the javascript that does it. The comments indicated that I could swipe it for my own means, so I did just that.

I’m still not sure if I like the color, but that’s pretty easy to fix; it’s a stylesheet entry.

Update: If you’re using IE and just see a rectangular box, you should know it looks even cooler in Firefox (or probably any Mozilla-based browser); the Mozilla rendering engine supports radii on stylesheet elements, so the “tooltip” actually has 3 round corners that you just can’t see in IE.

WordPress Themes

 WordPress Themes  General, Technical, Wordpress  Comments Off on WordPress Themes
Sep 252004
 

WordPress 1.3 includes a “Presentation” section in the admin area; its use is to switch between themes that have been installed. But there’s currently little to no documentation about what themes actually are, and how they’re written, how they’re installed, and how they work.

I seem to have figured it all out. At least, I think I have. There’s still some robustness checking I should do, in case specific files in my theme aren’t present, but here are the steps I took to make what you see here into a wordpress theme.

  1. First and foremost, create the style.css for your theme. You will need to make specific additions to the top of the stylesheet page, specifically the following portion:

    /*
    Name:
    URI:
    Description:
    Author:
    Author URI:
    Template:
    Version:
    */
    Fill all of those fields out. For “Template”, put the name of the directory you’ll be installing your theme in. In my case, “Template” is “devlogic-condition”. This will enable wp-blog-header.php and other files to actually locate your theme files and use your custom index, header, footer, and sidebar files.
  2. Now, make a directory to hold the actual pages you use to display your site. This includes index.php, wp-comments*.php, wp-header.php, wp-footer.php, and wp-sidebar.php (if you’re basing your theme off of the new “modular” page layout). Copy all of the files you modified (or plan on modifying) to a new directory, and then make a few small changes. In your theme’s index.php file, you should ignore the warning at the top and delete the line “require(‘./wp-blog-header.php’);”. It’s already called by the master index.php file in the webroot, and I’m pretty sure that calling it a second time does nothing more than increase the page load time.
    Then, modify all of the php files you just copied, thusly:
    find all of the lines that use the include() function, and modify the arguments. Change
    include(ABSPATH . '/filename.php');
    to
    include(ABSPATH . "wp-content/${wp_template}filename.php");
    This makes the modular system load your custom header, footer, and sidebar files. It took me a while to figure that out, let me tell you.
  3. copy and/or move the directory everything’s in into your wp-content/themes/ directory, and make sure the dir’s name is the same as the value you entered for “template” in step 1.
  4. Oh, yeah. Once everything’s in place, go to the “Presentation” menu in wp-admin, and enable your theme. If everything worked correctly, you should be able to view your site with your theme instead of whatever was there before. The most dramatic way to see this actually work is to put your theme file into a fresh installation of wordpress 1.3cvs (or release, when it comes out); you will see everything with the nice “default” theme (or “Kubrick”, if it’s there), before enabling your own hard work (or your hacking of someone else’s hard work, whatever).

Yay! Fixed WordPress Paging!

 Yay! Fixed WordPress Paging!  General, Technical, Wordpress  Comments Off on Yay! Fixed WordPress Paging!
Sep 182004
 

Those nifty “next page” and “previous page” links at the bottom of the page finally work! Here’s how I fixed it. Well, actually, here’s the changes I made that corrected the problem. How I fixed it involved digging through PHP files for about half an hour.

It seems that with the WordPress 1.3 nightlies (and, I assume, the CVS and alpha versions as well), the “blogfilename” option in the wp_options table isn’t populated. I issued this statement in mysql_client to fix it:

update wp_options set option_value=’index.php’ where option_id=2;

and lo and behold: after a refresh the pages actually work correctly! Note: in my wp_options table, option_id 2 was also option_name ‘blogfilename’. If you’re going to try this, please make sure that YOUR option_id 2 is also option_name ‘blogfilename’. That, or use this statement instead:

update wp_options set option_value=’index.php’ where option_name=’blogfilename’;

Of course, I thoroughly suggest you make a backup of your database before changing anything. If you mess up your blog by trying this without checking what your current values are, I can’t be held responsible.

I’m sure there’s an option in the wp-admin section to enter this value appropriately (and if not, I’m sure it’ll be added soon), but I couldn’t find it.

Linux update

 Linux update  General, Linux, Technical  Comments Off on Linux update
Sep 182004
 

I’d been wondering for the last few weeks what I was doing wrong, such that I was always presented with a “enter super-user password for maintenance, or ^D for normal boot”. Then when my system crashed this morning, and I had to drive home on a break to fix it, I noticed that there was that nice little word “single” on the boot= line in GRUB. Remove that, and presto! The system boots up without me needing to press ^D.

Now if I could only train myself to actually type “vmlinuz” instead of “vmlinux”. That gets me every time.

Incidentally, I recently switched from devfs to udev.. Good stuff. It actually deals with the buggy usb-storage kernel module correctly: Before I switched, when I unplugged my Archos Jukebox, and then plugged it back in, I’d have to manually change the mount command, since the jukebox’d keep being assigned a new SCSI ID. Udev deals with this correctly: “/dev/sda1” is the first SCSI disk connected to the system, regardless of its actual host/bus/target/lun. This is, in my opinion, very useful.

Plus, it makes it so that I can use an automount daemon again, instead of mounting the drive by hand. Since I’m really lazy, this is a good thing.

DVD player

 DVD player  General  Comments Off on DVD player
Sep 152004
 

I finally broke down and got a new DVD player; my old Panasonic one was starting to “No Play” most DVDs (including ones that I’d previously watched on it), and my newer RCA one was manufactured poorly, and the gears would start skipping when trying to access data near the end of discs.

So I went over to my local CompUSA and picked up a Philips DVP642/37. And man is it sweet. It’s better than the Apex I had way back when (which has since gone the way of the dinosaurs): It’s DivX certified, and can play just about anything I want. DVDs work perfectly, of course (I even found the region-free hack so I can play any DVD). VCDs and SVCDs work like a breeze. CDRs with mpeg files? No sweat. And of course it can play DivX movies that are burned onto CDRs as well. If I had a DVD burner, I suspect it’d also play DVDs full of DivX files (handy for my collection of Twin Peaks season 2 avi’s).

So all in all, I look at this as a worthwhile purchase. For 70 bucks, I get a device that’ll play just about anything I care to throw at it. Now I just need to find a reliable source of DivX movies that don’t suck (unlike Usenet; people in newsgroups frequently have no taste in movies).

Whew

 Whew  General  Comments Off on Whew
Sep 072004
 

I finally got all of the posts re-postified.
I didn’t take the time to put in categories for most of them, though. Even the newer ones that used to have categories. I may go back eventually and put in categories for everything, but that’s really a lot of effort. I think I’ll concentrate my efforts on getting the stupid archive section on the front page working correctly first; then I’ll see about the categories…

Fuck.

 Fuck.  General  Comments Off on Fuck.
Sep 072004
 

I guess this is just the god of computers slapping me around for not making a backup. I still have my entire post database, but I can’t access it via wordpress. This is upsetting, to say the least. I’m in the process of re-posting them all, but it’s gonna take a bit of time. Especially since I’m modifying the timestamps on each one back to their original values.

Memo to myself: make more frequent backups, dammit.