Archive for February, 2009
Wordpress Toolbar Plugin and Wordpress Prefixes: A Fix
First of all, that’s an awesome plugin that will allow your visitors to have a look at external links while retaining the ability to comment locally on your blog. Get it!
Unfortunately, if you have modified your Wordpress database prefix, for instance because you are using Wordpress MU or the Virtual Module, the toolbar will fail to display.
Here is my very modest fix that will make it work.
1. Open wordpress-toolbar/toolbar.php
2. Find, near the top of the file:
$resultset = $wpdb->get_results("SELECT * FROM wp_options where option_name in ('wordpress_toolbar_social','wordpress_toolbar_excludedomains','wordpress_toolbar_skin','wordpress_toolbar_custom')"); |
Replace with:
$resultset = $wpdb->get_results("SELECT * FROM {$wpdb->options} where option_name in ('wordpress_toolbar_social','wordpress_toolbar_excludedomains','wordpress_toolbar_skin','wordpress_toolbar_custom')"); |
3. That’s it!
If you enjoyed this post, make sure you subscribe to my RSS feed!
Fixing permissions after a Wordpress prefix change
Let’s say that you renamed your Wordpress tables.
There may be several reasons for this. For instance, you installed Virtual Multiblog to support more than one blog with the same setup.
And now, you are facing the dreaded “You do not have sufficient permissions to access this page”
What to do, what to do?
Turns out, after some research, I found out that there is a proper procedure for us lazy webmasters:
1. Download the force-upgrade script and run it. It’s a fairly old script but since it all it does is invoke Wordpress’ upgrade mechanism, it still works very well with 2.7. I know, it’s not an upgrade! But you can also run the script to right some wrongs…
2. Using your favourite SQL editor, edit the “usermedata” table. Let’s say that your old table prefix was ‘wp_’ and your new prefix is ‘wp_new_’ you would type this simple SQL command to make sure that your first user is still admin:
update wp_new_usermeta set meta_value='a:1:{s:13:"administrator";b:1;}' where meta_key='wp_new_capabilities' and user_id=1; |
You’re all set.
If you enjoyed this post, make sure you subscribe to my RSS feed!
Chris’ Weekly High-Protein Tweets
If you are drowning in Twitter updates or simply missed a few of my Tweets, here is a list of what I consider worth reading this week.
By that, I mean that less interesting, personal and topical tweets are not in this list. This list will be published every week, save the occasional attack of laziness.
If you enjoyed this post, make sure you subscribe to my RSS feed!







