Gravatar. Change your options here. As of version 2.2 there is also a widget for Recent Comments with Gravatars. Version: 2.5 Author: Rune Gulbrandsøy Author URI: http://bloggs.be/wpmu/gravatar/ */ /* Copyright 2007 Rune (http://bloggs.be/rune/) This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* The idea for the Favicon parts come from the plugin favatars by Jeff Minard (http://thecodepro.com/). I have used some of his codem and rewritten some of the parts i have used. Thanks to Petter (http://neppe.no) for the tips about a nofollow option! */ function gravatar_admin_menu(){ add_submenu_page('themes.php', 'Gravatar', 'Gravatar', 8, 'gravatar', 'gravatar_admin'); } function show_gravatar($s) { $gravatar = get_option('bruk_gravatar'); $gravatar_align = get_option('bruk_gravatar_align'); $default = get_option('default_gravatar'); $gravatar_use_url = get_option('bruk_gravatar_url'); $gravatar_use_url_follow = get_option('bruk_gravatar_url_follow'); $home_url = get_option('bruk_gravatar_home_url'); $use_favico = get_option('bruk_gravatar_favico'); $use_mbl = get_option('bruk_mbl_ikon'); if($gravatar == true){ global $comment; $comment_tekst = $comment->get_comment_text; if ( !empty( $comment->comment_author_email ) ) { $lowercase = strtolower($comment->comment_author_email); $md5 = md5( $lowercase ); //$default == $default_gravatar; $comment_name = $comment->comment_author; if ( $comment->comment_author_url == 'http://' || $comment->comment_author_url == '') { $comment_link = get_option('home'); }else{ $comment_link = $comment->comment_author_url; if ($use_favico == true){ $favicon_url = getFavicon($comment_link); $default = $favicon_url; if ($default == '') $default = get_option('default_gravatar'); } } if ($use_mbl == true && $default == get_option('default_gravatar')){ $default = "http://pub.mybloglog.com/coiserv.php?href=mailto:" . $lowercase . "&n=". $lowercase; } //edit the style to what you want, the standard style looks good on most themes. if($gravatar_use_url_follow == true){ $follow_links = "rel='external nofollow'"; } else { $follow_links = "rel='external'"; } if($gravatar_align == true){ if($home_url == true && $comment_link != get_option('home')){ $s = "$comment_name"; } else { if ($gravatar_use_url == true){ $s = "$comment_name"; }else{ $s = "$comment_name"; }} }else{ if($home_url == true && $comment_link != get_option('home')){ $s = "$comment_name"; } else { if ($gravatar_use_url == true){ $s = "$comment_name"; }else{ $s = "$comment_name"; }} }} return $s; } return $s; } function show_gravatar_post($s) { $gravatar = get_option('bruk_gravatar'); $gravatar_align = get_option('bruk_gravatar_align'); $default = get_option('default_gravatar'); $post_gravatar = get_option('bruk_gravatar_post'); //$s = "Dette skal ikke komme"; if($post_gravatar == true){ global $post; $epost = get_the_author_email(); $lowercase = strtolower($epost); $md5 = md5($lowercase); $content=$s; $s= ""; $s=$s."$content"; } return $s; } function gravatar_admin(){ global $userdata; get_currentuserinfo(); $current_user = $userdata->ID; $default_gravatar = get_option('default_gravatar'); if ($default_gravatar != '') { $default_gravatar_temp = $default_gravatar; }else{ $default_gravatar_temp = "http://use.perl.org/images/pix.gif"; } $gravatar = get_option('bruk_gravatar'); $gravatar_align = get_option('bruk_gravatar_align'); $gravatar_profil = get_option('bruk_gravatar_profil'); $gravatar_url = get_option('bruk_gravatar_url'); $gravatar_url_follow = get_option('bruk_gravatar_url_follow'); $gravatar_home_url = get_option('bruk_gravatar_home_url'); $gravatar_favico = get_option('bruk_gravatar_favico'); $gravatar_uid = get_option('bruk_gravatar_uid'); $gravatar_post = get_option('bruk_gravatar_post'); $use_mbl = get_option('bruk_mbl_ikon'); if ($gravatar_uid != ' '){ $temp_uid = $gravatar_uid; }else{ $temp_uid = '1'; } $version = "2.5"; if ($_POST['updatinggravatar']) { $temp_grav = $_POST['defaultgravataroption']; if ($_POST['bruke_gravatar']) { $gravatar = true; } else { $gravatar = false; } if ($_POST['bruke_gravatar_align']){ $gravatar_align = true; } else { $gravatar_align = false; } if ($_POST['bruke_gravatar_profil']){ $gravatar_profil = true; } else { $gravatar_profil = false; } if ($_POST['bruk_gravatar_post']){ $gravatar_post = true; } else { $gravatar_post = false; } if ($_POST['bruk_gravatar_url']){ $gravatar_url = true; } else { $gravatar_url = false; } if ($_POST['bruk_gravatar_url_follow']){ $gravatar_url_follow = true; } else { $gravatar_url_follow = false; } if ($_POST['bruk_gravatar_home_url']){ $gravatar_home_url = true; } else { $gravatar_home_url = false; } if ($_POST['bruk_gravatar_favico']){ $gravatar_favico = true; } else { $gravatar_favico = false; } if ($_POST['bruk_mbl_ikon']){ $use_mbl = true; } else { $use_mbl = false; } if ($_POST['default_gravatar']){ $default_gravatar = $_POST['default_gravatar']; } if ($_POST['bruk_gravatar_uid']){ $gravatar_uid = $_POST['bruk_gravatar_uid']; } update_option('bruk_gravatar', $gravatar); update_option('bruk_gravatar_align', $gravatar_align); update_option('bruk_gravatar_profil', $gravatar_profil); update_option('bruk_gravatar_post', $gravatar_post); update_option('bruk_gravatar_url', $gravatar_url); update_option('bruk_gravatar_url_follow', $gravatar_url_follow); update_option('bruk_gravatar_home_url', $gravatar_home_url); update_option('bruk_gravatar_favico', $gravatar_favico); update_option('default_gravatar', $default_gravatar); update_option('bruk_gravatar_uid', $gravatar_uid); update_option('bruk_mbl_ikon', $use_mbl); echo '

Your choices has been updated

'; } ?>


Gravatar site.')?>

© Rune G You are using version :' . $version . ' of WP-Gravatar')?>

10, 'username' => 'wordpress'); $options = (array) get_option('widget_authdescription'); $bordercolor = $options['bordercolor']; foreach ( $defaults as $key => $value ) if ( !isset($options[$key]) ) $options[$key] = $defaults[$key]; ?>

description != '') { echo $userdata->description; } } function filechecking() { global $wp_query, $blogownerid; global $wpdb, $blog_id; $default = get_option('default_gravatar'); $gravatar_uid = get_option('bruk_gravatar_uid'); if ($gravatar_uid != ' '){ $temp_uid = $gravatar_uid; }else{ $temp_uid = '1'; } $blogownerid = $temp_uid; $epost = $wpdb->get_var("SELECT user_email FROM $wpdb->users WHERE ID=".$blogownerid.""); $lowercase = strtolower($epost); $md5 = md5($lowercase); $gravatar_profil = get_option('bruk_gravatar_profil'); if($gravatar_profil == true){ echo $before_widget . $before_title . $title . $after_title . "\n
"; } //remove_filter('comment_text',''); add_action('admin_menu', 'gravatar_admin_menu'); add_filter('get_comment_author_link', 'show_gravatar'); add_filter('the_content', 'show_gravatar_post',1); add_action('plugins_loaded', 'widget_authdescription_init'); add_action('plugins_loaded', 'widget_recent_comments_gravatars_register', 1); ?>