Plugin Directory

Changeset 884341


Ignore:
Timestamp:
03/29/2014 07:49:27 PM (12 years ago)
Author:
JonBishop
Message:

Fixed conflict with WordPress SEO
Can change size and shape of Avatar image
Fixed broken color picker
Added link to Settings page from Plugins page

Location:
wp-about-author
Files:
24 added
5 edited

Legend:

Unmodified
Added
Removed
  • wp-about-author/trunk/readme.txt

    r510511 r884341  
    22Contributors: JonBishop
    33Donate link: http://www.jonbishop.com/donate/
    4 Tags: author, author bio, author box, post, widget, bio, twitter, facebook, about, about author
     4Tags: author, author bio, author box, post, widget, bio, twitter, facebook, about, about author, author biography, avatar, user box, wp about author, guest author, guest post
    55Requires at least: 3.0
    6 Tested up to: 3.3.1
    7 Stable tag: 1.3
     6Tested up to: 3.8.1
     7Stable tag: 1.4
    88
    99Easily display customizable author bios below your posts
     
    19191. Display settings allow you to control when to display author bios
    20201. Display text links or icons to a users social media profiles
     211. Change the size and shape of your avatar
    2122
    2223This plugin also expands your profile page by adding popular social media fields so it's easier for readers to follow your authors.
     
    104105== Changelog ==
    105106
    106 The current version is 1.3 (2012.2.23)
     107The current version is 1.4 (2014.3.29)
     108
     109= 1.4 (2014.3.29) =
     110* Fixed conflict with WordPress SEO
     111* Can change size and shape of Avatar image
     112* Fixed broken color picker
     113* Added link to Settings page from Plugins page
    107114
    108115= 1.3 (2012.2.23) =
  • wp-about-author/trunk/wp-about-author-admin.php

    r510511 r884341  
    1111        wp_enqueue_style('wp-admin');
    1212        wp_enqueue_style('farbtastic');
     13        wp_enqueue_style('wp-color-picker');
    1314    }
    1415}
     
    2425        wp_enqueue_script('custom-background');
    2526    }
     27}
     28
     29//=============================================
     30// Display plugin Settings Link on plugins page
     31//=============================================
     32function wp_about_author_plugin_settings_link($links) {
     33    $url = admin_url('options-general.php?page=wp-about-author/wp-about-author-admin.php');
     34    $settings_link = '<a href="'.$url.'">' . __('Settings') . '</a>';
     35    array_unshift( $links, $settings_link );
     36    return $links;
    2637}
    2738
     
    8495    $social_content = "";
    8596    $box_content = "";
     97    $avatar_content = "";
    8698
    8799    if (function_exists('wp_nonce_field')) {
     
    108120    $wrapped_content .= wp_about_author_postbox('wp-about-author-settings-general', 'Display Settings', $general_content);
    109121
     122    $avatar_content .= '<p><strong>' . __("Size") . '</strong><br />
     123                <input type="text" name="wp_author_avatar_size" value="' . $wp_about_author_settings['wp_author_avatar_size'] . '" /><br />
     124                <small>By default, the size of the image is 100x100.</small></p>';
     125    $avatar_content .= '<p><strong>' . __("Display as Circle") . '</strong><br />
     126                <input type="checkbox" name="wp_author_avatar_shape" ' . checked($wp_about_author_settings['wp_author_avatar_shape'], 'on', false) . ' />
     127                <small>Display circular images instead of square ones.</small></p>';
     128    $wrapped_content .= wp_about_author_postbox('wp-about-author-settings-avatar', 'Avatar Settings', $avatar_content);
     129
    110130    $social_content .= '<p><strong>' . __("Display Social Media Icons") . '</strong><br />
    111131                <input type="checkbox" name="wp_author_social_images" ' . checked($wp_about_author_settings['wp_author_social_images'], 'on', false) . ' />
     
    114134
    115135    $box_content .= '<p><strong>' . __("Box Background Color") . '</strong><br />
    116                 <input type="text" name="wp_author_alert_bg" id="background-color" value="' . $wp_about_author_settings['wp_author_alert_bg'] . '" />
    117                 <a class="hide-if-no-js" href="#" id="pickcolor">' . __('Select a Color') . '</a>
    118                 <div id="colorPickerDiv" style="z-index: 100; background:#eee; border:1px solid #ccc; position:absolute; display:none;"></div>
     136                <input type="text" name="wp_author_alert_bg" id="background-color" value="' . $wp_about_author_settings['wp_author_alert_bg'] . '" /><br />
    119137                <small>By default, the background color of the box is a yellowish tone.</small></p>';
    120138    $box_content .= '<p><strong>' . __("Box Border") . '</strong><br />
     
    138156        'wp_author_display_pages' => "",
    139157        'wp_author_display_feed' => "",
    140         'wp_author_social_images' => ""
     158        'wp_author_social_images' => "",
     159        'wp_author_avatar_size' => "100",
     160        'wp_author_avatar_shape' => ""
    141161    );
    142162    $wp_about_author_settings = get_option('wp_about_author_settings');
  • wp-about-author/trunk/wp-about-author.css

    r510511 r884341  
    3333    border: 1px solid #e7e7e7;
    3434    float: left;
    35     height: 100px;
    36     width: 100px;
    3735    margin: 0 -122px 0 0;
    3836    padding: 10px;
    3937}
    40 .wp-about-author-pic img{
    41     width: 100px;
    42         height: 100px;
    43         max-width: 100px;
     38.wp-about-author-pic.wp-about-author-circle,
     39.wp-about-author-pic.wp-about-author-circle img {
     40    border-radius: 50%;
    4441}
    4542.wp-about-author-text{
    46     float: left;
    4743    margin: 0 0 0 140px;
     44    display: inline-block;
    4845}
    4946.wp-about-author-text p {
  • wp-about-author/trunk/wp-about-author.php

    r510511 r884341  
    44Plugin URI: http://www.jonbishop.com/downloads/wordpress-plugins/wp-about-author/
    55Description: Easily display customizable author bios below your posts
    6 Version: 1.3
     6Version: 1.4
    77Author: Jon Bishop
    88Author URI: http://www.jonbishop.com
     
    1010*/
    1111
    12 define('WPAUTHORURL_URL', plugin_dir_url(__FILE__));
    13 define('WPAUTHORURL_PATH', plugin_dir_path(__FILE__));
     12if (!defined('WPAUTHORURL_URL')) {
     13    define('WPAUTHORURL_URL', plugin_dir_url(__FILE__));
     14}
     15if (!defined('WPAUTHORURL_PATH')) {
     16    define('WPAUTHORURL_PATH', plugin_dir_path(__FILE__));
     17}
     18if (!defined('WPAUTHORURL_BASENAME')) {
     19    define('WPAUTHORURL_BASENAME', plugin_basename(__FILE__));
     20}
    1421
    1522require_once(WPAUTHORURL_PATH."/wp-about-author-admin.php");
     
    2330   
    2431    $wp_about_author_content = "";
    25         $wp_about_author_links = "";
    26         $wp_about_author_social = "";
     32    $wp_about_author_links = "";
     33    $wp_about_author_social = "";
    2734    $wp_about_author_author_pic =  "";
    2835    $wp_about_author_author = array();
     
    3239    $wp_about_author_author['posts'] = (int)get_the_author_posts();
    3340    $wp_about_author_author['posts_url'] = get_author_posts_url(get_the_author_meta('ID'));
    34     $wp_about_author_author_pic = get_avatar(get_the_author_meta('email'), '100');
     41    $wp_about_author_author_pic = get_avatar(get_the_author_meta('email'), $wp_about_author_settings['wp_author_avatar_size']);
    3542       
    3643        // About Author Title
     
    6471            $wp_about_author_content .= "</p>";
    6572        }
    66        
     73
     74        // Avatar size and shape
     75        $wp_about_author_avatar_class = 'wp-about-author-pic';
     76        if($wp_about_author_settings['wp_author_avatar_shape'] === "on"){
     77            $wp_about_author_avatar_class .= ' wp-about-author-circle';
     78        }
     79        $wp_about_author_text_margin = ($wp_about_author_settings['wp_author_avatar_size'] + 40) . 'px';
     80
    6781        // Create output
    6882        $return_content = '';
    6983        // Allow filters to create new templates for output
    7084        if (!$for_feed){
    71             $return_content = apply_filters( 'wp_about_author_template','<div class="wp-about-author-containter-%%bordertype%%" style="background-color:%%borderbg%%;"><div class="wp-about-author-pic">%%authorpic%%</div><div class="wp-about-author-text">%%content%%</div></div>');
     85            $return_content = apply_filters( 'wp_about_author_template','<div class="wp-about-author-containter-%%bordertype%%" style="background-color:%%borderbg%%;"><div class="'.$wp_about_author_avatar_class.'">%%authorpic%%</div><div class="wp-about-author-text" style="margin-left:'.$wp_about_author_text_margin.'">%%content%%</div></div>');
    7286        } else {
    7387            $return_content = apply_filters( 'wp_about_author_feed_template','<p><div style="float:left; text-align:left;>%%authorpic%%</div>%%content%%</p>');
     
    129143function wp_about_author_get_socials() {
    130144        $socials = array();
    131         $socials['twitter'] = array('title'=>'Twitter', 'link'=>'http://www.twitter.com/%%username%%', 'icon'=> WPAUTHORURL_URL .'/images/twitter.png');
    132         $socials['facebook'] = array('title'=>'Facebook', 'link'=>'http://www.facebook.com/%%username%%', 'icon'=> WPAUTHORURL_URL .'/images/facebook.png');
    133         $socials['linkedin'] = array('title'=>'LinkedIn', 'link'=>'http://www.linkedin.com/in/%%username%%', 'icon'=> WPAUTHORURL_URL .'/images/linkedin.png');
    134         $socials['pinterest'] = array('title'=>'Pinterest', 'link'=>'http://www.pinterest.com/%%username%%', 'icon'=> WPAUTHORURL_URL .'/images/pinterest.png');
    135         $socials['googleplus'] = array('title'=>'Google Plus', 'link'=>'https://plus.google.com/%%username%%', 'icon'=> WPAUTHORURL_URL .'/images/googleplus.png');
    136         $socials['digg'] = array('title'=>'Digg', 'link'=>'http://www.digg.com/%%username%%', 'icon'=> WPAUTHORURL_URL .'/images/digg.png');
    137         $socials['flickr'] = array('title'=>'Flickr', 'link'=>'http://www.flickr.com/people/%%username%%', 'icon'=> WPAUTHORURL_URL .'/images/flickr.png');
    138         $socials['stumbleupon'] = array('title'=>'StumbleUpon', 'link'=>'http://www.stumbleupon.com/stumbler/%%username%%', 'icon'=> WPAUTHORURL_URL .'/images/stumbleupon.png');
    139         $socials['youtube'] = array('title'=>'YouTube', 'link'=>'http://www.youtube.com/user/%%username%%', 'icon'=> WPAUTHORURL_URL .'/images/youtube.png');
    140         $socials['yelp'] = array('title'=>'Yelp', 'link'=>'http://www.yelp.com/user_details?userid=%%username%%', 'icon'=> WPAUTHORURL_URL .'/images/yelp.png');
    141         $socials['reddit'] = array('title'=>'Reddit', 'link'=>'http://www.reddit.com/user/%%username%%', 'icon'=> WPAUTHORURL_URL .'/images/reddit.png');
    142         $socials['delicious'] = array('title'=>'Delicious', 'link'=>'http://www.delicious.com/%%username%%', 'icon'=> WPAUTHORURL_URL .'/images/delicious.png');
     145        $socials['twitter'] = array('title'=>'Twitter', 'link'=>'http://www.twitter.com/%%username%%', 'icon'=> WPAUTHORURL_URL .'images/twitter.png');
     146        $socials['facebook'] = array('title'=>'Facebook', 'link'=>'http://www.facebook.com/%%username%%', 'icon'=> WPAUTHORURL_URL .'images/facebook.png');
     147        $socials['linkedin'] = array('title'=>'LinkedIn', 'link'=>'http://www.linkedin.com/in/%%username%%', 'icon'=> WPAUTHORURL_URL .'images/linkedin.png');
     148        $socials['pinterest'] = array('title'=>'Pinterest', 'link'=>'http://www.pinterest.com/%%username%%', 'icon'=> WPAUTHORURL_URL .'images/pinterest.png');
     149        if(defined( 'WPSEO_VERSION')){
     150            $socials['googleplus'] = array('title'=>'Google Plus', 'link'=>'%%username%%', 'icon'=> WPAUTHORURL_URL .'images/googleplus.png');
     151        } else {
     152             $socials['googleplus'] = array('title'=>'Google Plus', 'link'=>'https://plus.google.com/%%username%%', 'icon'=> WPAUTHORURL_URL .'images/googleplus.png');
     153        }
     154        $socials['digg'] = array('title'=>'Digg', 'link'=>'http://www.digg.com/%%username%%', 'icon'=> WPAUTHORURL_URL .'images/digg.png');
     155        $socials['flickr'] = array('title'=>'Flickr', 'link'=>'http://www.flickr.com/people/%%username%%', 'icon'=> WPAUTHORURL_URL .'images/flickr.png');
     156        $socials['stumbleupon'] = array('title'=>'StumbleUpon', 'link'=>'http://www.stumbleupon.com/stumbler/%%username%%', 'icon'=> WPAUTHORURL_URL .'images/stumbleupon.png');
     157        $socials['youtube'] = array('title'=>'YouTube', 'link'=>'http://www.youtube.com/user/%%username%%', 'icon'=> WPAUTHORURL_URL .'images/youtube.png');
     158        $socials['yelp'] = array('title'=>'Yelp', 'link'=>'http://www.yelp.com/user_details?userid=%%username%%', 'icon'=> WPAUTHORURL_URL .'images/yelp.png');
     159        $socials['reddit'] = array('title'=>'Reddit', 'link'=>'http://www.reddit.com/user/%%username%%', 'icon'=> WPAUTHORURL_URL .'images/reddit.png');
     160        $socials['delicious'] = array('title'=>'Delicious', 'link'=>'http://www.delicious.com/%%username%%', 'icon'=> WPAUTHORURL_URL .'images/delicious.png');
    143161        return apply_filters( 'wp_about_author_get_socials', $socials );
    144162}
     
    171189        $tmp = array(
    172190                    "wp_author_installed"=>"on",
    173                     "wp_author_version"=>"14",
     191                    "wp_author_version"=>"15",
    174192                    "wp_author_alert_bg"=>"#FFEAA8",
    175193                    "wp_author_display_front"=>"on",
     
    178196                    "wp_author_display_posts"=>"on",
    179197                    "wp_author_display_pages"=>"on",
    180                                         "wp_author_display_feed"=>"",
     198                    "wp_author_display_feed"=>"",
    181199                    "wp_author_alert_border"=>"top",
    182                                         "wp_author_social_images"=>"on"
     200                    "wp_author_social_images"=>"on",
     201                    "wp_author_avatar_size"=>"100",
     202                    "wp_author_avatar_shape"=>""
    183203                    );
    184204        update_option('wp_about_author_settings', $tmp);
    185205    }
    186         if (!$tmp['wp_author_social_images']){
    187                 $tmp['wp_author_display_feed'] = "";
    188                 update_option('wp_about_author_settings', $tmp);
    189         }
    190         if (!$tmp['wp_author_display_feed']){
    191                 $tmp['wp_author_display_feed'] = "";
    192                 update_option('wp_about_author_settings', $tmp);
    193         }
    194 }
    195 
     206    if (!$tmp['wp_author_social_images']){
     207            $tmp['wp_author_display_feed'] = "";
     208            update_option('wp_about_author_settings', $tmp);
     209    }
     210    if (!$tmp['wp_author_display_feed']){
     211            $tmp['wp_author_display_feed'] = "";
     212            update_option('wp_about_author_settings', $tmp);
     213    }
     214    if (!$tmp['wp_author_avatar_size']){
     215            $tmp['wp_author_avatar_size'] = "100";
     216            $tmp['wp_author_avatar_shape'] = "";
     217            update_option('wp_about_author_settings', $tmp);
     218
     219    }
     220}
     221
     222function wp_about_author_shortcode( ){
     223    return wp_about_author_display();
     224}
     225
     226
     227add_shortcode( 'wp_about_author', 'wp_about_author_shortcode' );
    196228
    197229add_action('admin_menu','add_wp_about_author_options_subpanel');
    198230add_action('admin_print_scripts', 'add_wp_about_author_admin_scripts');
    199231add_action('admin_print_styles', 'add_wp_about_author_admin_styles');
     232add_filter('plugin_action_links_' . WPAUTHORURL_BASENAME, 'wp_about_author_plugin_settings_link');
    200233
    201234add_action('wp_print_styles', 'wp_about_author_style' );
Note: See TracChangeset for help on using the changeset viewer.