├── .gitignore ├── css └── styles.css ├── help.php ├── images ├── delete.png ├── icon.png ├── move.png └── sb-icons │ ├── delicious.png │ ├── email.png │ ├── facebook-c.png │ ├── google-talk.png │ ├── heart.png │ ├── lastfm.png │ ├── linkedin.png │ ├── retweet.png │ ├── rss.png │ ├── star.png │ ├── tumblr.png │ ├── twitter.png │ ├── vimeo.png │ └── youtube.png ├── js └── scripts.js ├── languages └── social-bartender.po ├── readme.txt ├── screenshot-1.png ├── settings.php ├── social-bartender.php └── widget.php /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store -------------------------------------------------------------------------------- /css/styles.css: -------------------------------------------------------------------------------- 1 | .wrap{ 2 | max-width: 940px; 3 | } 4 | 5 | #post-body{ 6 | padding: 24px 0 0; 7 | border: 0 none; 8 | } 9 | 10 | .inner-sidebar{ 11 | display: block; 12 | float: left; 13 | } 14 | 15 | .empty-message{ 16 | text-align: center; 17 | padding: 80px 50px; 18 | } 19 | .empty-message p{ 20 | font-family: Georgia, "Times New Roman", "Bitstream Charter", Times, serif; 21 | font-size: 18px; 22 | font-style: italic; 23 | color: #888; 24 | } 25 | 26 | /* ******************************************* 27 | Add New Item 28 | ******************************************* */ 29 | .postbox .inside{ 30 | padding: 0; 31 | } 32 | 33 | .postbox .posttypediv{ 34 | padding: 0 10px; 35 | } 36 | 37 | .postbox p{ 38 | padding: 0 10px; 39 | display: block; 40 | overflow: hidden; 41 | } 42 | 43 | .postbox p.sh_sb-border-bottom{ 44 | overflow: visible; 45 | } 46 | 47 | .howto .sh_sb-clearfix{ 48 | display: block; 49 | clear: both; 50 | float: none; 51 | height: 1px; 52 | } 53 | 54 | .postbox input[type="text"].error-field{ 55 | border: 1px solid red; 56 | } 57 | 58 | .postbox label{ 59 | display: block; 60 | margin-bottom: 2px; 61 | } 62 | 63 | .howto .required{ 64 | color: #bd0000; 65 | float: none; 66 | margin: 0; 67 | display: inline; 68 | } 69 | 70 | .howto span{ 71 | margin-top: 4px; 72 | display: block; 73 | float: left; 74 | } 75 | 76 | #sh_sb_icon_new{ 77 | float: left; 78 | width: 150px; 79 | margin-left: 35px; 80 | 81 | -webkit-transition: all 500ms ease; 82 | -moz-transition: all 500ms ease; 83 | transition: all 500ms ease; 84 | } 85 | 86 | .blue-glow{ 87 | -webkit-box-shadow: 0 0 15px rgba(0, 148, 242, 0.85); 88 | -moz-box-shadow: 0 0 15px rgba(0, 148, 242, 0.85); 89 | box-shadow: 0 0 15px rgba(0, 148, 242, 0.85); 90 | } 91 | 92 | .upload-field a{ 93 | float: right; 94 | margin-top: 4px; 95 | } 96 | 97 | .sh_sb-border-bottom, .postbox p.sh_sb-border-bottom, tbody td, th{ 98 | border-bottom: 1px solid #DFDFDF; 99 | -webkit-box-shadow: 0 1px 0 #fff; 100 | -moz-box-shadow: 0 1px 0 #fff; 101 | box-shadow: 0 1px 0 #fff; 102 | padding-bottom: 10px; 103 | margin-bottom: 10px; 104 | } 105 | 106 | .ui-state-active{ 107 | background-color: white; 108 | border-color: #DFDFDF; 109 | border-style: solid solid none; 110 | border-width: 1px 1px 0; 111 | } 112 | 113 | .posttypediv div.tabs-panel{ 114 | height: auto; 115 | } 116 | 117 | /* ******************************************* 118 | Listing Table 119 | ******************************************* */ 120 | table{ 121 | max-width: 700px; 122 | width: 100%; 123 | position: relative; 124 | } 125 | 126 | table.empty-table{ 127 | width: 100%; 128 | } 129 | 130 | td, th{ 131 | padding: 8px; 132 | } 133 | .ui-sortable-helper td{ 134 | background: rgba(255, 255, 255, 0.5); 135 | } 136 | 137 | th{ 138 | padding-top: 13px; 139 | text-align: left; 140 | min-width: 100px; 141 | } 142 | 143 | .postbox table input[type="text"]{ 144 | width: 100%; 145 | padding: 5px; 146 | } 147 | 148 | .icon-col{ 149 | width: 185px; 150 | } 151 | 152 | th.icon-col{ 153 | padding-left: 43px; 154 | width: 142px; 155 | } 156 | 157 | .postbox table .icon-col input{ 158 | width: 148px; 159 | } 160 | 161 | .actions-col{ 162 | min-width: 0; 163 | width: 45px; 164 | padding-right: 15px; 165 | } 166 | 167 | .sh_sb-move{ 168 | margin-right: 5px; 169 | cursor: move; 170 | } 171 | 172 | .sh_sb-move, .sh_sb-delete{ 173 | display: inline-block; 174 | padding: 3px; 175 | } 176 | 177 | .sh_sb-delete{ 178 | opacity: 0.4; 179 | -webkit-transition: opacity 200ms ease; 180 | -moz-transition: opacity 200ms ease; 181 | transition: opacity 200ms ease; 182 | } 183 | 184 | .sh_sb-delete:hover{ 185 | opacity: 1; 186 | } 187 | 188 | .postbox tfoot label{ 189 | display: inline; 190 | font-size: 11px; 191 | } 192 | 193 | .postbox tfoot input[type="submit"]{ 194 | padding-left: 30px; 195 | padding-right: 30px; 196 | float: right; 197 | } 198 | 199 | /* ******************************************* 200 | Icon Previews 201 | ******************************************* */ 202 | .icon-preview{ 203 | background: rgba( 0, 0, 0, 0.05 ); 204 | width: 16px; 205 | height: 16px; 206 | padding: 5px; 207 | margin-right: 5px; 208 | border: 1px solid rgba(0, 0, 0, 0.1); 209 | line-height: 0.75; 210 | text-align: center; 211 | float: left; 212 | 213 | -moz-border-radius: 3px; 214 | -webkit-border-radius: 3px; 215 | border-radius: 3px; 216 | } 217 | .icon-preview img{ 218 | max-width: 16px; 219 | max-height: 16px; 220 | } 221 | 222 | li.icon-preview{ 223 | margin: 3px 6px 3px 0; 224 | cursor: pointer; 225 | } 226 | li.icon-preview:nth-child(7n){ 227 | margin-right: 0; 228 | } 229 | 230 | li.icon-preview:hover{ 231 | background: rgba( 0, 0, 0, 0.15 ); 232 | } 233 | 234 | li.icon-preview:active{ 235 | background: rgba( 0, 0, 0, 0.25 ); 236 | } -------------------------------------------------------------------------------- /help.php: -------------------------------------------------------------------------------- 1 | id != $sh_sb_settings) 11 | return; 12 | 13 | // Overview tab 14 | 15 | $sb_overview = '

'.__('Help', 'shaken').' - Social Bartender

'; 16 | 17 | $sb_overview .= '

'.__('Including the list of links in your theme', 'shaken').'

'; 18 | 19 | $sb_overview .= '

'.__('To include the list of links in your theme, you need to place the following PHP function in the location where you want the links to appear:', 'shaken').'

'; 20 | 21 | $sb_overview .= '<?php social_bartender(); ?>'; 22 | 23 | $sb_overview .= '

'.__('Theme Developers', 'shaken').'

'; 24 | 25 | $sb_overview .= '

'.__('If you would like to make your own icon set available to users in the Icon Box, just place the images inside of an "images/sb-icons" folder of your theme.', 'shaken').'

'; 26 | 27 | $sb_overview .= '

'.__('Credits', 'shaken').'

'; 28 | 29 | $sb_overview .= '

'.__( 'Contributors:', 'shaken' ).' @sawyerh, @devinsays, @NickHamze, and @thelukemcdonald

'; 30 | 31 | $current_screen->add_help_tab( array( 32 | 'id' => 'overview', 33 | 'title' => __('Overview'), 34 | 'content' => $sb_overview, 35 | ) ); 36 | 37 | // Parameters tab 38 | 39 | $sb_parameters = '

'.__( 'Parameters', 'shaken' ).'

'; 40 | 41 | $sb_parameters .= '

link_before: '.__('(string) Sets the text or html that precedes the <a> tag. Default = \' \'', 'shaken' ).'

'; 42 | 43 | $sb_parameters .= '

link_after: '.__('(string) Sets the text or html that follows the <a> tag. Default = \' \'', 'shaken' ).'

'; 44 | 45 | $sb_parameters .= '

echo: '.__('(boolean) Toggles the display of the generated list of links or return the list as an HTML text string to be used in PHP. Default = 1', 'shaken').'

'; 46 | 47 | 48 | 49 | $current_screen->add_help_tab( array( 50 | 'id' => 'parameters', 51 | 'title' => __('Parameters'), 52 | 'content' => $sb_parameters, 53 | ) ); 54 | 55 | // Output tab 56 | 57 | $sb_output .= '

'.__( 'Example Output', 'shaken' ).'

'; 58 | 59 | $sb_output .= '

'.__('Using the default settings, the social_bartender() function would output the following:', 'shaken').'

'; 60 | 61 | $sb_output .= '
<a href="http://example.com" class="sh-sb-link">
 62 | 	<img src="http://mysite.com/images/icon.png" alt="Link Title" class="sh-sb-icon">
 63 | 	</a>
 64 | 	
 65 | 	<a href="http://example.com" class="sh-sb-link">
 66 | 	<img src="http://mysite.com/images/icon-2.png" alt="Link #2 Title" class="sh-sb-icon">
 67 | 	</a>
'; 68 | 69 | $current_screen->add_help_tab( array( 70 | 'id' => 'output', 71 | 'title' => __('Example Output'), 72 | 'content' => $sb_output 73 | ) ); 74 | 75 | 76 | $sb_info = '

' . __( 'For more information:' ) . '

' . 77 | '

' . __( 'Contribute on Github' ) . '

' . 78 | '

' . __( 'Shaken and Stirred Web' ) . '

' . 79 | '

' . __( 'Only the Functions' ) . '

'; 80 | 81 | $current_screen->add_help_tab( array( 82 | 'id' => 'more_info', 83 | 'title' => __('Plugin Info'), 84 | 'content' => $sb_info 85 | ) ); 86 | 87 | } 88 | 89 | else: 90 | 91 | /* Show the old style contextual help if user isn't running WP 3.3+ 92 | ******************************************************** */ 93 | 94 | add_action( 'admin_menu', 'sh_sb_help_page_old' ); 95 | 96 | function sh_sb_help_page_old() { 97 | 98 | /* Add documentation */ 99 | $contextual_help = '

'.__('Help', 'shaken').' - Social Bartender

'; 100 | 101 | $contextual_help .= '

'.__('Including the list of links in your theme', 'shaken').'

'; 102 | 103 | $contextual_help .= '

'.__('To include the list of links in your theme, you need to place the following PHP function in the location where you want the links to appear:', 'shaken').'

'; 104 | 105 | $contextual_help .= '<?php social_bartender(); ?>'; 106 | 107 | $contextual_help .= '
'; 108 | 109 | $contextual_help .= '

'.__( 'Parameters', 'shaken' ).'

'; 110 | 111 | $contextual_help .= '

link_before: '.__('(string) Sets the text or html that precedes the <a> tag. Default = \' \'', 'shaken' ).'

'; 112 | 113 | $contextual_help .= '

link_after: '.__('(string) Sets the text or html that follows the <a> tag. Default = \' \'', 'shaken' ).'

'; 114 | 115 | $contextual_help .= '

echo: '.__('(boolean) Toggles the display of the generated list of links or return the list as an HTML text string to be used in PHP. Default = 1', 'shaken').'

'; 116 | 117 | $contextual_help .= '
'; 118 | 119 | $contextual_help .= '

'.__( 'Example Output', 'shaken' ).'

'; 120 | 121 | $contextual_help .= '

'.__('Using the default settings, the social_bartender() function would output the following:', 'shaken').'

'; 122 | 123 | $contextual_help .= '
<a href="http://example.com" class="sh-sb-link">
124 | 	<img src="http://mysite.com/images/icon.png" alt="Link Title" class="sh-sb-icon">
125 | 	</a>
126 | 	
127 | 	<a href="http://example.com" class="sh-sb-link">
128 | 	<img src="http://mysite.com/images/icon-2.png" alt="Link #2 Title" class="sh-sb-icon">
129 | 	</a>
'; 130 | 131 | $contextual_help .= '
'; 132 | 133 | $contextual_help .= '

'.__('Theme Developers', 'shaken').'

'; 134 | 135 | $contextual_help .= '

'.__('If you would like to make your own icon set available to users in the Icon Box, just place the images inside of an "images/sb-icons" folder of your theme.', 'shaken').'

'; 136 | 137 | $contextual_help .= '

'.__('Credits / Support', 'shaken').'

'; 138 | 139 | $contextual_help .= '

'.__( 'The Social Bartender plugin was created by', 'shaken' ).' Shaken and Stirred Web. '.__( 'If you find any bugs, have feature requests, or would like to contribute, please visit the plugin\'s GitHub page.', 'shaken').'

'; 140 | 141 | $contextual_help .= '

'.__( 'Contributors:', 'shaken' ).' @sawyerh, @devinsays, @NickHamze, and @thelukemcdonald

'; 142 | 143 | add_contextual_help( 'settings_page_sh_sb_settings_page', $contextual_help ); 144 | } 145 | 146 | endif; 147 | ?> -------------------------------------------------------------------------------- /images/delete.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sawyerh/social-bartender/dbd3a5b2b9a9d8ab1a9b8c58e9e698191832c373/images/delete.png -------------------------------------------------------------------------------- /images/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sawyerh/social-bartender/dbd3a5b2b9a9d8ab1a9b8c58e9e698191832c373/images/icon.png -------------------------------------------------------------------------------- /images/move.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sawyerh/social-bartender/dbd3a5b2b9a9d8ab1a9b8c58e9e698191832c373/images/move.png -------------------------------------------------------------------------------- /images/sb-icons/delicious.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sawyerh/social-bartender/dbd3a5b2b9a9d8ab1a9b8c58e9e698191832c373/images/sb-icons/delicious.png -------------------------------------------------------------------------------- /images/sb-icons/email.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sawyerh/social-bartender/dbd3a5b2b9a9d8ab1a9b8c58e9e698191832c373/images/sb-icons/email.png -------------------------------------------------------------------------------- /images/sb-icons/facebook-c.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sawyerh/social-bartender/dbd3a5b2b9a9d8ab1a9b8c58e9e698191832c373/images/sb-icons/facebook-c.png -------------------------------------------------------------------------------- /images/sb-icons/google-talk.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sawyerh/social-bartender/dbd3a5b2b9a9d8ab1a9b8c58e9e698191832c373/images/sb-icons/google-talk.png -------------------------------------------------------------------------------- /images/sb-icons/heart.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sawyerh/social-bartender/dbd3a5b2b9a9d8ab1a9b8c58e9e698191832c373/images/sb-icons/heart.png -------------------------------------------------------------------------------- /images/sb-icons/lastfm.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sawyerh/social-bartender/dbd3a5b2b9a9d8ab1a9b8c58e9e698191832c373/images/sb-icons/lastfm.png -------------------------------------------------------------------------------- /images/sb-icons/linkedin.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sawyerh/social-bartender/dbd3a5b2b9a9d8ab1a9b8c58e9e698191832c373/images/sb-icons/linkedin.png -------------------------------------------------------------------------------- /images/sb-icons/retweet.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sawyerh/social-bartender/dbd3a5b2b9a9d8ab1a9b8c58e9e698191832c373/images/sb-icons/retweet.png -------------------------------------------------------------------------------- /images/sb-icons/rss.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sawyerh/social-bartender/dbd3a5b2b9a9d8ab1a9b8c58e9e698191832c373/images/sb-icons/rss.png -------------------------------------------------------------------------------- /images/sb-icons/star.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sawyerh/social-bartender/dbd3a5b2b9a9d8ab1a9b8c58e9e698191832c373/images/sb-icons/star.png -------------------------------------------------------------------------------- /images/sb-icons/tumblr.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sawyerh/social-bartender/dbd3a5b2b9a9d8ab1a9b8c58e9e698191832c373/images/sb-icons/tumblr.png -------------------------------------------------------------------------------- /images/sb-icons/twitter.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sawyerh/social-bartender/dbd3a5b2b9a9d8ab1a9b8c58e9e698191832c373/images/sb-icons/twitter.png -------------------------------------------------------------------------------- /images/sb-icons/vimeo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sawyerh/social-bartender/dbd3a5b2b9a9d8ab1a9b8c58e9e698191832c373/images/sb-icons/vimeo.png -------------------------------------------------------------------------------- /images/sb-icons/youtube.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sawyerh/social-bartender/dbd3a5b2b9a9d8ab1a9b8c58e9e698191832c373/images/sb-icons/youtube.png -------------------------------------------------------------------------------- /js/scripts.js: -------------------------------------------------------------------------------- 1 | jQuery(document).ready(function($) { 2 | 3 | // Items list actions 4 | $( ".sortable" ).sortable({ 5 | handle: 'a.sh_sb-move' 6 | }); 7 | 8 | // Tabs 9 | $('#sh_sb-icon-tabs').tabs(); 10 | 11 | // Icons 12 | $('li.icon-preview').click(function(){ 13 | 14 | var icon = $('img', this).attr('src'); 15 | var field = $('input#sh_sb_icon_new'); 16 | 17 | // Change the input value and animate a glow 18 | field.attr('value', icon).toggleClass('blue-glow').delay(600).queue(function() { 19 | $(this).toggleClass('blue-glow').dequeue(); 20 | }); 21 | 22 | }); 23 | 24 | $('a.sh_sb-delete').click(function(){ 25 | 26 | if( confirm( 'Are you sure you want to remove this item?' ) ){ 27 | var tr = $(this).parent().parent('tr'); 28 | var table = tr.parent().parent(); 29 | 30 | tr.remove(); 31 | 32 | if( $('tbody', table).children().length < 1 ){ 33 | table.addClass('empty-table'); 34 | } 35 | } 36 | 37 | }); 38 | 39 | // Make sure the link field is filled out 40 | // In the create item form 41 | $('#sh_sb_new_item').click(function(){ 42 | 43 | var link = $('#create-form #sh_sb_link').val(); 44 | 45 | if( link == '' || link == 'http://' ){ 46 | alert('The link field is required'); 47 | $('#create-form #sh_sb_link').addClass('error-field'); 48 | return false; 49 | } 50 | 51 | }); 52 | 53 | // In the listings form 54 | $('#sh_sb_update').click(function(){ 55 | 56 | var success = true; 57 | 58 | $('.sh_sb_link').each(function(){ 59 | 60 | var link = $(this).val(); 61 | 62 | if( link == '' || link == 'http://' ){ 63 | alert('All link fields are required'); 64 | $(this).addClass('error-field'); 65 | 66 | success = false; 67 | } 68 | 69 | }); 70 | 71 | return success; 72 | 73 | }); 74 | 75 | // Media Uploader 76 | var formfield = null; 77 | 78 | $('#upload_image_button').click(function() { 79 | $('html').addClass('Image'); 80 | formfield = $('#sh_sb_icon_new').attr('name'); 81 | 82 | //Change "insert into post" to "Use this Button" 83 | tbframe_interval = setInterval(function() {jQuery('#TB_iframeContent').contents().find('.savesend .button').val('Use This Image');}, 2000); 84 | 85 | tb_show('', 'media-upload.php?type=image&TB_iframe=true'); return false; 86 | }); 87 | 88 | // user inserts file into post. 89 | // only run custom if user started process using the above process 90 | // window.send_to_editor(html) is how wp normally handle the received data 91 | 92 | window.original_send_to_editor = window.send_to_editor; window.send_to_editor = function(html){ 93 | 94 | var fileurl; 95 | 96 | if (formfield != null) { 97 | fileurl = $('img',html).attr('src'); 98 | $('#sh_sb_icon_new').val(fileurl); tb_remove(); 99 | $('html').removeClass('Image'); 100 | formfield = null; } else { 101 | window.original_send_to_editor(html); 102 | } 103 | }; 104 | 105 | }); 106 | -------------------------------------------------------------------------------- /languages/social-bartender.po: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2010 Social Bartender 2 | # This file is distributed under the same license as the Social Bartender package. 3 | msgid "" 4 | msgstr "" 5 | "Project-Id-Version: Social Bartender 1.0.0\n" 6 | "Report-Msgid-Bugs-To: http://wordpress.org/tag/social-bartender\n" 7 | "POT-Creation-Date: 2011-09-04 22:30:53+00:00\n" 8 | "MIME-Version: 1.0\n" 9 | "Content-Type: text/plain; charset=UTF-8\n" 10 | "Content-Transfer-Encoding: 8bit\n" 11 | "PO-Revision-Date: 2010-MO-DA HO:MI+ZONE\n" 12 | "Last-Translator: FULL NAME \n" 13 | "Language-Team: LANGUAGE \n" 14 | 15 | #: settings.php:7 16 | msgid "Insufficient permissions" 17 | msgstr "" 18 | 19 | #: settings.php:27 20 | msgid "Create New Item" 21 | msgstr "" 22 | 23 | #: settings.php:33 settings.php:107 24 | msgid "Link" 25 | msgstr "" 26 | 27 | #: settings.php:38 settings.php:108 28 | msgid "Title" 29 | msgstr "" 30 | 31 | #: settings.php:43 settings.php:106 32 | msgid "Icon" 33 | msgstr "" 34 | 35 | #: settings.php:46 36 | msgid "Upload" 37 | msgstr "" 38 | 39 | #: settings.php:51 40 | msgid "Create Item" 41 | msgstr "" 42 | 43 | #: settings.php:61 44 | msgid "Icon Bucket" 45 | msgstr "" 46 | 47 | #: settings.php:86 48 | msgid "Select an icon above and its URL will be automatically entered for you." 49 | msgstr "" 50 | 51 | #: settings.php:145 52 | msgid "Display the titles instead of images" 53 | msgstr "" 54 | 55 | #: settings.php:157 56 | msgid "You don't have any items in your bar, why not create some?" 57 | msgstr "" 58 | 59 | #: settings.php:201 60 | msgid "Item added" 61 | msgstr "" 62 | 63 | #: settings.php:250 64 | msgid "Items updated" 65 | msgstr "" 66 | 67 | #: help.php:7 68 | msgid "Help" 69 | msgstr "" 70 | 71 | #: help.php:9 72 | msgid "Including the list of links in your theme" 73 | msgstr "" 74 | 75 | #: help.php:11 76 | msgid "" 77 | "To include the list of links in your theme, you need to place the following " 78 | "PHP function in the location where you want the links to appear:" 79 | msgstr "" 80 | 81 | #: help.php:17 82 | msgid "Parameters" 83 | msgstr "" 84 | 85 | #: help.php:19 86 | msgid "" 87 | "(string) Sets the text or html that precedes the <a> tag. Default = ''" 88 | msgstr "" 89 | 90 | #: help.php:21 91 | msgid "" 92 | "(string) Sets the text or html that follows the <a> tag. Default = ''" 93 | msgstr "" 94 | 95 | #: help.php:23 96 | msgid "" 97 | "(boolean) Toggles the display of the generated list of links or return the " 98 | "list as an HTML text string to be used in PHP. Default = 1" 99 | msgstr "" 100 | 101 | #: help.php:27 102 | msgid "Example Output" 103 | msgstr "" 104 | 105 | #: help.php:29 106 | msgid "" 107 | "Using the default settings, the social_bartender() function " 108 | "would output the following:" 109 | msgstr "" 110 | 111 | #: help.php:42 112 | msgid "Theme Developers" 113 | msgstr "" 114 | 115 | #: help.php:44 116 | msgid "" 117 | "If you would like to make your own icon set available to users in the Icon " 118 | "Box, just place the images inside of an \"images/sb-icons\" folder of your " 119 | "theme." 120 | msgstr "" 121 | 122 | #: help.php:46 123 | msgid "Credits / Support" 124 | msgstr "" 125 | 126 | #: help.php:48 127 | msgid "The Social Bartender plugin was created by" 128 | msgstr "" 129 | 130 | #: help.php:48 131 | msgid "" 132 | "If you find any bugs, have feature requests, or would like to contribute, " 133 | "please visit the plugin's GitHub page." 135 | msgstr "" 136 | 137 | #: help.php:50 138 | msgid "Contributors:" 139 | msgstr "" 140 | 141 | #. Plugin Name of the plugin/theme 142 | msgid "Social Bartender" 143 | msgstr "" 144 | 145 | #. #-#-#-#-# plugin.pot (Social Bartender 1.0.0) #-#-#-#-# 146 | #. Plugin URI of the plugin/theme 147 | #. #-#-#-#-# plugin.pot (Social Bartender 1.0.0) #-#-#-#-# 148 | #. Author URI of the plugin/theme 149 | msgid "http://shakenandstirredweb.com" 150 | msgstr "" 151 | 152 | #. Description of the plugin/theme 153 | msgid "" 154 | "A simple solution for adding a list of social network links (images or text) " 155 | "anywhere you want, with one little function." 156 | msgstr "" 157 | 158 | #. Author of the plugin/theme 159 | msgid "Sawyer Hollenshead (Shaken & Stirred Web)" 160 | msgstr "" 161 | -------------------------------------------------------------------------------- /readme.txt: -------------------------------------------------------------------------------- 1 | === Social Bartender === 2 | Contributors: Sawyer Hollenshead 3 | Tags: social, social networks, social links, social icons, theme option 4 | Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=TAPWP9QGK6NDG 5 | Requires at least: 3.1 6 | Tested up to: 3.3.1 7 | Stable tag: trunk 8 | 9 | A simple solution for adding a list of social network links (images or text) anywhere you want. 10 | 11 | == Description == 12 | 13 | Social Bartender adds a new settings page where you can create a list of social network links and place them anywhere you want with one little function or widget. Users can select from the collection of social network icons that come with the plugin, select from a collection of icons provided with the theme (if support is built-in), or upload their own icons. 14 | 15 | More info and a video demo available at [shakenandstirredweb.com/plugins/social-bartender](http://shakenandstirredweb.com/plugins/social-bartender) 16 | 17 | For updates, follow [@sawyerh](http://twitter.com/sawyerh). 18 | 19 | == Installation == 20 | 21 | Option 1) Use the sidebar widget 22 | 23 | Option 2) Place the following PHP function in the location where you want the links to appear: 24 | 25 | `` 26 | 27 | Option 3) Use the shortcode: 28 | 29 | `[social_bartender]` 30 | 31 | **If you would like to make your own icon set available to users in the Icon Box**, just place the images inside of an "images/sb-icons" folder of your theme. 32 | 33 | = Parameters = 34 | 35 | link_before: (string) Sets the text or html that precedes the `` tag. Default = '' 36 | 37 | link_after: (string) Sets the text or html that follows the `` tag. Default = '' 38 | 39 | echo: (boolean) Toggles the display of the generated list of links or return the list as an HTML text string to be used in PHP. Default = 1 40 | 41 | == Screenshots == 42 | 43 | 1. The admin screen where links are created. 44 | 45 | == Other Notes == 46 | 47 | The Social Bartender plugin was created by Shaken and Stirred Web. If you find any bugs, have feature requests, or would like to contribute, please leave your feedback on the plugin's [GitHub page](https://github.com/sawyerh/social-bartender). 48 | 49 | Contributors (on Twitter): @sawyerh, @devinsays, @NickHamze, and @thelukemcdonald 50 | 51 | == Changelog == 52 | 53 | = 1.2.1 Pending = 54 | 55 | * Add shortcode 56 | 57 | = 1.2.0 (April 4, 2012) = 58 | 59 | * Update contextual help to work w/ WP 3.3 60 | 61 | = 1.1.0 (Oct. 21, 2011) = 62 | 63 | * Fix compatibility issues with WordPress 3.3 64 | 65 | = 1.0.1 (Sept. 9, 2011) = 66 | 67 | * Widget added 68 | 69 | = 1.0 (Sept. 4, 2011) = 70 | 71 | * Initial release -------------------------------------------------------------------------------- /screenshot-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sawyerh/social-bartender/dbd3a5b2b9a9d8ab1a9b8c58e9e698191832c373/screenshot-1.png -------------------------------------------------------------------------------- /settings.php: -------------------------------------------------------------------------------- 1 | 13 | 14 |
15 | 16 |

Social Bartender

17 | 18 |
166 | 167 |
168 | 169 | esc_html( $title ), 181 | 'link' => esc_url_raw( $link ), 182 | 'icon' => esc_url_raw( $icon ) 183 | ); 184 | 185 | // Check if this option already exists 186 | if( $items = get_option( 'sh_sb_items' ) ): 187 | 188 | $items[] = $entry; 189 | update_option( 'sh_sb_items', $items ); 190 | 191 | else: 192 | 193 | $items[] = $entry; 194 | update_option( 'sh_sb_items', $items ); 195 | 196 | endif; 197 | 198 | ?> 199 | 200 |
201 |

202 |
203 | 204 | esc_html( $title ), 225 | 'link' => esc_url_raw( $link ), 226 | 'icon' => esc_url_raw( $icon ) 227 | ); 228 | 229 | $items[] = $entry; 230 | 231 | endfor; 232 | 233 | update_option( 'sh_sb_items', $items ); 234 | 235 | // Show titles only? 236 | 237 | if( array_key_exists( 'sh_sb_title_only', $_POST ) && $_POST['sh_sb_title_only'] == 'on' ): 238 | 239 | // Display titles 240 | update_option( 'sh_sb_title_only', 'yes' ); 241 | 242 | else: 243 | // Display images 244 | update_option( 'sh_sb_title_only', 'no' ); 245 | 246 | endif; 247 | ?> 248 | 249 |
250 |

251 |
252 | 253 | '; 269 | 270 | // Loop through and display each image 271 | foreach( $images as $image ): 272 | 273 | // Strip out '.' and '..' 274 | if ( $image != "." && $image != ".." ){ 275 | $output .= '
  • '; 276 | } 277 | 278 | endforeach; 279 | 280 | $output .= ''; 281 | 282 | endif; 283 | 284 | return $output; 285 | 286 | else: 287 | return false; 288 | endif; 289 | 290 | } -------------------------------------------------------------------------------- /social-bartender.php: -------------------------------------------------------------------------------- 1 | ' ) ): 71 | wp_register_style( 'social-bartender-css', SH_SB_DIR.'css/styles.css', array( 'thickbox', 'nav-menu' ) ); 72 | else: 73 | wp_register_style( 'social-bartender-css', SH_SB_DIR.'css/styles.css', array( 'wp-admin', 'thickbox' ) ); 74 | endif; 75 | 76 | wp_enqueue_style( 'social-bartender-css' ); 77 | } 78 | 79 | /** 80 | * social_bartender 81 | * 82 | * Outputs the links with an image or title inside 83 | * 84 | * @param string $link_before Sets the text or html that precedes the tag. 85 | * @param string $link_after Sets the text or html that follows the tag. 86 | * @param string $echo Echo the content if true (1) or return if false (0) 87 | * 88 | * @return string 89 | */ 90 | function social_bartender( $link_before = '', $link_after = '', $echo = 1 ){ 91 | 92 | $items = get_option( 'sh_sb_items' ); 93 | $output = ''; 94 | 95 | if( !$items ) return ''; 96 | 97 | foreach( $items as $item ): 98 | 99 | $link = $item['link']; 100 | $title = $item['title']; 101 | $icon = $item['icon']; 102 | 103 | if( $link ): 104 | 105 | $output .= $link_before; 106 | 107 | $output .= ''; 108 | 109 | if( $icon && get_option( 'sh_sb_title_only' ) != 'yes' ){ 110 | $output .= ''.$title.''; 111 | } 112 | 113 | if( $title && get_option( 'sh_sb_title_only' ) == 'yes' ){ 114 | $output .= $title; 115 | } 116 | 117 | $output .= ''; 118 | 119 | $output .= $link_after; 120 | 121 | endif; 122 | 123 | endforeach; 124 | 125 | if( $echo == 1 ) 126 | echo $output; 127 | else 128 | return $output; 129 | } 130 | 131 | require_once(WP_PLUGIN_DIR . "/" . basename(dirname(__FILE__)) . "/settings.php"); 132 | require_once(WP_PLUGIN_DIR . "/" . basename(dirname(__FILE__)) . "/help.php"); 133 | require_once(WP_PLUGIN_DIR . "/" . basename(dirname(__FILE__)) . "/widget.php"); 134 | 135 | add_shortcode('social_bartender', 'social_bartender'); 136 | 137 | ?> 138 | -------------------------------------------------------------------------------- /widget.php: -------------------------------------------------------------------------------- 1 | 'sh_sb_widget_class', 14 | 'description' => 'Display your Social Bartender links.' 15 | ); 16 | $this->WP_Widget( 'sh_sb_widget', 'Social Bartender', $widget_ops ); 17 | } 18 | 19 | function form($instance) { 20 | $defaults = array( 'title' => '', 'disable_styles' => false ); 21 | $instance = wp_parse_args( (array) $instance, $defaults ); 22 | $title = $instance['title']; 23 | 24 | ?> 25 |

    26 | 27 |

    28 | 29 | 30 |

    31 | 32 |

    33 | id="get_field_id('disable_styles'); ?>" name="get_field_name('disable_styles'); ?>" /> 34 | 35 |

    36 | 60 | 61 | 66 | 67 | --------------------------------------------------------------------------------