Recent comments

January 6th, 2009

To prevent comments from protected pages from appearing in “Recent comments” widget, open up “/wp-includes/widgets.php” and replace the function “wp_widget_recent_comments” with this code:

function wp_widget_recent_comments($args) {
global $wpdb, $comments, $comment, $current_user;
extract($args, EXTR_SKIP);
$options = get_option(’widget_recent_comments’);
$title = empty($options['title']) ? __(’Recent Comments’) : apply_filters(’widget_title’, $options['title']);
if ( !$number = (int) $options['number'] )
$number = 5;
else if ( $number < 1 )
$number = 1;
else if ( $number > 15 )
$number = 15;

if ( !$comments = wp_cache_get( ‘recent_comments’, ‘widget’ ) ) {
$comments = $wpdb->get_results("SELECT * FROM $wpdb->comments WHERE comment_approved = ‘1′ AND comment_post_ID NOT IN (SELECT post_id FROM " . $wpdb->prefix . "named_users WHERE (user_id <> " . $current_user->ID . " OR group_id NOT IN (SELECT group_id FROM " . $wpdb->prefix . "named_users_groups_relations WHERE user_id = " . $current_user->ID . "))) ORDER BY comment_date_gmt DESC LIMIT $number");
wp_cache_add( ‘recent_comments’, $comments, ‘widget’ );
}
?>

<?php echo $before_widget; ?>
<?php echo $before_title . $title . $after_title; ?>
<ul id="recentcomments"><?php
if ( $comments ) : foreach ( (array) $comments as $comment) :
echo<li class="recentcomments">. sprintf(__(%1$s on %2$s), get_comment_author_link(),<a href="’. get_comment_link($comment->comment_ID) . ‘">. get_the_title($comment->comment_post_ID) .</a>) .</li>;
endforeach; endif;?></ul>
<?php echo $after_widget; ?>
<?php
}

Internationalization

January 2nd, 2009

I’ve made some changes to the plugin to support internationalization. The POT file is placed in the plugin directory. Let me know if you find any bugs!

I’ve included a danish translation. Please write a comment if you want to share your translation files (.po and .mo) and remember to write your email address in the “Mail” field, so that I can contact you.

Version 0.3.5

December 31st, 2008

I’ve released version 0.3.5. This version has the “wpNamedUsers permissions” working with the group functionality, so now everything should be working. Let me know if there are any bugs!

Group functionality

December 28th, 2008

With the release of version 0.3.2 the group functionality is implemented. If you find ANY bugs PLEASE report them to me in a comment!!

Remember to deactivate before upgrading as the database is upgraded when the plugin is activated!

I’ve made the group functionality so that it is possible to select users and groups who will have acces to posts/pages.  This means that you can go on the old way and give permissions to single users. You can also combine the two things and give permissions to a group and a couple of users.

“wpNamedUsers permissions” is not done yet, so it still behaves as if there were no groups.

Does it make sence?

WordPress 2.7 compatible

December 22nd, 2008

I’ve had some problems getting the plugin to work with WordPress 2.7, but version 0.2.6 of the plugin should be fully compatible. These problems have delayed the groups functionality, but I’m working on it.

Version 0.2 released

September 27th, 2008

I’ve released version 0.2 of the plugin. The functionality that was originally planned is now implemented. The next thing now, is to find a way to group users and to set permissions to these groups.

Management page

September 22nd, 2008

The management page is almost finished. I’ve implemented the “clear permissions” functionality, but the “set permissions” is still just a button.

I’ve started thinking about some kind of user management. I think it would be best, if it was possible to group users, so that it would be possible to set permissions to a group as well as individual users. Well, the “set permissions” has the highest priority at the moment, but I think that the grouping functionality would be nice to have.

First bug fixed

September 21st, 2008

I realized today, that if you had given permissions to a page or post to more than one user, none of the users would see the content. This bug has been fixed in version 0.1.4. This version also introduces the copy permissions feature.

More on the comments feed

September 20th, 2008

I’m not sure if users that are not logged in, are able to see the comments of hidden pages. Please visit http://wordpress.sundskard.dk/archives/41/feed and tell me if you see my comment to “Protected post” or not. It might just be the browser cache that is playing around with me. :)

SVN working

September 18th, 2008

The project is now hosted at wordpress.org. I’ve uploaded the first release for testing purposes only. The plugin is usable, but there are still features missing. Read the previous post to find out whats missing.