Viral Blog Syndication

If you’re a blogger, BlogRush.com is a very cool new way to get word out about your blog!

What happens is you put a widget on your blog. And each time someone visits your blog, you get a credit for one of your posts to be displayed on the widget on someone else’s related site. That means you get your posts out to people who are on similar websites (and already interested in same topics).

This may very well be the first cooperative viral blog syndication system. This is a short video about how it works:

If you’ve got a blog, you should get on Blog Rush now!

How to wrap text around advertising block

I’ve been looking at my AuctionAds & Adsense advertisement placements on this blog, and wanted to see how I could improve the “blending”. I’ve seen a few sites where the blog entries wrap around the ad block, and wanted to do something similar. It turns out that the code is pretty simple!

In single.php (the file may be of a different name, depending on your theme… for example Redoable’s is single_post.php), find:

<?php the_content(); ?>

And add this above it:

<div style=”float:left;margin-right:10px”>
Your Adsense code goes here
</div>

Basically, you use a <div> block that “floats” (meaning that it allows text to wrap around it). You can change the float:left to float:right if you want it on the right side.

Making AuctionAds a little more Wordpress friendly

If you’re a Webmaster, and haven’t signed up for AuctionAds yet, you should. Basically it is an advertising network for the eBay affiliate program: The AuctionAds advertisement shows an item listed on eBay, if one of your viewers click on the ad and end up buying that item, you get a commission.

There is one problem with AuctionAds though. And that is, unlike Google Adsense’s ability to “read” the page and present contextual and relevant ads, AuctionAds has a “simple” parameter where you must enter keywords. So if you want AuctionAds to show Cell Phone listings on eBay, you need to enter “Cell Phone” into that field. While it allows the webmaster an ability to “focus” the ad, it’s rather tedious… you can’t enter one code, and expect that the ad will always be relevant. Maybe if your website was just about Cell Phones, that’d be cool. But if, for example, you’re using on a general blog where you post about a variety of topics, there’s no “simple” way to make the ad relevant.

To that end, I’ve written some simple code to work around that deficiency…

In single.php, find:

<?php the_content(); ?>

And add this above it:

<?php
$catname = ”;
foreach((get_the_category()) as $cat) {
$catname = $catname . $cat->cat_name . ‘,’;
}
$catname = rtrim($catname,’,');
?>
<script type=”text/javascript”><!–
auctionads_ad_kw = “<?php echo $catname; ?>”;
… your auctionads parameters …
–></script>
<script type=”text/javascript” src=”http://ads.auctionads.com/pagead/show_ads.js”>
<script>

What the code does is:

  • AuctionAds is to appear on each post: when you read the single blog post, you will call single.php (or whatever your theme calls it… Redoable calls it single_post.php).
  • Because I file all my blog posts in various Wordpress Categories, it’s relatively simple to identify the focus of each post.
  • Using PHP code, I extract the full category list for that specific post, and insert those words into the AuctionAds keyword field. Thus ensuring that AuctionAds presents auctions relevant to the topic of the blog post.

This is what I learnt today! Hopefully it’ll be of use to others :)

Wordpress memory errors

I just upgraded to the latest version of Wordpress (2.1.3).

Before the upgrade, I started to get strange errors (admin screens not painting correctly). And when I attempted the upgrade, I received this error:

Fatal error: Allowed memory size of 8388608 bytes exhausted (tried to allocate 71797 bytes) in /[path]/upgrade.php on line 155

I believe the memory leak is originating from Arne Brachhold’s Google Sitemaps plugin. To be fair, I was running 2.7.1 (a reasonably old version). Will upgrade and hope the problem goes away.

Hacking into Wordpress admin account

I setup Wordpress on a domain last week. For those that are familiar, when you first install Wordpress, it gives you a temporary password. Well, I logged in using that temporary password, made some configuration changes, and then logged out (without remember to set a new password!). Of course, I’d forgotten the temporary password… D’oh!

Usually, you can use Wordpress’s “Forgot Password” function, which will send an email to the address you defined for admin during setup. But in this case, this option wasn’t available to me - I might have mistyped the email address when I entered it :(

So I had to research how to hack in and reset the admin password. This is what needs to be done:

This process worked for my Wordpress 2.1.3 setup. Use at own risk!

  • Log into phpMyAdmin (the MySQL admin)
  • Select the database, and click on the SQL tab
  • Enter this:

    SELECT ID, user_login, user_pass FROM wp_users WHERE user_login = ‘admin’;

    where wp_users is the table (wp_users is the default name for Wordpress 2.1.3, but your version might be different, so check!

  • It should show you the table record for the admin account. If it doesn’t, stop here and figure out why that SQL command doesn’t work.
  • Enter this:

    UPDATE wp_users SET user_pass=MD5(’password‘) WHERE user_login =’admin’;

    where wp_users is the table (wp_users is the default name for Wordpress 2.1.3, but your version might be different, so check!
    where password is the new password you want to use

  • If phpMyAdmin returns a successful response, login using the new password!