Discussions (1328)

You searched for REGEXP.

Patch for database errors with WP 2.0 Beta/RC and K2

view profile

centvues says:

When using K2 with WP 2.0 (RC or Beta), this problem appears. Michael has already stated he will fix it when WP 2.0 Final comes out.

Until then, here is a possible solution:

1. Open theloop.php and find the following code:

Published <?php /* If there is more than one author, show author's name */ $count_users = $wpdb->get_var("SELECT COUNT(*) FROM $wpdb->users WHERE user_level > 1"); if ($count_users > 1) { ?> by <?php the_author_posts_link(); } ?>
(It should be around lines 75 and 108)

2. Replace it with this code:
Published <?php /* If there is more than one author, show author's name */ $count_users=$wpdb->get_var("SELECT COUNT(*) FROM $wpdb->usermeta WHERE meta_value REGEXP 'contributor|author|editor|administrator'");if($count_users>1){ ?> by <?php the_author_posts_link();} ?>

The function of the old code should be maintained, while sending the error message to greener pastures.

For boring details and a more detailed procedure for new users, see here.
3:19AM, 29 November 2005 PDT (permalink)

Would you like to comment?

Sign up for a free account, or sign in (if you're already a member).