Dazu müsst ich es wieder aktivieren. Aber laut Fehlermeldung passt das } in Zeile 31 nicht.
PHP
<?php
/*
Plugin Name: Moderation Comments Count
Plugin URI: http://www.adityanaik.com/blog/plugins/comment-count-for-moderation/
Description: Allows you to access the number of comments in the moderation so that you can display the number on your blog just like 'Site Admin', 'Login', 'Register' and 'Logout' links.
Version: 1.0
License: GPL
Author: Aditya Naik
Author URI: http://www.adityanaik.com/blog/
Version History
0.1: Initial Release
1.0: Final Release
*/
function get_comment_moderation_count() {
global $user_ID, $wpdb;
get_currentuserinfo();
$numcomments = 0;
if ('' != $user_ID) {
$numcomments = $wpdb->get_var("SELECT COUNT(*) FROM $wpdb->comments WHERE comment_approved = '0'");
}
return $numcomments;
}
// for previous version support
function display_comments_awaiting_moderation($before = '', $after = '', $text = 'Comments in moderation (%s)') {
the_comment_moderation_count($before, $after, $text)
}
function the_comment_moderation_count($before = '', $after = '', $text = 'Comments in moderation (%s)') {
$numcomments = get_comment_moderation_count();
if ($numcomments){
echo $before;
?><a href="<?php echo get_settings('siteurl') ?>/wp-admin/moderation.php"><?php
echo sprintf($text, number_format($numcomments) );
?></a> <?php
echo $after;
}
}
?>
Alles anzeigen