Changeset 713013
- Timestamp:
- 05/14/2013 04:01:44 PM (13 years ago)
- Location:
- xpandable-author-tab/trunk
- Files:
-
- 19 added
- 5 edited
-
functions.php (added)
-
images (added)
-
images/aim.jpg (added)
-
images/ba16x16.png (added)
-
images/basmalllogo.png (added)
-
images/blogs.png (added)
-
images/facebook.png (added)
-
images/google.png (added)
-
images/twitter.png (added)
-
images/yahoo.png (added)
-
pages.php (added)
-
readme.txt (modified) (2 diffs)
-
screenshot-1.png (modified) (previous)
-
screenshot-2.png (modified) (previous)
-
screenshot-3.png (added)
-
screenshot-4.png (added)
-
screenshot-5.png (added)
-
screenshot-6.png (added)
-
screenshot-7.png (added)
-
xpandable-author-tab-original.css (added)
-
xpandable-author-tab-widget.css (added)
-
xpandable-author-tab-widget.php (added)
-
xpandable-author-tab.css (modified) (5 diffs)
-
xpandable-author-tab.php (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
xpandable-author-tab/trunk/readme.txt
r305328 r713013 3 3 Tags: expanding author, author bio, social media, user info 4 4 Requires at least: 2.9 5 Tested up to: 3. 0.15 Tested up to: 3.5.1 6 6 Stable tag: 1.9.20.10 7 7 8 Simply adds an expanding author bio after every post automatically.8 Add an expanding author panel to posts, pages, themes and comes with a widget for sidebar display. WordPress administrator can display multiple authors on one page. 9 9 10 10 == Description == 11 11 12 XPandable Author Tab is a WordPress plugin (2.9 + only, backports not supported) that shows the reader a small tabbed box. When expanded by clicking + sign over the gravatar image, a hidden window expands showing all the author's attributes, including Facebook, Twitter, Personal Website URL, gravatar image, number and list of articles with links. This codeline is based largely on Arif Nezami's Better Author Bio Plugin for WordPress at http://wp-adm.in . Additional features have been added. Support is provided on the plugin homepage. Feel free to comment or make suggestions. 12 BuildAutomate’s XPandable Author Tab allows developers to display more biographical information about a WordPress author. 13 In its expanded state, this plugin holds an image, social media icons and any other information a developer or author deems 14 appropriate. The latest 2.0 release takes these already-popular features and supercharges them to create a richer experience 15 for developer, author and reader. The widget now has configurable page placement via shortcuts and enhanced graphical social icons. 16 Developers also can use our inline CSS editor and a rollout speed setting to customize the user experience. 17 18 Building on the great user interface XPandable Author Tab developers and users have come to expect, they now have access to 19 video-based help and can receive free technical support via a built-in ticketing interface. 20 21 The Xpandable Author Tab not only gives developers flexibility to display custom author information, our newest release sports 22 the following features: 23 24 • Author Image Placement in Badge & in Expanded State 25 • Upon Engagement, Badge Shows an Expandable Area Containing Additional Author/Text Information 26 • Brand New Administrative Management User Interface 27 • Configurable Placement of XPandable Author Tab Via Shortcodes 28 • Configurable Widgets to Display Current Post or Page Author or Designated Author 29 • Video-Based Help 30 • Free Technical Support Feature Allowing Developer to Submit Trouble Tickets Within Plugin 31 • Inline Stylesheet Editor With Rollback Feature 32 • Easily Configurable Speed Settings for Author Description 33 • Enhanced Graphical Social Media Icons 34 • Multiple Author Tabs on Posts, Pages, Widgets or Themes 35 13 36 14 37 == Installation == … … 18 41 Step 2. Upload it in you wp-content/plugins directory. 19 42 20 Step 3. Activate from Admin panel. 43 Step 3. Activate from Admin panel. Additionally, you may choose to activate the XPandable Author Tab Widget. 21 44 22 45 Step 4. Fill out full contact information for authors. 46 47 Step 5: Refer to built-in help and video for further questions regarding configuration, installation and help. 48 23 49 == Frequently Asked Questions == 24 50 25 51 There is built-in help in the XPandable Author Tab plugin. 26 52 27 53 == Screenshots == 28 54 29 1. Activated Plugin55 1. User Display 30 56 31 2. Expanded Author Information 57 2. CSS/Stylesheet Settings 58 59 3. Effects Settings for Drop Down 60 61 4. Built-in Help Support 62 63 5. Widget Configuration 64 65 6. Collapsed Widget State 66 67 7. Expanded Widget State 32 68 33 69 34 70 == Changelog == 71 72 Version 2.0 is a complete rewrite of the toolkit. If you are using the old version of XPandable Author Tab, 73 it will not operate in the same manner. The XPandable Author Tab requires implied placement via a 74 shortcode or widget configuration. -
xpandable-author-tab/trunk/xpandable-author-tab.css
r305328 r713013 1 /* @override http://www.vaughnbullard.com/wp-content/plugins/xpandable-author-tab/xpandable-author-tab.css?ver=3.0.1 */2 3 1 #xpandable-author-tab-div 4 2 { 5 3 background:#F7F7F7; 6 margin: 20px 0px 0px 0px;4 margin:0px 0px 0px 0px; 7 5 padding:10px 0; 8 6 border:1px solid #E6E6E6; … … 22 20 { 23 21 text-align: justify; 24 margin:10px 30px 10px 90px;25 padding-top: 10px;26 padding-right: 10px;27 padding-left: 10px;28 padding-bottom: 10px;22 margin:10px 0px 0px 0px; 23 padding-top: 0px; 24 padding-right: 0px; 25 padding-left: 0px; 26 padding-bottom: 0px; 29 27 30 28 } 31 29 32 #xpandable-author-tab-div p 30 31 #xpandable-author-tab-div .avatar 33 32 { 34 margin:0 0 0 50px; 35 padding:0; 36 padding-right: 50px; 37 padding-left: 50px; 38 padding-bottom: 5px; 33 float:left; 34 margin:0px 3px 3px 3px; 35 padding:3px; 36 padding-right: 3px; 37 padding-left: 3px; 38 padding-bottom: 3px; 39 39 } 40 40 41 #xpandable-author-tab-div -meta41 #xpandable-author-tab-div .xpandable-author-tab-div-meta 42 42 { 43 margin-top: -3px; 43 44 padding-top: 10px; 44 padding-right: 10px; 45 padding-left: 10px; 46 padding-bottom: 10px; 45 padding-right: 5px; 46 padding-left: 5px; 47 padding-bottom: 5px; 48 47 49 } 48 #xpandable-author-tab-div img50 #xpandable-author-tab-div .socialbuttons 49 51 { 50 52 background: #FFF; 51 53 float:left; 52 margin:0 10px 0 10px;54 margin:0 0px 0 5px; 53 55 padding:3px; 54 56 -moz-box-shadow: 3px 3px 4px #AAA; … … 60 62 filter: progid:DXImageTransform.Microsoft.Shadow(Strength=4, Direction=135, Color='#AAAAAA'); 61 63 } 62 63 64 #xpandable-author-tab-div ul 64 65 { 66 padding: 15px 0 0 0; 65 67 overflow:hidden; 66 margin:0 0 0 90px; 67 padding:0; 68 margin:-1px; 69 padding:10px; 70 font-size: 70%; 71 } 72 #xpandable-author-tab-div ul h6 73 { 74 overflow:hidden; 75 margin:-1px; 76 padding:5px; 77 font-size: 70%; 78 68 79 } 69 80 … … 72 83 list-style-type: disc; 73 84 float:left; 74 margin: 8px 6px 0 0;85 margin:0px 0px 0 0; 75 86 padding:0 0 0 6px; 76 87 line-height:120%; … … 86 97 padding:0; 87 98 } 99 #xpandable-author-tab-div .xpandable-author-tab-div-buttons 100 { 101 margin:10px 0px 0px 0px; 102 padding-top: 0px; 103 padding-right: 0px; 104 padding-left: 0px; 105 padding-bottom: 0px; 106 } 107 #xpandable-author-tab-div .morebutton 108 { 109 font-size: 70%; 110 background:#F7F7F7; 111 margin-left:-3px; 112 -moz-box-shadow: 3px 3px 4px #AAA; 113 -webkit-box-shadow: 3px 3px 4px #AAA; 114 box-shadow: 3px 3px 4px #AAA; 115 /* For IE 8 */ 116 -ms-filter: "progid:DXImageTransform.Microsoft.Shadow(Strength=4, Direction=135, Color='#AAAAAA')"; 117 /* For IE 5.5 - 7 */ 118 filter: progid:DXImageTransform.Microsoft.Shadow(Strength=4, Direction=135, Color='#AAAAAA'); 119 } 88 120 121 122 #xpandable-author-tab-div .xpandable-author-tab-div-info-footer, .balogo 123 { 124 overflow:hidden; 125 margin:-1px; 126 margin-top: 10px; 127 padding:5px; 128 font-size: 30%; 129 float: right; 130 } 131 xpandable-author-tab-div .balogo 132 { 133 overflow:hidden; 134 } -
xpandable-author-tab/trunk/xpandable-author-tab.php
r305328 r713013 2 2 /* 3 3 Plugin Name: Xpandable Author Tab 4 Version: 1.9.20.10 5 Description: XPandable Author Tab is a WordPress plugin (2.9 + only, backports not supported) that shows the reader a small tabbed box. When expanded by clicking + sign over the gravatar image, a hidden window expands showing all the author's attributes, including Facebook, Twitter, Personal Website URL, gravatar image, number and list of articles with links. This codeline is based largely on Arif Nezami's Better Author Bio Plugin for WordPress at http://wp-adm.in . Additional features have been added. Support is provided on the plugin homepage. Feel free to comment or make suggestions. 6 Author: Vaughn Bullard 7 Author URI: http://www.vaughnbullard.com/ 8 Plugin URI: http://www.vaughnbullard.com/apps-plugins/xpandable-author-tab/ 4 Version: 2.0 5 Description: BuildAutomate’s XPandable Author Tab allows developers to display more biographical information about a WordPress author. In its expanded state, this plugin holds an image, social media icons and any other information a developer or author deems appropriate. The latest 2.0 release takes these already-popular features and supercharges them to create a richer experience for developer, author and reader. The widget now has configurable page placement via shortcuts and enhanced graphical social icons. Developers also can use our inline CSS editor and a rollout speed setting to customize the experience. Building on the great user interface XPandable Author Tab developers and users have come to expect, they now have access to video-based help and can receive free technical support via a built-in ticketing interface. 6 7 Author: Vaughn Bullard, Build.Automate, Inc. 8 Author URI: http://www.buildautomate.com/en 9 Plugin URI: http://www.buildautomate.com/en/products/xpandable-author-tab/ 9 10 License: GNU GPL v3 or later 10 11 … … 23 24 24 25 */ 26 include_once dirname( __FILE__ ) . '/pages.php'; 27 include_once dirname( __FILE__ ) . '/functions.php'; 25 28 26 29 Class xpandable_author_tab { … … 28 31 public static function init() { 29 32 global $wp_version; 33 30 34 // Requires Wordpress 2.9 or greater 31 35 if (version_compare($wp_version, "2.9", "<")) { 32 36 return false; 33 37 } 34 self::addFilters(); 38 39 self::addFilters(); 35 40 self::addActions(); 41 36 42 load_plugin_textdomain('xpandable_author_tab', false, dirname(plugin_basename(__FILE__ ))); 43 add_action('admin_menu', 'xpandable_author_tab_create_menu'); 44 add_shortcode('xpandableauthortab','retrieveAuthorPanel'); 45 37 46 return true; 38 47 } … … 41 50 $soc_contact['twitter'] = 'Twitter'; 42 51 $soc_contact['facebook'] = 'Facebook'; 52 $soc_contact['aim'] = 'AIM'; 53 $soc_contact['yim'] = 'Yahoo IM'; 54 $soc_contact['jabber'] = 'Jabber/Google Talk'; 43 55 44 56 return $soc_contact; 45 57 } 46 58 47 public static function filterContent($content = '') { 48 if( is_single() ) { 59 public static function pluginCss() { 60 61 if(file_exists(self::getPluginDir() . '/xpandable-author-tab.css')) { 62 wp_register_style('xpandable-author-tab-div', self::getPluginUrl().'/xpandable-author-tab.css'); 63 wp_enqueue_style('xpandable-author-tab-div'); 64 } 65 } 66 67 private static function getPluginDir() { 68 return WP_PLUGIN_DIR .'/'. dirname(plugin_basename(__FILE__)); 69 } 70 71 private static function getPluginUrl() { 72 return WP_PLUGIN_URL .'/'. dirname(plugin_basename(__FILE__)); 73 } 74 75 private static function addFilters() { 76 add_filter('user_contactmethods', array('xpandable_author_tab', 'filterSocialContactMethods')); 77 //add_filter('the_content', array('xpandable_author_tab', 'filterContent')); 78 } 79 80 public static function addActions() { 81 add_action('wp_print_styles', array('xpandable_author_tab', 'pluginCss')); 82 } 83 84 } 85 86 87 function retrieveAuthorPanel($atts) 88 { 89 global $wp_query; 90 extract(shortcode_atts(array('authorid' => ''), $atts)); 91 92 if($authorid == "thisauthor") 93 { 94 $thePostID = $wp_query->post->ID; 95 $postdata = get_post($thePostID, ARRAY_A); 96 $authorid = $postdata['post_author']; 97 } 98 49 99 $author = array(); 50 $author['name'] = get_the_author(); 51 $author['twitter'] = get_the_author_meta('twitter'); 52 $author['facebook'] = get_the_author_meta('facebook'); 53 $author['posts'] = (int)get_the_author_posts(); 100 $author['name'] = get_the_author_meta('first_name',$authorid) ." ".get_the_author_meta('last_name',$authorid); ; 101 $author['twitter'] = get_the_author_meta('twitter',$authorid); 102 $author['facebook'] = get_the_author_meta('facebook',$authorid); 103 $author['aim'] = get_the_author_meta('aim',$authorid); 104 $author['yim'] = get_the_author_meta('yim',$authorid); 105 $author['jabber'] = get_the_author_meta('jabber',$authorid); 106 $author['posts'] = (int)get_the_author_posts($authorid); 107 $piurl = getPublicPluginUrl(); 108 $uuid = gen_uuid(); 109 110 $speed = "slow"; 111 if(!get_option('xpandable_author_tab_speed')) 112 { $speed = "slow"; }else 113 { $speed = get_option('xpandable_author_tab_speed'); } 114 54 115 ob_start(); 55 116 ?> … … 58 119 <div class="xpandable-author-tab-div-info"> 59 120 60 <?php echo get_avatar( get_the_author_ email(), '60' ); ?>121 <?php echo get_avatar( get_the_author_meta( 'user_email', $authorid ), '60' ); ?> 61 122 62 123 <a href="<?php echo get_author_posts_url( get_the_author_meta( 'ID' ) ); ?>"> 63 <?php echo esc_attr( sprintf(__ngettext('%s has written one article on this blog', '%s has written %d articles on this blog', $author['posts'], 'xpandable_author_tab-div'), get_the_author_firstname().' '.get_the_author_lastname(), $author['posts'])); ?>.124 <?php echo esc_attr(get_the_author_meta('first_name',$authorid).' '.get_the_author_meta('last_name',$authorid)); ?> 64 125 </a> 126 <div class="xpandable-author-tab-div-buttons"> 127 <a href="<?php echo get_the_author_meta('url');?>" target="newWin" title="<?php echo esc_attr(sprintf(__('Read %s’s blog', 'xpandable-author-tab-div'), $author['name'])); ?>"><img src="<?php echo $piurl ?>/images/blogs.png" class="socialbuttons"/></a> 128 <!-- TWITTER --> 129 <?php if(!empty($author['twitter'])): ?> 130 <a href="<?php echo $author['twitter']; ?>" target="newWin" title="<?php echo esc_attr(sprintf(__('Follow %s on Twitter', 'xpandable-author-tab-div'), $author['name'])); ?>" rel="external"><img src="<?php echo $piurl ?>/images/twitter.png" class="socialbuttons"/></a> 131 <?php endif; ?> 132 <!-- FACEBOOK --> 133 <?php if(!empty($author['facebook'])): ?> 134 <a href="<?php echo $author['facebook']; ?>" target="newWin" title="<?php echo esc_attr(sprintf(__('Be %s’s friend on Facebook', 'xpandable-author-tab-div'), $author['name'])); ?>" rel="external"><img src="<?php echo $piurl ?>/images/facebook.png" class="socialbuttons"/></a> 135 <?php endif; ?> 136 <!-- AIM --> 137 <?php if(!empty($author['aim'])): ?> 138 <a href="<?php echo $author['aim']; ?>" target="newWin" title="<?php echo esc_attr(sprintf(__('Be %s’s friend on AIM', 'xpandable-author-tab-div'), $author['name'])); ?>" rel="external"><img src="<?php echo $piurl ?>/images/aim.jpg" class="socialbuttons"/></a> 139 <?php endif; ?> 140 <!-- YIM --> 141 <?php if(!empty($author['yim'])): ?> 142 <a href="<?php echo $author['yim']; ?>" target="newWin" title="<?php echo esc_attr(sprintf(__('Be %s’s friend on Yahoo', 'xpandable-author-tab-div'), $author['name'])); ?>" rel="external"><img src="<?php echo $piurl ?>/images/yahoo.png" class="socialbuttons"/></a> 143 <?php endif; ?> 144 <!-- JABBER/Google Talk --> 145 <?php if(!empty($author['jabber'])): ?> 146 <a href="<?php echo $author['jabber']; ?>" target="newWin" title="<?php echo esc_attr(sprintf(__('Be %s’s friend on Jabber/Google', 'xpandable-author-tab-div'), $author['name'])); ?>" rel="external"><img src="<?php echo $piurl ?>/images/google.png" class="socialbuttons"/></a> 147 <?php endif; ?> 148 </div> 149 <br/> 65 150 <ul> 66 <li><a href="<?php echo get_the_author_meta('url'); ?>" title="<?php echo esc_attr(sprintf(__('Read %s’s blog', 'xpandable-author-tab-div'), $author['name'])); ?>"><?php echo __("Blog"); ?></a></li> 67 <?php if(!empty($author['twitter'])): ?> 68 <li><a href="<?php echo $author['twitter']; ?>" title="<?php echo esc_attr(sprintf(__('Follow %s on Twitter', 'xpandable-author-tab-div'), $author['name'])); ?>" rel="external">Twitter</a></li> 69 <?php endif; ?> 70 <?php if(!empty($author['facebook'])): ?> 71 <li><a href="<?php echo $author['facebook']; ?>" title="<?php echo esc_attr(sprintf(__('Be %s’s friend on Facebook', 'xpandable-author-tab-div'), $author['name'])); ?>" rel="external">Facebook</a></li> 72 <?php endif; ?> 73 </ul> 74 <button>+ <?php printf( esc_attr__( 'Click for more info about %s'), get_the_author() ); ?></button> 151 <button class="morebutton"><?php printf( esc_attr__( '+ About %s'), get_the_author_meta('first_name',$authorid) ); ?></button> 75 152 <script> 76 153 $("button").click(function () { 77 $(" h6").slideToggle("fast");154 $(".xpandable-author-tab-div-meta-<?php echo $authorid.$uuid ?>").slideToggle("<?php echo $speed ?>"); 78 155 }); 79 156 80 157 </script> 81 158 <br/> 82 <h6 class="xpandable-author-tab-div-meta" style="display: none"><?php echo get_the_author_meta('description'); ?></h6> 159 <h6 class="xpandable-author-tab-div-meta-<?php echo $authorid.$uuid ?>" style="display: none"><?php echo get_the_author_meta('description',$authorid); ?><br/><br/><a href="<?php echo get_author_posts_url( get_the_author_meta( 'ID',$authorid ) ); ?>"> 160 <?php echo esc_attr(sprintf(__ngettext('%s has written 1 article', '%s has written %d articles', $author['posts'], 'xpandable_author_tab-div'), get_the_author_meta('first_name',$authorid).' '.get_the_author_meta('last_name',$authorid), $author['posts'])); ?>. 161 </a></h6> 162 <div class="xpandable-author-tab-div-info-footer"><a href="http://www.buildautomate.com/en/products/xpandable-author-tab/" target="newWin"><img src="<?php echo $piurl ?>/images/ba16x16.png" id="balogo" style="padding-right:5px;" title="Build.Automate, Inc. XPandable Author Tab"/></a></div> 163 <?php checkXPATAPIKeyShort(); ?> 164 </ul> 83 165 </div> 84 166 </div> 85 167 <?php 86 168 $content .= ob_get_clean(); 87 } 169 88 170 return $content; 89 } 90 91 public static function pluginCss() { 92 if(file_exists(self::getPluginDir() . '/xpandable-author-tab.css')) { 93 wp_register_style('xpandable-author-tab-div', self::getPluginUrl().'/xpandable-author-tab.css'); 94 wp_enqueue_style('xpandable-author-tab-div'); 95 } 96 } 97 98 private static function getPluginDir() { 99 return WP_PLUGIN_DIR .'/'. dirname(plugin_basename(__FILE__)); 100 } 101 102 private static function getPluginUrl() { 103 return WP_PLUGIN_URL .'/'. dirname(plugin_basename(__FILE__)); 104 } 105 106 private static function addFilters() { 107 add_filter('user_contactmethods', array('xpandable_author_tab', 'filterSocialContactMethods')); 108 add_filter('the_content', array('xpandable_author_tab', 'filterContent')); 109 } 110 111 private static function addActions() { 112 add_action('wp_print_styles', array('xpandable_author_tab', 'pluginCss')); 113 } 114 } 115 171 172 } 116 173 if(!xpandable_author_tab::init()) { 117 174 echo 'XPandable Author Tab plugin requires WordPress 2.9 or higher. Please upgrade!'; … … 119 176 120 177 121 178 function xpandable_author_tab_create_menu() 179 { 180 //create new top-level menu 181 add_menu_page('XP Overview', 'XP Author Tab', 'administrator', 'XPandableAuthorTabSettings', 'XPATOverview', 'http://buildautomate.com/favicon.ico',3 ); 182 add_submenu_page('XPandableAuthorTabSettings', 'Stylesheet', 'Stylesheet', 'administrator', 'XPATStylesheet', 'XPATStylesheet'); 183 add_submenu_page('XPandableAuthorTabSettings', 'Effects Settings', 'Effects Settings', 'administrator', 'XPATEffectsSettings', 'XPATEffectsSettings'); 184 add_submenu_page('XPandableAuthorTabSettings', 'Shortcode', 'Shortcode', 'administrator', 'XPATShortcodes', 'XPATShortcodes'); 185 add_submenu_page('XPandableAuthorTabSettings', 'Registration', 'Registration', 'administrator', 'XPATRegistration', 'XPATRegistration'); 186 add_submenu_page('XPandableAuthorTabSettings', 'Tech Support', 'Tech Support', 'administrator', 'XPATTechSupport', 'XPATTechSupport'); 187 add_submenu_page('XPandableAuthorTabSettings', 'Help', 'Help', 'administrator', 'XPATHelp', 'XPATHelp'); 188 189 //call register settings function 190 add_action( 'admin_init', 'XPATregister_mysettings' ); 191 } 192 function XPATregister_mysettings() { 193 //register XPandable Author Tab settings 194 register_setting( 'xpandable-author-tab-settings-group', 'xpandable_author_tab_css' ); 195 } 196 function XPATregisterProductRemote($xfn,$xln,$xem,$xct,$xsp,$xcy,$siteurl,$xprod,$xat_version) 197 { 198 $url = "http://buildautomate.com/topaz/receive-registration"; 199 $response = wp_remote_post( $url, array( 200 'method' => 'POST', 201 'timeout' => 45, 202 'redirection' => 5, 203 'httpversion' => '1.0', 204 'blocking' => true, 205 'headers' => array(), 206 'body' => array( 'xtools_firstname' => $xfn, 207 'xtools_lastname' => $xln, 208 'xtools_emailaddress' => $xem, 209 'xtools_city' => $xct, 210 'xtools_stateprovince' => $xsp, 211 'xtools_country' => $xcy, 212 'xtools_siteurl' => $siteurl, 213 'xtools_product' => $xprod, 214 'xtools_version' => $xat_version 215 ), 216 'cookies' => array() 217 ) 218 ); 219 $body = $response['body']; 220 $apikey = ""; 221 222 if( is_wp_error( $response ) ) { 223 //$error_message = $response->get_error_message(); 224 // echo "Something went wrong: $error_message"; 225 } else { 226 $startpos = strpos($body, "<apikey>"); 227 $endpos = strpos($body, "</apikey>"); 228 $chars = $endpos - $startpos; 229 $apikey = substr($body, $startpos+8, $chars-8); 230 } 231 return $apikey; 232 }
Note: See TracChangeset
for help on using the changeset viewer.