Author URI: http://ipublicis.com/
Donate link: http://smsh.me/7kit
License: GNU GPL v3 or later
Copyright (C) 2009 iPublicis!COM
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 3 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, see .
*/
global $wp_version;
$exit_msg = 'Author Box plugin requires WordPress 2.7 or higher. Please upgrade!';
if (version_compare($wp_version, "2.7", "<")) {
exit($exit_msg);
}
/**
* For backwards compatibility, esc_attr was added in 2.8
*/
if (! function_exists('esc_attr')) {
function esc_attr( $text ) {
return attribute_escape( $text );
}
}
function authorbox_init_locale(){
//load translation file if any for the current language
$plugin_dir = basename(dirname(__FILE__));
load_plugin_textdomain( 'author-box-2', 'wp-content/plugins/' . $plugin_dir . '/i18n', $plugin_dir . '/i18n' );
}
add_filter('init', 'authorbox_init_locale');
function add_extra_contactmethod( $contactmethods ) {
// Twitter
$contactmethods['twitter'] = 'Twitter';
// Identi.ca
$contactmethods['identica'] = 'Identi.ca';
// Facebook
$contactmethods['facebook'] = 'Facebook';
// Netlog
$contactmethods['netlog'] = 'Netlog';
// remove Yahoo IM
unset($contactmethods['yim']);
// remove AIM
unset($contactmethods['aim']);
return $contactmethods;
}
add_filter('user_contactmethods','add_extra_contactmethod',10,1);
function authorbox_css() {
// This makes sure that the posinioning is also good for right-to-left languages
if( get_bloginfo( 'text_direction' ) == 'rtl' ) $rtltr = "rtl"; else $rtltr = "ltr";
$authorboxcss = WP_CONTENT_URL.'/plugins/'.plugin_basename(dirname(__FILE__)).'/authorbox-'.$rtltr.'.css';
echo '';
}
add_action('wp_head', 'authorbox_css');
function authorbox_display( $content='' ) {
if( is_single() ) {
$author = get_the_author();
$content .= '
' .'- ' . __("More at ", "author-box-2") . '
'
. $socialcontent
.'
' .'