Changeset 606834
- Timestamp:
- 10/02/2012 04:21:41 AM (13 years ago)
- Location:
- get-user-info/trunk
- Files:
-
- 4 edited
-
getUserInfo.php (modified) (12 diffs)
-
readme.txt (modified) (3 diffs)
-
screenshot-1.png (modified) (previous)
-
screenshot-2.png (modified) (previous)
Legend:
- Unmodified
- Added
- Removed
-
get-user-info/trunk/getUserInfo.php
r604437 r606834 3 3 Plugin Name: Get user info 4 4 Plugin URI: http://wordpress.org/extend/plugins/get-user-info/ 5 Choose to display any of the following for any user: First and last name, avatar, description or website. A title can be added along with a css class to allow styling if needed. Is available as a widget or shortcode. Ex. [userinfo user="User Name" class="CssClass" title="My Title" name="true" avatar="true" description="true" website="true"].6 Version: 1. 0.95 Description: Choose to display any of the following for any user: User name, first and last name, avatar, description or website. A title can be added along with a css class to allow styling if needed. Is available as a widget or shortcode. Ex. [userinfo user="User Name" class="CssClass" title="My Title" username="true" name="true" avatar="true" description="true" website="true"]. 6 Version: 1.1 7 7 Author: Jeff Freeman 8 8 Author URI: http://graphicalforce.com … … 21 21 'featured_widget', // Base ID 22 22 'Get User Info', // Name 23 array( 'description' => __( 'Display the name, description, and avatarof any user. Just enter the username.', 'text_domain' ), ) // Args23 array( 'description' => __( 'Display any of the following: user name, first and last name, description, avatar, and website of any user. Just enter the username.', 'text_domain' ), ) // Args 24 24 ); 25 25 } … … 38 38 $cssClass = apply_filters('widget_title', empty($instance['cssClass']) ? '' : $instance['cssClass'], $instance); 39 39 $user = apply_filters( 'widget_title', $instance['userName'] ); 40 $userNameDisplay = apply_filters( 'widget_title', $instance['userNameDisplay'] ); 40 41 $firstLast = apply_filters( 'widget_title', $instance['firstLast'] ); 41 42 $avatar = apply_filters( 'widget_title', $instance['avatar'] ); … … 52 53 $user = get_userdatabylogin($user); 53 54 $user_email = $user->user_email; 55 if ( $userNameDisplay ) { 56 $user_name = $user->user_login; 57 } 54 58 if ( $firstLast ) { 55 59 $user_last = $user->last_name; … … 73 77 echo $before_title . $userName . $after_title; 74 78 echo "<h3 class=\"widget-title\">{$title}</h3>"; 79 echo "<h4>{$user_name}</h4>"; 75 80 echo "<h4>{$user_first} {$user_last}</h4>"; 76 81 echo "{$user_avatar}"; … … 95 100 $instance['title'] = strip_tags($new_instance['title']); 96 101 $instance['cssClass'] = strip_tags($new_instance['cssClass']); 102 $instance['userNameDisplay'] = ($new_instance['userNameDisplay']); 97 103 $instance['firstLast'] = ($new_instance['firstLast']); 98 104 $instance['avatar'] = ($new_instance['avatar']); … … 122 128 if ( isset( $instance[ 'cssClass' ] ) ) { 123 129 $cssClass = strip_tags($instance['cssClass']); 130 } 131 if ( isset( $instance[ 'userNameDisplay' ] )) { 132 $userNameDisplay = $instance['userNameDisplay']; 124 133 } 125 134 if ( isset( $instance[ 'firstLast' ] ) ) { … … 153 162 <tr valign="top"> 154 163 <th scope="row"> 164 <label for="<?php echo $this->get_field_id('userNameDisplay'); ?>"><?php _e('User name: '); ?></label> 165 </th> 166 <td> 167 <input id="<?php echo $this->get_field_id( 'userNameDisplay' ); ?>" name="<?php echo $this->get_field_name( 'userNameDisplay' ); ?>" type="checkbox" <?php checked($userNameDisplay, 'on' ); ?> /> 168 </td> 169 </tr> 170 <tr valign="top"> 171 <th scope="row"> 155 172 <label for="<?php echo $this->get_field_id('firstLast'); ?>"><?php _e('User first and last name: '); ?></label> 156 173 </th> … … 201 218 'class' => '', 202 219 'title' => '', 220 'username' => 'false', 203 221 'name' => 'false', 204 222 'avatar' => 'false', … … 209 227 $cssClass = ($class); 210 228 $userTitle = ($title); 229 $userNameDisplay = ($username); 211 230 $firstLast = ($name); 212 231 $avatar = ($avatar); … … 215 234 $user = get_userdatabylogin($user); 216 235 $user_email = $user->user_email; 236 if ( $userNameDisplay === 'true' ) { 237 $user_name = $user->user_login; 238 } 217 239 if ( $firstLast === 'true' ) { 218 240 $user_last = $user->last_name; … … 234 256 $return_string = '<div class="' . $cssClass . '">'; 235 257 $return_string .= '<h3>' . $userTitle . '</h3><br/>'; 258 $return_string .= $user_name . '<br/>'; 236 259 $return_string .= $user_first . $user_last . '<br/>'; 237 260 $return_string .= $user_avatar . '<br/>'; -
get-user-info/trunk/readme.txt
r604437 r606834 4 4 Requires at least: 3.0 5 5 Tested up to: 3.4.2 6 Stable tag: 1. 0.96 Stable tag: 1.1 7 7 License: GPLv2 or later 8 8 License URI: http://www.gnu.org/licenses/gpl-2.0.html 9 9 10 Display the first and last name, avatar, description, or website of any user via widget or shortcode. Other options are title and/or a css class.10 Display the user name, first and last name, avatar, description, or website of any user via widget or shortcode. Other options are title and/or a css class. 11 11 12 12 == Description == 13 13 14 Choose to display any of the following for any user: First and last name, avatar, description or website. A title can be added along with a css class to allow styling if needed. Is available as a widget or shortcode. Use [userinfo user="User Name" class="CssClass" title="My Title" name="true" avatar="true" description="true" website="true"].14 Choose to display any of the following for any user: user name, first and last name, avatar, description or website. A title can be added along with a css class to allow styling if needed. Is available as a widget or shortcode. Use [userinfo user="User Name" class="CssClass" title="My Title" username="true" name="true" avatar="true" description="true" website="true"]. 15 15 16 16 == Installation == … … 18 18 1. Upload `get-user-info` file to the `/wp-content/plugins/` directory 19 19 2. Activate the plugin through the 'Plugins' menu in WordPress 20 3. Add a Get User Info widget to any sidebar and add a title, cssClass if needed then add the user name of the user you want to display. Check any other information you would like to display. You can also display the user info by using the following shortcode '[userinfo user="User Name" class="CssClass" title="My Title" name="true" avatar="true" description="true" website="true"]' (replace User Name with the user name that you want to display ex. [userinfo user="Bill" class="CssClass" title="My Title" name="true" avatar="true" description="true" website="true"]). Just use false in the shortcode or don't include it if you don't want it to display.20 3. Add a Get User Info widget to any sidebar and add a title, cssClass if needed then add the user name of the user you want to display. Check any other information you would like to display. You can also display the user info by using the following shortcode '[userinfo user="User Name" class="CssClass" title="My Title" username="true" name="true" avatar="true" description="true" website="true"]' (replace User Name with the user name that you want to display ex. [userinfo user="Bill" class="CssClass" title="My Title" username="true" name="true" avatar="true" description="true" website="true"]). Just use false in the shortcode or don't include it if you don't want it to display. 21 21 22 22 == Screenshots == … … 26 26 27 27 == Changelog == 28 29 = 1.1 = 30 * Added the ability to display the username in the widget or shortcode. 28 31 29 32 = 1.0.9 =
Note: See TracChangeset
for help on using the changeset viewer.