Nullvariable

How to Fix Alex King’s Popularity Plugin

by Doug on June 2, 2008

So I really dig Alex King’s Popularity plugin but I’m disappointed that he’s not updated it for WP 2.5 yet. So since it took me forever to find the information on fixing it I’ll post it here. WARNING if you break it, its not my fault! :wink: Also FYI this is a temporary fix until the actual plugin is upgraded, this just gets things working, its not perfect.

Open popularity-contest.php and scroll down to line 59. Replace require(’../../wp-blog-header.php’); with require(’../wp-blog-header.php’);

If you get an error (most likely with a new installation) about a Table not existing, the following code should be run in phpmyadmin or any other SQL database access program (usually the wordpress table prefix is wp_ make sure you change this to reflect your local settings):

CREATE TABLE IF NOT EXISTS <wordpresstableprefixhere>ak_popularity (
post_id int(11) NOT NULL,
total int(11) NOT NULL,
feed_views int(11) NOT NULL,
home_views int(11) NOT NULL,
archive_views int(11) NOT NULL,
category_views int(11) NOT NULL,
single_views int(11) NOT NULL,
comments int(11) NOT NULL,
pingbacks int(11) NOT NULL,
trackbacks int(11) NOT NULL,
last_modified datetime,
KEY post_id (post_id)
) ENGINE=MyISAM;

CREATE TABLE IF NOT EXISTS <wordpresstableprefixhere>ak_popularity_options (
option_name varchar(50) NOT NULL,
option_value varchar(50) NOT NULL
) ENGINE=MyISAM;

Alex’s post regarding his plugins Wp 2.5 issues.

Be Sociable, Share!
  • http://www.DirectSalesWebMarketing.com Dennis Edell

    I’ll definitely save this for IF/when I ever upgrade…I’m quite satisfied right now with all my nice and tidy 2.3.3′s.

    For all others reading this, if you click the link to read Alex’s post…you will also want to read the comments below.

Previous post:

Next post: