Archive for the ‘Wordpress’ Category.

Why I run my own blog: Livejournal outage

This is why: http://livejournal.com/

Temporarily Unavailable

LiveJournal is currently down due to a massive power failure at our data center. We’ll provide updates at /powerloss/ as they’re available.

Continue reading ‘Why I run my own blog: Livejournal outage’ »

Installed Page Navigation

I just installed the Page Navigation Plugin, page-navi.php from Lester Chan.

It lets me put a navigation bar on my site like this:
Pages (6) : Previous Page 1 [2] 3 4 Next Page ... Last »

It installed in about 5 minutes (and then of course I had to fiddle with it for 30 minutes…. but it installed very easily. And that’s very nice. :-)

I made a slight improvement in 1.2 that you might want to integrate into the source.

This starts at line 36. New code in red.

$numposts = $wpdb->num_rows;
$max_page = ceil($numposts / $posts_per_page) ;
 
// Return added by LCS 1-15-05. This causes nothing to be displayed if there is only 1 page
if ($max_page == 1) {
    return;
}

 
echo $before.'Pages ('.$max_page.') : <b>';
if ($whichpage >= 4)

Without this change, Page Navi is a little obtrusive when I put it in a prominent spot in Index.php and I’m displaying only 1 post… like when I’m viewing archives.


3-10-05 update. This plugin doesn’t work with WP 1.5 so I’ve switched to another plugin.

Installed Recent Comments and Related Posts

From here. Very useful. :-)

Installed TimeofDay

This is the cutest plugin. :-)

update 8-20-05 I’m not using this plugin with WP 1.5.

WYSIWYGII

I tried using WYSIWYGII and it has potential…. but it makes sucky looking HTML and doesn’t fix the escape-code issues with WordPress (where lots of code like slashes and quotes get left behind) So I’m not using it.

Created and Installed Words in Post Plugin

I’m proud to present my first WordPress plugin, Words in Post. All it does is count up the number of the words in a post and spit them out. By sticking this code in the index.php template of WordPress, I can create a title line that looks like this:

Geekery � 49 words � lee @ 2:50 am

This is better than using the following simple grab that I had heard about here.

<?php echo(str_word_count(get_the_content())); ?> words

The preceding doesn’t grab anything past the <!--more--> and counts tags incorrectly.

Thanks to Nick Momrik for the inspiration.

 

1-15-05 update: Version 1.1. Thanks to Alderete’s suggestion, the function returns a number instead of echoing. See the php for instructions.

Download Words in Post plugin version 1.1 here. Rename it from .phps to .php and run with it.

Installed Nicer Archives

I just installed “Sortable Nicer Archives for WordPress” from weblogtoolscollection.com. It is tres snazzy. Check it out here.

Installed WordPress Backup Scripts

Works like a charm. :-)

Author: LaughingLizard (dinki@mac.com)
http://weblogtoolscollection.com/
http://mindfulmusings.net/weblog/

Thanks LaughingLizard!

Alternating Colors for Posts Hack

This hack was originally made for WP version 1.2. It works with 1.5 though the line numbers mentioned are a little different.

This is a derivative of the Alternating Colors for Comments change

In Index.php, add what’s in red in line 34 like so:
<?php if ($posts) :$i=0; foreach ($posts as $post) : start_wp(); ?>

Replace line 40:
<div class="post">
with the following:
<?php if($i%2) {echo "<div class="post-even">";} else {echo "<div class="post">";} $i++ ?>
To finish it off, add a class in wp-layout.css like so:
.post-even { background-color: #EEEEEE;}

And gosh darn it, I can’t figure out how to do proper code quoting. The entries
above do NOT display correctly. The double quotes inside the echos need to be
escaped with a slash just before them. Sorry I can’t display them properly in
Wordpress!
 

Spam Karma stopped my first comment spam(s)

I knew it wouldn’t be long…. After the cut is an email from Spam Karma telling me about how it nixed 10 comment spams. I’m glad it succeeded but I’m still quite worried about this issue. I’ve found several comment spam stoppers, including the one I was most looking for, where only people with accounts on the system can post comments. We’ll see how this goes first though…

Continue reading ‘Spam Karma stopped my first comment spam(s)’ »