Plugin Directory

Changeset 618456


Ignore:
Timestamp:
10/29/2012 01:39:48 AM (13 years ago)
Author:
niccolo_tapparo
Message:

version 1.2.0

Location:
wordpress-social-ring
Files:
18 added
2 deleted
7 edited

Legend:

Unmodified
Added
Removed
  • wordpress-social-ring/trunk/admin/admin.php

    r614490 r618456  
    11<?php
    22
    3 function wp_social_ring_setting_page() {
    4    
     3class WordPress_Social_Ring_Admin {
     4   
     5    private $options;
     6    private $languages = array(
     7       
     8        'Afrikaans' => array(
     9            'Facebook'  =>  'af_ZA',
     10            'Google'    =>  'af',
     11            'Twitter'   =>  'af'
     12        ),
     13        'Arabic' => array(
     14            'Facebook'  =>  'ar_AR',
     15            'Google'    =>  'ar',
     16            'Twitter'   =>  'ar'
     17        ),
     18        'Czech' => array(
     19            'Facebook'  =>  'cs_CZ',
     20            'Google'    =>  'cs',
     21            'Twitter'   =>  'cs'
     22        ),
     23        'Danish' => array(
     24            'Facebook'  =>  'da_DK',
     25            'Google'    =>  'da',
     26            'Twitter'   =>  'da'
     27        ),
     28        'Filipino' => array(
     29            'Facebook'  =>  'en_US',
     30            'Google'    =>  'en-US',
     31            'Twitter'   =>  'en'
     32        ),
     33        'Finnish' => array(
     34            'Facebook'  =>  'en_US',
     35            'Google'    =>  'en-US',
     36            'Twitter'   =>  'en'
     37        ),
     38        'French' => array(
     39            'Facebook'  =>  'fr_FR',
     40            'Google'    =>  'fr',
     41            'Twitter'   =>  'fr'
     42        ),
     43        'English' => array(
     44            'Facebook'  =>  'en_US',
     45            'Google'    =>  'en-US',
     46            'Twitter'   =>  'en'
     47        ),
     48        'German' => array(
     49            'Facebook'  =>  'de_DE',
     50            'Google'    =>  'de',
     51            'Twitter'   =>  'de'
     52        ),
     53        'Greek' => array(
     54            'Facebook'  =>  'el_GR',
     55            'Google'    =>  'el',
     56            'Twitter'   =>  'el'
     57        ),
     58        'Hebrew' => array(
     59            'Facebook'  =>  'he_IL',
     60            'Google'    =>  'he',
     61            'Twitter'   =>  'he'
     62        ), 
     63        'Hindi' => array(
     64            'Facebook'  =>  'hi_IN',
     65            'Google'    =>  'hi',
     66            'Twitter'   =>  'hi'
     67        ),
     68        'Hungarian' => array(
     69            'Facebook'  =>  'hu_HU',
     70            'Google'    =>  'hu',
     71            'Twitter'   =>  'hu'
     72        ),
     73        'Icelandic' => array(
     74            'Facebook'  =>  'is_IS',
     75            'Google'    =>  'is',
     76            'Twitter'   =>  'is'
     77        ),
     78        'Indonesian' => array(
     79            'Facebook'  =>  'id_ID',
     80            'Google'    =>  'id',
     81            'Twitter'   =>  'id'
     82        ),
     83        'Italian' => array(
     84            'Facebook'  =>  'it_IT',
     85            'Google'    =>  'it',
     86            'Twitter'   =>  'it'
     87        ),
     88        'Japanese' => array(
     89            'Facebook'  =>  'ja_JP',
     90            'Google'    =>  'ja',
     91            'Twitter'   =>  'ja'
     92        ),
     93        'Norwegian' => array(
     94            'Facebook'  =>  'nn_NO',
     95            'Google'    =>  'no',
     96            'Twitter'   =>  'no'
     97        ),
     98        'Polish' => array(
     99            'Facebook'  =>  'pl_PL',
     100            'Google'    =>  'pl',
     101            'Twitter'   =>  'pl'
     102        ),
     103        'Portuguese (Brazil)' => array(
     104            'Facebook'  =>  'pt_BR',
     105            'Google'    =>  'pt-BR',
     106            'Twitter'   =>  'pt'
     107        ),
     108        'Portuguese (Portugal)' => array(
     109            'Facebook'  =>  'pt_PT',
     110            'Google'    =>  'pt-PT',
     111            'Twitter'   =>  'pt'
     112        ),
     113        'Romanian' => array(
     114            'Facebook'  =>  'ro_RO',
     115            'Google'    =>  'ro',
     116            'Twitter'   =>  'ro'
     117        ),
     118        'Russian' => array(
     119            'Facebook'  =>  'ru_RU',
     120            'Google'    =>  'ru',
     121            'Twitter'   =>  'ru'
     122        ),
     123        'Serbian' => array(
     124            'Facebook'  =>  'sr_RS',
     125            'Google'    =>  'sr',
     126            'Twitter'   =>  'sr'
     127        ),
     128        'Slovak' => array(
     129            'Facebook'  =>  'sk_SK',
     130            'Google'    =>  'sk',
     131            'Twitter'   =>  'sk'
     132        ),
     133        'Slovenian' => array(
     134            'Facebook'  =>  'sl_SI',
     135            'Google'    =>  'sl',
     136            'Twitter'   =>  'sl'
     137        ),
     138        'Spanish' => array(
     139            'Facebook'  =>  'es_ES',
     140            'Google'    =>  'es',
     141            'Twitter'   =>  'es'
     142        ),
     143       
     144        'Swedish' => array(
     145            'Facebook'  =>  'sv_SE',
     146            'Language'  =>  'sv',
     147            'Twitter'   =>  'sv'
     148        ),
     149        'Turkish' => array(
     150            'Facebook'  =>  'tr_TR',
     151            'Google'    =>  'tr',
     152            'Twitter'   =>  'tr'
     153        ),
     154        'Ukrainian' => array(
     155            'Facebook'  =>  'uk_UA',
     156            'Google'    =>  'uk',
     157            'Twitter'   =>  'uk'
     158        )
     159    );
     160   
     161    function __construct() {
     162        $this->options = get_option(WP_SOCIAL_RING.'_options');
     163        add_action('admin_menu', array($this, 'register_option_page'));
     164        add_action('admin_init', array($this, 'register_options'));
     165    }
     166   
     167    function register_option_page() {
     168        $page = add_options_page(__('Social Sharing', WP_SOCIAL_RING), __('Social Sharing', WP_SOCIAL_RING), 'manage_options', 'wp_social_ring', array($this, 'print_option_page'));
     169        add_action('admin_print_styles-' . $page, array($this, 'equeue_admin_css_js'));
     170    }
     171   
     172    function print_option_page() {
    5173    ?>
    6    
    7174    <div class="wrap">
    8175        <?php screen_icon('plugins'); ?>
     
    11178            <div class="postbox-container" style="width:70%;">
    12179                <form action="options.php" method="post">
    13                
    14180                        <div class="postbox">
    15181                            <?php settings_fields(WP_SOCIAL_RING.'_options'); ?>
     
    39205                        </div>
    40206                        <input name="submit" class="button-primary" type="submit" value="<?php _e('Save Changes',WP_SOCIAL_RING); ?>" />
    41                
    42207                </form>
    43208            </div>
    44            
    45209            <div class="postbox-container" style="margin-left:15px;">
    46210                <div class="postbox">
     
    54218                    <h3><?php _e('News', WP_SOCIAL_RING); ?></h3>
    55219                    <ul style="list-style:circle; padding:10px 0 10px 30px;">
     220                        <li><a target="_blank" href="http://wordpress.altervista.org/wp-social-ring-1-2-0/">WordPress Social Ring 1.2.0</a></li>
    56221                        <li><a target="_blank" href="http://wordpress.altervista.org/wordpress-social-ring-1-1-9/">WordPress Social Ring 1.1.9</a></li>
    57222                        <li><a target="_blank" href="http://wordpress.altervista.org/wordpress-social-ring-1-1-2-shortcode/">WordPress Social Ring 1.1.2</a></li>
     
    80245    </div>
    81246    <?php
    82 
    83 }
    84 
    85 
    86 function add_wp_social_ring_css_js() {
    87    
    88     wp_enqueue_style( WP_SOCIAL_RING.'-style', WP_SOCIAL_RING_URL.'admin/css/style.css');
    89     wp_enqueue_script( WP_SOCIAL_RING.'_facebook_js', 'http://connect.facebook.net/'.__('en_US', WP_SOCIAL_RING).'/all.js#xfbml=1', array(), false, true);
    90     wp_enqueue_script( WP_SOCIAL_RING.'_gplus_js', 'https://apis.google.com/js/plusone.js', array(), false, true);
    91     wp_enqueue_script( WP_SOCIAL_RING.'_twitter_js', 'http://platform.twitter.com/widgets.js', array(), false, true);
    92     wp_enqueue_script( WP_SOCIAL_RING.'_pin_it_js', 'http://assets.pinterest.com/js/pinit.js', array(), false, true);
    93 }
    94 
    95 // Register and define the settings
    96 add_action('admin_init', 'wp_social_ring_admin_init');
    97 function wp_social_ring_admin_init(){
    98 
    99    
    100 
    101     register_setting(
    102         WP_SOCIAL_RING.'_options',
    103         WP_SOCIAL_RING.'_options',
    104         WP_SOCIAL_RING.'_validate_options'
    105     );
    106 
    107     add_settings_section(
    108         WP_SOCIAL_RING.'_setting_section',
    109         __('General Settings',WP_SOCIAL_RING),
    110         'wp_social_ring_social_share_explain',
    111         WP_SOCIAL_RING
    112     );
    113     add_settings_field(
    114         'wp_social_ring_social_buttons',
    115         __('Buttons',WP_SOCIAL_RING),
    116         'print_social_ring_buttons_input',
    117         WP_SOCIAL_RING,
    118         WP_SOCIAL_RING.'_setting_section'
    119     );
    120     add_settings_field(
    121         'wp_social_ring_position',
    122         __('Position',WP_SOCIAL_RING),
    123         'print_social_ring_position_input',
    124         WP_SOCIAL_RING,
    125         WP_SOCIAL_RING.'_setting_section'
    126     );
    127     add_settings_field(
    128         'wp_social_ring_show_on',
    129         __('Show on',WP_SOCIAL_RING),
    130         'print_social_ring_show_on_input',
    131         WP_SOCIAL_RING,
    132         WP_SOCIAL_RING.'_setting_section'
    133     );
    134 }
    135 
    136 function wp_social_ring_social_share_explain() {
     247    }
     248   
     249    function equeue_admin_css_js() {
     250        wp_enqueue_style( WP_SOCIAL_RING.'-style', WP_SOCIAL_RING_URL.'admin/css/style.css');
     251        wp_enqueue_script( WP_SOCIAL_RING.'_facebook_js', 'http://connect.facebook.net/'.$this->options['facebook_language'].'/all.js#xfbml=1', array(), false, true);
     252        wp_enqueue_script( WP_SOCIAL_RING.'_gplus_js', 'https://apis.google.com/js/plusone.js', array(), false, true);
     253        wp_enqueue_script( WP_SOCIAL_RING.'_twitter_js', 'http://platform.twitter.com/widgets.js', array(), false, true);
     254        wp_enqueue_script( WP_SOCIAL_RING.'_pin_it_js', 'http://assets.pinterest.com/js/pinit.js', array(), false, true);
     255        wp_enqueue_script( WP_SOCIAL_RING.'_linkedin_js', 'http://platform.linkedin.com/in.js', array(), false, true);
     256        wp_enqueue_script( WP_SOCIAL_RING.'_stumble_js', 'http://platform.stumbleupon.com/1/widgets.js', array(), false, true);
     257    }
     258
     259    function register_options(){
     260        register_setting(
     261            WP_SOCIAL_RING.'_options',
     262            WP_SOCIAL_RING.'_options',
     263            array($this, 'validate_options')
     264        );
     265        add_settings_section(
     266            WP_SOCIAL_RING.'_setting_section',
     267            __('General Settings', WP_SOCIAL_RING),
     268            array($this, 'settings_description'),
     269            WP_SOCIAL_RING
     270        );
     271        add_settings_field(
     272            'wp_social_ring_active_buttons',
     273            __('Buttons', WP_SOCIAL_RING),
     274            array($this, 'active_buttons_setting'),
     275            WP_SOCIAL_RING,
     276            WP_SOCIAL_RING.'_setting_section'
     277        );
     278        add_settings_field(
     279            'wp_social_ring_position',
     280            __('Position',WP_SOCIAL_RING),
     281            array($this, 'position_setting'),
     282            WP_SOCIAL_RING,
     283            WP_SOCIAL_RING.'_setting_section'
     284        );
     285        add_settings_field(
     286            'wp_social_ring_show_on',
     287            __('Show on', WP_SOCIAL_RING),
     288            array($this, 'show_on_setting'),
     289            WP_SOCIAL_RING,
     290            WP_SOCIAL_RING.'_setting_section'
     291        );
     292        add_settings_field(
     293            'wp_social_ring_counter',
     294            __('Counter', WP_SOCIAL_RING),
     295            array($this, 'counter_setting'),
     296            WP_SOCIAL_RING,
     297            WP_SOCIAL_RING.'_setting_section'
     298        );
     299        add_settings_field(
     300            'wp_social_ring_language',
     301            __('Buttons Language',WP_SOCIAL_RING),
     302            array($this, 'language_setting'),
     303            WP_SOCIAL_RING,
     304            WP_SOCIAL_RING.'_setting_section'
     305        );
     306    }
     307   
     308    function settings_description() {
    137309    ?>
    138         <div class="explain"><?php _e('Choose Social Ring position and behavior',WP_SOCIAL_RING); ?></div>
     310        <div class="explain"><?php _e('Choose sharing buttons position and behavior', WP_SOCIAL_RING); ?></div>
    139311    <?php
    140 }
    141 
    142 
    143 function print_social_ring_position_input() {
    144    
    145     global $wp_social_ring_options;
    146     // echo the field
     312    }
     313   
     314    function counter_setting() {
    147315    ?>
    148        
    149         <ul>
    150             <li>
    151                 <span><input id='social_before_content' name='wp_social_ring_options[social_before_content]' type='checkbox' value="1" <?php if($wp_social_ring_options['social_before_content'] == 1) echo "checked"; ?> /></span>
    152                 <span><?php _e('Before content',WP_SOCIAL_RING) ?></span>
    153             </li>
    154             <li>
    155                 <span><input id='social_after_content' name='wp_social_ring_options[social_after_content]' type='checkbox' value="1" <?php if($wp_social_ring_options['social_after_content'] == 1) echo "checked"; ?> /></span>
    156                 <span><?php _e('After content',WP_SOCIAL_RING) ?></span>
    157             </li>
    158         </ul>
    159 
     316        <span>
     317            <input id="horizontal" type="radio" name="wp_social_ring_options[button_counter]" value="horizontal" <?php checked($this->options['button_counter'], 'horizontal') ?>/>
     318            <label for="horizontal"><?php _e('Horizontal', WP_SOCIAL_RING); ?></label>
     319        </span>
     320        <span style="padding-left:30px;">
     321            <input id="vertical" type="radio" name="wp_social_ring_options[button_counter]" value="vertical" <?php checked($this->options['button_counter'], 'vertical') ?>/>
     322            <label for="vertical"><?php _e('Vertical', WP_SOCIAL_RING); ?></label>
     323        </span>
     324        <span style="padding-left:30px;">
     325            <input id="none" type="radio" name="wp_social_ring_options[button_counter]" value="none" <?php checked($this->options['button_counter'], 'none') ?>/>
     326            <label for="none"><?php _e('None', WP_SOCIAL_RING); ?></label>
     327        </span>
    160328    <?php
    161 }
    162 
    163 function print_social_ring_buttons_input() {
    164    
    165     global $wp_social_ring_options;
    166     // echo the field
     329    }
     330   
     331    function position_setting() {
     332        ?>
     333            <ul>
     334                <li>
     335                    <span><input id='social_before_content' name='wp_social_ring_options[social_before_content]' type='checkbox' value="1" <?php if($this->options['social_before_content'] == 1) echo "checked"; ?> /></span>
     336                    <span><?php _e('Before content',WP_SOCIAL_RING) ?></span>
     337                </li>
     338                <li>
     339                    <span><input id='social_after_content' name='wp_social_ring_options[social_after_content]' type='checkbox' value="1" <?php if($this->options['social_after_content'] == 1) echo "checked"; ?> /></span>
     340                    <span><?php _e('After content',WP_SOCIAL_RING) ?></span>
     341                </li>
     342            </ul>
     343        <?php
     344    }
     345   
     346    function active_buttons_setting() {
    167347    ?>
    168348        <ul>
    169349            <li style="clear:both;">
    170                 <div style="float:left;"><input id='social_facebook_like_button' name='wp_social_ring_options[social_facebook_like_button]' type='checkbox' value="1" <?php checked($wp_social_ring_options['social_facebook_like_button'], 1); ?> /></div>
     350                <div style="float:left;"><input id='social_facebook_like_button' name='wp_social_ring_options[social_facebook_like_button]' type='checkbox' value="1" <?php checked($this->options['social_facebook_like_button'], 1); ?> /></div>
    171351                <div style="float:left;margin-left:20px;width:150px;"><?php _e('Facebook Like',WP_SOCIAL_RING) ?></div>
    172352                <div style="float:left;margin-left:20px;"><fb:like href="http://www.facebook.com/pages/DrWordPress/166397626712895" send="false" showfaces="false" width="108" layout="button_count" action="like"/></fb:like></div>
    173353            </li>
    174354            <li style="clear:both;padding-top:10px;">
    175                 <div style="float:left;"><input id='social_facebook_send_button' name='wp_social_ring_options[social_facebook_send_button]' type='checkbox' value="1" <?php checked($wp_social_ring_options['social_facebook_send_button'], 1); ?> /></div>
     355                <div style="float:left;"><input id='social_facebook_send_button' name='wp_social_ring_options[social_facebook_send_button]' type='checkbox' value="1" <?php checked($this->options['social_facebook_send_button'], 1); ?> /></div>
    176356                <div style="float:left;margin-left:20px;width:150px;"><?php _e('Facebook Send',WP_SOCIAL_RING) ?></div>
    177357                <div style="float:left;margin-left:20px;"><fb:like href="http://www.facebook.com/pages/DrWordPress/166397626712895" send="true" showfaces="false" width="164" layout="button_count" action="like"/></fb:like></div>
     
    179359            </li>
    180360            <li style="clear:both;padding-top:10px;">
    181                 <div style="float:left;"><input id='social_facebook_share_button' name='wp_social_ring_options[social_facebook_share_button]' type='checkbox' value="1" <?php checked($wp_social_ring_options['social_facebook_share_button'], 1); ?> /></div>
     361                <div style="float:left;"><input id='social_facebook_share_button' name='wp_social_ring_options[social_facebook_share_button]' type='checkbox' value="1" <?php checked($this->options['social_facebook_share_button'], 1); ?> /></div>
    182362                <div style="float:left;margin-left:20px;width:150px;"><?php _e('Facebook Share',WP_SOCIAL_RING) ?></div>
    183                 <div style="float:left;margin-left:20px;"><iframe allowtransparency="true" frameborder="0" hspace="0" marginheight="0" marginwidth="0" scrolling="no" style="width: 58px; height: 21px; position: static; left: 0px; top: 0px; visibility: visible; " tabindex="-1" vspace="0" width="100%" src="<?php echo WP_SOCIAL_RING_URL; ?>includes/share.php?url=<?php echo urlencode('http://wordpress.altervista.org/'); ?>"></iframe></div>
    184             </li>
    185             <li style="clear:both;padding-top:10px;">
    186                 <div style="float:left;"><input id='social_twitter_button' name='wp_social_ring_options[social_twitter_button]' type='checkbox' value="1" <?php checked($wp_social_ring_options['social_twitter_button'], 1); ?> /></div>
     363                <div style="float:left;margin-left:20px;"><fb:share-button expr:href="http://wordpress.altervista.org/" width="140" type="button_count"></fb:share></div>
     364            </li>
     365            <li style="clear:both;padding-top:10px;">
     366                <div style="float:left;"><input id='social_twitter_button' name='wp_social_ring_options[social_twitter_button]' type='checkbox' value="1" <?php checked($this->options['social_twitter_button'], 1); ?> /></div>
    187367                <div style="float:left;margin-left:20px;width:150px;"><?php _e('Twitter',WP_SOCIAL_RING) ?></div>
    188                 <div style="float:left;margin-left:20px;"><a href="http://twitter.com/share" data-url="<?php echo site_url(); ?>" data-text="<?php _e('I use WordPress Social Ring on my blog', WP_SOCIAL_RING); ?>" data-via="dottorwordpress" data-count="horizontal" class="sr-twitter-button twitter-share-button"></a></div>
    189             </li>
    190             <li style="clear:both;padding-top:10px;">
    191                 <div style="float:left;"><input id='social_google_button' name='wp_social_ring_options[social_google_button]' type='checkbox' value="1" <?php checked($wp_social_ring_options['social_google_button'], 1); ?> /></div>
     368                <div style="float:left;margin-left:20px;"><a href="http://twitter.com/share" lang="<?php echo $this->options['twitter_language']; ?>" data-url="<?php echo site_url(); ?>" data-text="<?php _e('I use WordPress Social Ring on my blog', WP_SOCIAL_RING); ?>" data-via="dottorwordpress" data-count="horizontal" class="sr-twitter-button twitter-share-button"></a></div>
     369            </li>
     370            <li style="clear:both;padding-top:10px;">
     371                <div style="float:left;"><input id='social_google_button' name='wp_social_ring_options[social_google_button]' type='checkbox' value="1" <?php checked($this->options['social_google_button'], 1); ?> /></div>
    192372                <div style="float:left;margin-left:20px;width:150px;"><?php _e('Google +1',WP_SOCIAL_RING) ?></div>
    193373                <div style="float:left;margin-left:20px;"><g:plusone href="<?php _e('http://wordpress.altervista.org/', WP_SOCIAL_RING); ?>" size="medium" callback="plusone_vote"></g:plusone></div>
     374                <script type="text/javascript">
     375                    window.___gcfg = {
     376                      lang: '<?php echo $this->options['google_language']; ?>'
     377                    };
     378                </script>
    194379            </li>
    195380           
    196381            <li style="clear:both;padding-top:10px;">
    197                 <div style="float:left;"><input id='social_linkedin_button' name='wp_social_ring_options[social_linkedin_button]' type='checkbox' value="1" <?php checked($wp_social_ring_options['social_linkedin_button'], 1); ?> /></div>
     382                <div style="float:left;"><input id='social_linkedin_button' name='wp_social_ring_options[social_linkedin_button]' type='checkbox' value="1" <?php checked($this->options['social_linkedin_button'], 1); ?> /></div>
    198383                <div style="float:left;margin-left:20px;width:150px;"><?php _e('LinkedIn',WP_SOCIAL_RING) ?></div>
    199                 <div style="float:left;margin-left:20px;"><div class="social-ring-button"><script src="//platform.linkedin.com/in.js" type="text/javascript"></script><script type="IN/Share" data-url="http://wordpress.altervista.org/" data-counter="right"></script></div>
     384                <div style="float:left;margin-left:20px;"><div class="social-ring-button"><script type="IN/Share" data-url="http://wordpress.altervista.org/" data-counter="right"></script></div>
    200385            </li>
    201386           
    202387            <li style="clear:both;padding-top:10px;">
    203                 <div style="float:left;"><input id='social_pin_it_button' name='wp_social_ring_options[social_pin_it_button]' type='checkbox' value="1" <?php checked($wp_social_ring_options['social_pin_it_button'], 1); ?> /></div>
     388                <div style="float:left;"><input id='social_pin_it_button' name='wp_social_ring_options[social_pin_it_button]' type='checkbox' value="1" <?php checked($this->options['social_pin_it_button'], 1); ?> /></div>
    204389                <div style="float:left;margin-left:20px;width:150px;"><?php _e('Pin it',WP_SOCIAL_RING) ?></div>
    205390                <div style="float:left;margin-left:20px;"><a href="http://pinterest.com/pin/create/button/?url=<?php echo urlencode(__('http://wordpress.altervista.org/', WP_SOCIAL_RING)); ?>&media=<?php echo urlencode('http://wordpress.altervista.org/logo.jpg'); ?>&description=<?php echo urlencode(__('WordPress tutorials, plugin and themes.', WP_SOCIAL_RING)." ".site_url()); ?>" class="pin-it-button" count-layout="horizontal"></a></div>
    206391            </li>
     392            <li style="clear:both;padding-top:10px;">
     393                <div style="float:left;"><input id='social_stumble_button' name='wp_social_ring_options[social_stumble_button]' type='checkbox' value="1" <?php checked($this->options['social_stumble_button'], 1); ?> /></div>
     394                <div style="float:left;margin-left:20px;width:150px;"><?php _e('StumbleUpon',WP_SOCIAL_RING) ?></div>
     395                <div style="float:left;margin-left:20px;"><su:badge layout="1"></su:badge></div>
     396            </li>
    207397        </ul>
    208398    <?php
    209 }
    210 
    211 function print_social_ring_show_on_input() {
    212    
    213     global $wp_social_ring_options;
    214     // echo the field
    215 
     399    }
     400   
     401    function show_on_setting() {
    216402    ?>
    217 
    218403        <ul>
    219404            <li>
    220                 <span><input id='social_on_home' name='wp_social_ring_options[social_on_home]' type='checkbox' value="1" <?php checked($wp_social_ring_options['social_on_home'], 1); ?> /></span>
     405                <span><input id='social_on_home' name='wp_social_ring_options[social_on_home]' type='checkbox' value="1" <?php checked($this->options['social_on_home'], 1); ?> /></span>
    221406                <span><?php _e('Home',WP_SOCIAL_RING) ?></span>
    222407            </li>
    223408            <li>
    224                 <span><input id='social_on_pages' name='wp_social_ring_options[social_on_pages]' type='checkbox' value="1" <?php checked($wp_social_ring_options['social_on_pages'], 1); ?> /></span>
     409                <span><input id='social_on_pages' name='wp_social_ring_options[social_on_pages]' type='checkbox' value="1" <?php checked($this->options['social_on_pages'], 1); ?> /></span>
    225410                <span><?php _e('Pages',WP_SOCIAL_RING) ?></span>
    226411            </li>
    227412            <li>
    228                 <span><input id='social_on_posts' name='wp_social_ring_options[social_on_posts]' type='checkbox' value="1" <?php checked($wp_social_ring_options['social_on_posts'], 1); ?> /></span>
     413                <span><input id='social_on_posts' name='wp_social_ring_options[social_on_posts]' type='checkbox' value="1" <?php checked($this->options['social_on_posts'], 1); ?> /></span>
    229414                <span><?php _e('Posts',WP_SOCIAL_RING) ?></span>
    230415            </li>
    231416            <li>
    232                 <span><input id='social_on_category' name='wp_social_ring_options[social_on_category]' type='checkbox' value="1" <?php checked($wp_social_ring_options['social_on_category'], 1); ?> /></span>
     417                <span><input id='social_on_category' name='wp_social_ring_options[social_on_category]' type='checkbox' value="1" <?php checked($this->options['social_on_category'], 1); ?> /></span>
    233418                <span><?php _e('Categories',WP_SOCIAL_RING) ?></span>
    234419            </li>
    235420            <li>
    236                 <span><input id='social_on_archive' name='wp_social_ring_options[social_on_archive]' type='checkbox' value="1" <?php checked($wp_social_ring_options['social_on_archive'], 1); ?> /></span>
     421                <span><input id='social_on_archive' name='wp_social_ring_options[social_on_archive]' type='checkbox' value="1" <?php checked($this->options['social_on_archive'], 1); ?> /></span>
    237422                <span><?php _e('Archive',WP_SOCIAL_RING) ?></span>
    238423            </li>
    239424        </ul>
    240 
    241425    <?php
     426    }
     427   
     428    function language_setting() {
     429        ?>
     430        <select id="language" name="wp_social_ring_options[language]">
     431        <?php foreach ($this->languages as $lang => $codes) { ?>
     432            <option value="<?php echo $lang; ?>" <?php selected($this->options['language'], $lang); ?>><?php echo $lang; ?></option>
     433        <?php } ?>
     434        </select>
     435        * <?php _e('LinkedIn, Pin It and StumbleUpon don\'t support localization', WP_SOCIAL_RING); ?>
     436        <?php
     437    }
     438
     439    function validate_options( $input ) {
     440        $valid['social_facebook_like_button'] = (isset( $input['social_facebook_like_button'])) ? 1 : 0;
     441        $valid['social_facebook_send_button'] = (isset( $input['social_facebook_send_button'])) ? 1 : 0;
     442        if($valid['social_facebook_send_button'] == 1) {
     443            $valid['social_facebook_like_button'] = 1;
     444        }
     445        $valid['social_facebook_share_button'] = (isset( $input['social_facebook_share_button'])) ? 1 : 0;
     446        $valid['social_twitter_button'] = (isset( $input['social_twitter_button'])) ? 1 : 0;
     447        $valid['social_google_button'] = (isset( $input['social_google_button'])) ? 1 : 0;
     448        $valid['social_pin_it_button'] = (isset( $input['social_pin_it_button'])) ? 1 : 0;
     449        $valid['social_linkedin_button'] = (isset( $input['social_linkedin_button'])) ? 1 : 0;
     450        $valid['social_stumble_button'] = (isset( $input['social_stumble_button'])) ? 1 : 0;
     451        $valid['social_on_home'] = (isset( $input['social_on_home'])) ? 1 : 0;
     452        $valid['social_on_pages'] = (isset( $input['social_on_pages'])) ? 1 : 0;
     453        $valid['social_on_posts'] = (isset( $input['social_on_posts'])) ? 1 : 0;
     454        $valid['social_on_category'] = (isset( $input['social_on_category'])) ? 1 : 0;
     455        $valid['social_on_archive'] = (isset( $input['social_on_archive'])) ? 1 : 0;
     456        $valid['social_before_content'] = (isset( $input['social_before_content'])) ? 1 : 0;
     457        $valid['button_counter'] = ($input['button_counter'] == 'vertical') || ($input['button_counter'] == 'none') ? $input['button_counter'] : 'horizontal';
     458        if(isset($this->languages[$input['language']])) {
     459            $valid['language'] = $input['language'];
     460            $valid['facebook_language'] = $this->languages[$input['language']]['Facebook'];
     461            $valid['google_language'] = $this->languages[$input['language']]['Google'];
     462            $valid['twitter_language'] = $this->languages[$input['language']]['Twitter'];
     463        }
     464        return $valid;
     465    }
     466
    242467}
    243468
    244 
    245 // Validate user input (we want text only)
    246 function wp_social_ring_validate_options( $input ) {
    247    
    248     global $wp_social_ring_options;
    249    
    250     //social
    251     $valid['social_facebook_like_button'] = (isset( $input['social_facebook_like_button'])) ? 1 : 0;
    252     $valid['social_facebook_send_button'] = (isset( $input['social_facebook_send_button'])) ? 1 : 0;
    253     if($valid['social_facebook_send_button'] == 1) {
    254         $valid['social_facebook_like_button'] = 1;
    255     }
    256     $valid['social_facebook_share_button'] = (isset( $input['social_facebook_share_button'])) ? 1 : 0;
    257     $valid['social_twitter_button'] = (isset( $input['social_twitter_button'])) ? 1 : 0;
    258     $valid['social_google_button'] = (isset( $input['social_google_button'])) ? 1 : 0;
    259     $valid['social_pin_it_button'] = (isset( $input['social_pin_it_button'])) ? 1 : 0;
    260     $valid['social_linkedin_button'] = (isset( $input['social_linkedin_button'])) ? 1 : 0;
    261     $valid['social_on_home'] = (isset( $input['social_on_home'])) ? 1 : 0;
    262     $valid['social_on_pages'] = (isset( $input['social_on_pages'])) ? 1 : 0;
    263     $valid['social_on_posts'] = (isset( $input['social_on_posts'])) ? 1 : 0;
    264     $valid['social_on_category'] = (isset( $input['social_on_category'])) ? 1 : 0;
    265     $valid['social_on_archive'] = (isset( $input['social_on_archive'])) ? 1 : 0;
    266     $valid['social_before_content'] = (isset( $input['social_before_content'])) ? 1 : 0;
    267     $valid['social_after_content'] = (isset( $input['social_after_content'])) ? 1 : 0;
    268    
    269     return $valid;
    270 }
    271 
    272 add_action('admin_menu', 'register_social_ring_admin_menu');
    273 function register_social_ring_admin_menu() {
    274    
    275     $page = add_options_page(__('Social Network', WP_SOCIAL_RING), __('Social Network', WP_SOCIAL_RING), 'manage_options', 'wp_social_ring', 'wp_social_ring_setting_page');
    276     add_action('admin_print_styles-' . $page, 'add_wp_social_ring_css_js');
    277 
    278 }
     469new WordPress_Social_Ring_Admin();
    279470
    280471?>
  • wordpress-social-ring/trunk/includes/library.php

    r614490 r618456  
    11<?php
    22
    3 function social_ring_get_first_image() {
    4  
    5     global $post, $posts;
    6  
    7     if ( function_exists('has_post_thumbnail') && has_post_thumbnail( $post->ID ) ) {
    8        
    9         $thumbnail = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), 'post-thumbnail' );
    10         if ( $thumbnail )
    11             $image = $thumbnail[0];
    12            
    13     // If that's not there, grab the first attached image
    14     } else {
    15        
    16         $files = get_children(
    17             array(
    18             'post_parent' => $post->ID,
    19             'post_type' => 'attachment',
    20             'post_mime_type' => 'image',
    21             )
    22         );
    23         if ( $files ) {
    24             $keys = array_reverse( array_keys( $files ) );
    25             $image = image_downsize( $keys[0], 'thumbnail' );
    26             $image = $image[0];
    27         }
    28     }
    29     //if there's no attached image, try to grab first image in content
    30     if(empty($image)) {
    31         ob_start();
    32         ob_end_clean();
    33         $output = preg_match_all('/<img.+src=[\'"]([^\'"]+)[\'"].*>/i',
    34              $post->post_content, $matches);
    35         if(!empty($matches[1][0])) {
    36               $image = $matches[1][0];
    37         }
    38     }
    39 
    40     return $image;
    41 }
    42 
    43 function social_ring_add_css() {
    44 
    45     global $wp_social_ring_options;
    46 ?>
    47 
     3
     4class WordPress_Social_Ring {
     5   
     6    private $options;
     7    private $post_url;
     8    private $post_encoded_url;
     9    private $post_title;
     10    private $post_encoded_title;
     11   
     12    function __construct() {
     13        $this->options = get_option(WP_SOCIAL_RING.'_options');
     14        add_action('wp_head', array($this, 'frontend_css'));
     15        add_filter('the_content', array($this, 'add_sharing_buttons'));
     16        add_action('wp_footer', array($this, 'add_footer_js'));
     17        add_shortcode('socialring', array($this, 'shortcode'));
     18    }
     19   
     20    function add_sharing_buttons($content) {
     21        if($this->print_check() == 1 && ($this->options['social_before_content'] == 1 || $this->options['social_after_content'] == 1)) {
     22            $html = $this->buttons_html();
     23            if($this->options['social_before_content'] == 1) {
     24                $content = $html.$content;
     25            }
     26            if($this->options['social_after_content'] == 1) {
     27                $content = $content.$html;
     28            }   
     29        }
     30        return $content;
     31    }
     32   
     33    function frontend_css() {
     34    ?>
    4835        <style type="text/css">
    49        
    5036            .social-ring:after {
    5137                clear: both;
     
    5743                visibility: hidden;
    5844                width: 0;
    59             }
    60            
     45            }   
    6146            .social-ring {
    6247                margin: 0 !important;
     
    6651                font-size: 11px;
    6752            }
    68            
    6953            .social-ring-button {
    7054                float: left !important;
     55                <?php if($this->options['button_counter'] == 'vertical') { ?>
     56                height: 60px;   
     57                <?php } else { ?>
    7158                height: 30px;
     59                <?php } ?>
    7260                margin: 0 5px 0 0 !important;
    7361                padding: 0 !important;
    7462            }
    75            
    7663        </style>
    77 
    78 <?php
     64    <?php
     65    }
     66   
     67    function buttons_html() {
     68        global $post;
     69        $this->post_url = (string) get_permalink($post->ID);
     70        $this->post_encoded_url = (string) urlencode($this->post_url);
     71        $this->post_title =  (string) $post->post_title;
     72        $this->post_encoded_title = (string) urlencode(esc_attr(strip_tags(stripslashes($post->post_title))));
     73        $html = '<!-- Social Ring Buttons Start --><div class="social-ring">'."\n";
     74        if($this->options['social_twitter_button'] == 1) {
     75            $html .= $this->button_before();
     76            $html .= $this->twitter_html();
     77            $html .= $this->button_after();
     78        }
     79        if($this->options['social_google_button'] == 1) {
     80            $html .= $this->button_before();
     81            $html .= $this->google_plus_one_html();
     82            $html .= $this->button_after();
     83        }
     84        if($this->options['social_facebook_share_button'] == 1) {
     85            $html .= $this->button_before();
     86            $html .= $this->facebook_share_html();
     87            $html .= $this->button_after();
     88        }
     89        if($this->options['social_facebook_like_button'] == 1) {
     90            $html .= $this->button_before();
     91            $html .= $this->facebook_like_html();
     92            $html .= $this->button_after();
     93        }
     94        if($this->options['social_pin_it_button'] == 1) {
     95            $html .= $this->button_before();
     96            $html .= $this->pin_it_html();
     97            $html .= $this->button_after();
     98        }
     99        if($this->options['social_linkedin_button'] == 1) {
     100            $html .= $this->button_before();
     101            $html .= $this->linkedin_html();
     102            $html .= $this->button_after();
     103        }
     104        if($this->options['social_stumble_button'] == 1) {
     105            $html .= $this->button_before();
     106            $html .= $this->stumple_upon_html();
     107            $html .= $this->button_after();
     108        }
     109        $html .= '</div>';
     110        $html .= '<div style="clear:both;">&nbsp;</div><!-- Social Ring Buttons End -->'."\n";
     111        return $html;
     112       
     113    }
     114   
     115    function button_before() {
     116        return '<div class="social-ring-button">';
     117    }
     118   
     119    function button_after() {
     120        return "</div>\n";
     121    }
     122   
     123    function twitter_html() {
     124        $twitter_html = '<a href="http://twitter.com/share" lang="'.$this->options['twitter_language'].'" data-url="'.$this->post_url.'" data-text="'.$this->post_title.'" ';
     125        if($this->options['button_counter'] == "horizontal") {
     126            $twitter_html .= 'data-count="horizontal"';
     127        } elseif($this->options['button_counter'] == "vertical") {
     128            $twitter_html .= 'data-count="vertical"';
     129        } elseif($this->options['button_counter'] == "none") {
     130            $twitter_html .= 'data-count="none"';
     131        }
     132        $twitter_html .= ' class="sr-twitter-button twitter-share-button"></a>';
     133        return $twitter_html;
     134    }
     135   
     136    function google_plus_one_html() {
     137        $google_html = '<div class="g-plusone" ';
     138        if($this->options['button_counter'] == "horizontal") {
     139            $google_html .= 'data-size="medium" ';
     140        } elseif($this->options['button_counter'] == "vertical") {
     141            $google_html .= 'data-size="tall" ';
     142        } elseif($this->options['button_counter'] == "none") {
     143            $google_html .= 'data-size="medium" data-annotation="none" ';
     144        }
     145        $google_html .= '></div>';
     146        return $google_html;
     147    }
     148   
     149    function facebook_share_html() {
     150        $fb_share_html = '<fb:share-button expr:href="'.$this->post_url.'" width="140" ';
     151        if($this->options['button_counter'] == "horizontal") {
     152            $fb_share_html .= 'type="button_count"';
     153        } elseif($this->options['button_counter'] == "vertical") {
     154            $fb_share_html .= 'type="box_count"';
     155        } elseif($this->options['button_counter'] == "none") {
     156            $fb_share_html .= 'type="button"';
     157        }
     158        $fb_share_html .= '></fb:share>';
     159        return $fb_share_html;
     160    }
     161   
     162    function facebook_like_html() {
     163        if($this->options['social_facebook_send_button'] == 1) {
     164            $send = 'true';
     165            $width = 180;
     166        } else {
     167            $send = 'false';
     168            $width = 140;
     169        }
     170        $fb_like_html = '<fb:like href="'.$this->post_url.'" width="'.$width.'" send="'.$send.'" showfaces="false" ';
     171        if($this->options['button_counter'] == "vertical") {
     172            $fb_like_html .= 'layout="box_count"';
     173        } else {
     174            $fb_like_html .= 'layout="button_count"';
     175        }
     176        $fb_like_html .= ' action="like"></fb:like>';
     177        return $fb_like_html;
     178    }
     179   
     180    function pin_it_html() {
     181        $pin_it_html = '<a href="http://pinterest.com/pin/create/button/?url='.$this->post_encoded_url;
     182        $image = $this->get_first_image();
     183        if($image > '') {
     184            $pin_it_html .= '&media='.urlencode($image);
     185        }
     186        $pin_it_html .= '&description='.$this->post_encoded_title.'" class="pin-it-button"';
     187        if($this->options['button_counter'] == "horizontal") {
     188            $pin_it_html .= 'count-layout="horizontal"';
     189        } elseif($this->options['button_counter'] == "vertical") {
     190            $pin_it_html .= 'count-layout="vertical"';
     191        } elseif($this->options['button_counter'] == "none") {
     192            $pin_it_html .= 'count-layout="none"';
     193        }
     194        $pin_it_html .='></a>';
     195        return $pin_it_html;
     196    }
     197   
     198    function linkedin_html() {
     199        $linkedin_html = '<script src="//platform.linkedin.com/in.js" type="text/javascript"></script><script type="IN/Share" data-url="'.$this->post_encoded_url.'" ';
     200        if($this->options['button_counter'] == "horizontal") {
     201            $linkedin_html .= 'data-counter="right" ';
     202        } elseif($this->options['button_counter'] == "vertical") {
     203            $linkedin_html .= 'data-counter="top" ';
     204        } elseif($this->options['button_counter'] == "none") {
     205            //no data-size attribute
     206        }
     207        $linkedin_html .=  '></script>';
     208        return $linkedin_html;
     209    }
     210   
     211    function stumple_upon_html() {
     212       
     213        $stumble_upon_html = '<su:badge ';
     214        if($this->options['button_counter'] == "horizontal") {
     215            $stumble_upon_html .= 'layout="1"';
     216        } elseif($this->options['button_counter'] == "vertical") {
     217            $stumble_upon_html .= 'layout="5"';
     218        } elseif($this->options['button_counter'] == "none") {
     219            $stumble_upon_html .= 'layout="4"';
     220        }
     221        $stumble_upon_html .= '></su:badge>';
     222        return $stumble_upon_html;
     223    }
     224   
     225    function get_first_image() {
     226        global $post;
     227        //check if post has thumbnail
     228        if ( function_exists('has_post_thumbnail') && has_post_thumbnail( $post->ID ) ) {
     229            $thumbnail = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), 'full' );
     230            if ( $thumbnail )
     231                $image = $thumbnail[0];
     232        //check if pots has image attachments
     233        } else {
     234            $files = get_children(
     235                array(
     236                'post_parent' => $post->ID,
     237                'post_type' => 'attachment',
     238                'post_mime_type' => 'image',
     239                )
     240            );
     241            if ( $files ) {
     242                $keys = array_reverse( array_keys( $files ) );
     243                $image = image_downsize( $keys[0], 'thumbnail' );
     244                $image = $image[0];
     245            }
     246        }
     247        //if there's no attached image, try to grab first image in content
     248        if(empty($image)) {
     249            ob_start();
     250            ob_end_clean();
     251            $output = preg_match_all('/<img.+src=[\'"]([^\'"]+)[\'"].*>/i',
     252                 $post->post_content, $matches);
     253            if(!empty($matches[1][0])) {
     254                  $image = $matches[1][0];
     255            }
     256        }
     257
     258        return $image;
     259    }
     260   
     261    /*
     262    function social_ring_shortcode() returns the code for
     263    [socialring] shortcode
     264        */
     265    function shortcode() {
     266        return $this->buttons_html();   
     267    }
     268   
     269    function add_footer_js() {
     270    ?>
     271        <!-- Social Ring JS Start -->
     272    <div id="fb-root"></div><script src="http://connect.facebook.net/<?php echo $this->options['facebook_language']; ?>/all.js#xfbml=1"></script>
     273    <script type="text/javascript">
     274        window.___gcfg = {
     275          lang: '<?php echo $this->options['google_language']; ?>'
     276        };
     277        (function() {
     278            var po = document.createElement('script'); po.type = 'text/javascript'; po.async = true;
     279            po.src = 'https://apis.google.com/js/plusone.js';
     280            var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(po, s);
     281        })();
     282    </script>
     283    <script type='text/javascript' src='https://apis.google.com/js/plusone.js'></script>
     284    <script type='text/javascript' src='http://platform.twitter.com/widgets.js'></script>
     285        <script type="text/javascript" src="http://assets.pinterest.com/js/pinit.js"></script>
     286    <script type="text/javascript">
     287        (function() {
     288          var li = document.createElement('script'); li.type = 'text/javascript'; li.async = true;
     289          li.src = ('https:' == document.location.protocol ? 'https:' : 'http:') + '//platform.stumbleupon.com/1/widgets.js';
     290          var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(li, s);
     291        })();
     292    </script>
     293        <!-- Social Ring JS End -->
     294    <?php
     295    }
     296   
     297    function print_check() {
     298        if(is_single() && get_post_type() == "post") {
     299            return $this->options['social_on_posts'];
     300        }
     301        if(is_page() && get_post_type() == "page") {
     302            return $this->options['social_on_pages'];
     303        }
     304        if(is_home()) {
     305            return $this->options['social_on_home'];
     306        }
     307        if(is_category()) {
     308            return $this->options['social_on_category'];
     309        }
     310        if(is_archive()) {
     311            return $this->options['social_on_archive'];
     312        }
     313        return 0;
     314    }
     315   
    79316}
    80317
     
    85322function social_ring_show() {
    86323
    87     $html = social_ring_gen_button_code() ;
    88     echo $html;
     324    $wp_social = new WordPress_Social_Ring();
     325    echo $wp_social->buttons_html();
    89326    return;
    90327   
    91328}
    92329
    93 /*
    94  function social_ring_shortcode() returns the code for
    95  [socialring] shortcode
    96 */
    97 function social_ring_shortcode() {
    98    
    99     return social_ring_gen_button_code();
    100    
    101 }
    102 
    103 
    104 /*
    105   function social_ring_gen_button_code() generates
    106   HTML code of social buttons
    107 */
    108 function social_ring_gen_button_code() {
    109    
    110     global $wp_social_ring_options;
    111    
    112     $url = get_permalink(get_the_ID());
    113     $title = get_the_title(get_the_ID());
    114     $html = '<!-- Social Ring Buttons Start --><div class="social-ring">';
    115 
    116     if($wp_social_ring_options['social_twitter_button'] == 1) {
    117         $html .= '<div class="social-ring-button"><a href="http://twitter.com/share" data-url="'.$url.'" data-text="'.$title.'" data-count="horizontal" class="sr-twitter-button twitter-share-button"></a></div>';
    118     }
    119    
    120     if($wp_social_ring_options['social_google_button'] == 1) {
    121         $html .= '<div class="social-ring-button"><g:plusone size="medium" callback="plusone_vote"></g:plusone></div>';
    122     }
    123    
    124     if($wp_social_ring_options['social_facebook_share_button'] == 1) {
    125         $html .= '<div class="social-ring-button"><iframe allowtransparency="true" frameborder="0" hspace="0" marginheight="0" marginwidth="0" scrolling="no" style="width: 70px; height: 21px; position: static; left: 0px; top: 0px; visibility: visible; " tabindex="-1" vspace="0" width="100%" src="'.WP_SOCIAL_RING_URL.'/includes/share.php?url='.urlencode($url).'"></iframe></div>';   
    126     }
    127     if($wp_social_ring_options['social_facebook_like_button'] == 1) {
    128         if(!preg_match("/MSIE 8.0/", $_SERVER['HTTP_USER_AGENT']) ) {
    129             if($wp_social_ring_options['social_facebook_send_button'] == 1) {
    130                 $send = 'true';
    131                 $width = 180;
    132             } else {
    133                 $send = 'false';
    134                 $width = 140;
    135             }
    136             $html .= '<div class="social-ring-button"><fb:like href="'.$url.'" width="'.$width.'" send="'.$send.'" showfaces="false" layout="button_count" action="like"/></fb:like></div>';
    137         } else {
    138             $html .= '<div class="social-ring-button"><iframe src="http://www.facebook.com/plugins/like.php?app_id=131347983616840&amp;href='.urlencode($url).'&amp;send=false&amp;layout=button_count&amp;width=75&amp;show_faces=false&amp;action=like&amp;colorscheme=light&amp;font&amp;height=21" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:110px; height:21px;" allowTransparency="true"></iframe></div>';
    139         }
    140     }
    141 
    142     if($wp_social_ring_options['social_pin_it_button'] == 1) {
    143         $html .= '<div class="social-ring-button"><a href="http://pinterest.com/pin/create/button/?url='.urlencode($url);
    144         $image = social_ring_get_first_image();
    145         if($image > '') {
    146             $html .= '&media='.urlencode($image);
    147         }
    148         $html .= '&description='.urlencode(esc_attr( strip_tags( stripslashes($title)))).'" class="pin-it-button" count-layout="horizontal"></a></div>';
    149     }
    150    
    151     if($wp_social_ring_options['social_linkedin_button'] == 1) {
    152         $html .= '<div class="social-ring-button"><script src="//platform.linkedin.com/in.js" type="text/javascript"></script><script type="IN/Share" data-url="'.$url.'" data-counter="right"></script></div>';
    153     }
    154 
    155     $html .= '</div>';
    156     $html .= '<div style="clear:both;">&nbsp;</div><!-- Social Ring Buttons End -->';
    157     return $html;
    158    
    159 }
    160 
    161 function social_ring_add_sharing($content) {
    162 
    163     global $wp_social_ring_options;
    164 
    165     if(social_ring_print_check() == 1 && ($wp_social_ring_options['social_before_content'] == 1 || $wp_social_ring_options['social_after_content'] == 1)) {
    166    
    167         $html = social_ring_gen_button_code();
    168        
    169         if($wp_social_ring_options['social_before_content'] == 1) {
    170             $content = $html.$content;
    171         }
    172         if($wp_social_ring_options['social_after_content'] == 1) {
    173             $content = $content.$html;
    174         }
    175        
    176     }
    177    
    178     return $content;
    179 }
    180 
    181 function social_ring_add_js() {
    182    
    183     ?>
    184         <!-- Social Ring JS Start -->
    185     <div id="fb-root"></div><script src="http://connect.facebook.net/<?php _e('en_US', WP_SOCIAL_RING); ?>/all.js#xfbml=1"></script>
    186     <script type='text/javascript' src='https://apis.google.com/js/plusone.js'></script>
    187     <script type='text/javascript' src='http://platform.twitter.com/widgets.js'></script>
    188         <script type="text/javascript" src="http://assets.pinterest.com/js/pinit.js"></script>
    189         <!-- Social Ring JS End -->
    190 <?php
    191 }
    192 
    193 function social_ring_print_check() {
    194 
    195     global $wp_social_ring_options;
    196    
    197     if(is_single() && get_post_type() == "post") {
    198         return $wp_social_ring_options['social_on_posts'];
    199     }
    200     if(is_page() && get_post_type() == "page") {
    201         return $wp_social_ring_options['social_on_pages'];
    202     }
    203     if(is_home()) {
    204         return $wp_social_ring_options['social_on_home'];
    205     }
    206     if(is_category()) {
    207         return $wp_social_ring_options['social_on_category'];
    208     }
    209     if(is_archive()) {
    210         return $wp_social_ring_options['social_on_archive'];
    211     }
    212     return 0;
    213 
    214 }
    215 
    216 /* Code from Simple Facebook Connect by Otto (http://ottopress.com) */
    217 function social_ring_make_excerpt($post) {
    218    
    219     if (!empty($post->post_excerpt)) $text = $post->post_excerpt;
    220     else $text = $post->post_content;
    221    
    222     $text = strip_shortcodes( $text );
    223 
    224     remove_filter( 'the_content', 'wptexturize' );
    225     $text = apply_filters('the_content', $text);
    226     add_filter( 'the_content', 'wptexturize' );
    227 
    228     $text = str_replace(']]>', ']]&gt;', $text);
    229     $text = wp_strip_all_tags($text);
    230     $text = str_replace(array("\r\n","\r","\n"),' ',$text);
    231 
    232     $excerpt_more = apply_filters('excerpt_more', '[...]');
    233     $excerpt_more = html_entity_decode($excerpt_more, ENT_QUOTES, 'UTF-8');
    234     $text = html_entity_decode($text, ENT_QUOTES, 'UTF-8');
    235 
    236     $max = min(1000,apply_filters('sfc_excerpt_length',1000));
    237     $max -= strlen ($excerpt_more) + 1;
    238     $max -= strlen ('</fb:intl>') * 2 - 1;
    239 
    240     if ($max<1) return ''; // nothing to send
    241    
    242     if (strlen($text) >= $max) {
    243         $text = substr($text, 0, $max);
    244         $words = explode(' ', $text);
    245         array_pop ($words);
    246         array_push ($words, $excerpt_more);
    247         $text = implode(' ', $words);
    248     }
    249 
    250     return $text;
    251 }
     330new WordPress_Social_Ring();
    252331
    253332?>
  • wordpress-social-ring/trunk/includes/widgets.php

    r476320 r618456  
    3030                'tweet_text' => get_bloginfo('name').' - '.get_bloginfo('description'),
    3131                'border_color' => 'D0D0D0',
    32                 'box_padding' => 24,
    33                 'button_margin' => 12
     32                'box_padding' => 20,
     33                'button_margin' => 8
    3434            );
    3535       
     
    130130        echo $before_title . $instance['widget_title'] . $after_title."\n";
    131131    }
     132    $options = get_option(WP_SOCIAL_RING.'_options');
    132133    ?>
    133134    <div class="SocialRing_Widget_inside" style="-webkit-border-radius: 5px;-moz-border-radius: 5px;border-radius: 5px;border:1px solid #<?php echo $instance['border_color']; ?>;padding:12px <?php echo $instance['box_padding']; ?>px;min-height:62px;">
    134135        <div style="float:left;margin:0 <?php echo $instance['button_margin']; ?>px">
    135             <a href="https://twitter.com/share" class="sr-twitter-button twitter-share-button" data-text="<?php echo $instance['tweet_text']; ?>" data-url="<?php echo $instance['tweet_url']; ?>" data-count="vertical" data-via="<?php echo $instance['tweet_account']; ?>" data-related="<?php echo $instance['tweet_hint_account']; ?>:<?php echo $instance['tweet_hint_desc']; ?>"></a>
     136            <a href="https://twitter.com/share" lang="<?php echo $options['twitter_language']; ?>" class="sr-twitter-button twitter-share-button" data-text="<?php echo $instance['tweet_text']; ?>" data-url="<?php echo $instance['tweet_url']; ?>" data-count="vertical" data-via="<?php echo $instance['tweet_account']; ?>" data-related="<?php echo $instance['tweet_hint_account']; ?>:<?php echo $instance['tweet_hint_desc']; ?>"></a>
    136137        </div>
    137138        <div style="float:left;margin:0 <?php echo $instance['button_margin']; ?>px;padding-top:2px">
  • wordpress-social-ring/trunk/langs/wp_social_ring-it_IT.po

    r584582 r618456  
    33"Project-Id-Version: WordPress Social Ring\n"
    44"Report-Msgid-Bugs-To: \n"
    5 "POT-Creation-Date: 2012-08-12 17:15+0100\n"
    6 "PO-Revision-Date: 2012-08-12 17:15+0100\n"
     5"POT-Creation-Date: 2012-10-29 00:08+0100\n"
     6"PO-Revision-Date: 2012-10-29 00:12+0100\n"
    77"Last-Translator: Niccolo Tapparo\n"
    88"Language-Team: AlterVista\n"
     
    1414"X-Poedit-SearchPath-0: .\n"
    1515
    16 #: admin/admin.php:9
    17 msgid "WordPress Social Ring Settings"
    18 msgstr "Impostazioni WordPress Social Ring"
    19 
    20 #: admin/admin.php:19
     16#: admin/admin.php:168
     17msgid "Social Sharing"
     18msgstr "Condivisione Social Network"
     19
     20#: admin/admin.php:176
     21msgid "Social Network Settings"
     22msgstr "Impostazioni Condivisione Social Network"
     23
     24#: admin/admin.php:185
    2125msgid "Extra"
    2226msgstr "Extra"
    2327
    24 #: admin/admin.php:22
     28#: admin/admin.php:188
    2529msgid "<b>Custom position</b>"
    2630msgstr "<b>Posizione personalizzata</b>"
    2731
    28 #: admin/admin.php:25
     32#: admin/admin.php:191
    2933msgid "You can give Social buttons a custom position by calling this function in your theme."
    3034msgstr "I bottoni social possono essere posizionati a piacere inserendo nel tema il seguente codice:"
    3135
    32 #: admin/admin.php:29
     36#: admin/admin.php:195
    3337msgid "Pay Attention: it must called <b>inside the loop</b> to work properly!"
    3438msgstr "Attenzione: deve essere utilizzato <b>all'interno del loop</b> per funzionare correttamente."
    3539
    36 #: admin/admin.php:32
     40#: admin/admin.php:198
    3741msgid "<b>Shortcode</b>"
    3842msgstr "<b>Shortcode</b>"
    3943
    40 #: admin/admin.php:35
     44#: admin/admin.php:201
    4145msgid "You can also place social buttons inside your posts by using the shortcode:"
    4246msgstr "I bottoni social possono essere anche inseriti all'interno dei post utilizzando il seguente shortcode:"
    4347
    44 #: admin/admin.php:40
     48#: admin/admin.php:206
    4549msgid "Save Changes"
    4650msgstr "Salva Impostazioni"
    4751
    48 #: admin/admin.php:46
     52#: admin/admin.php:211
     53msgid "Help"
     54msgstr "Aiuto"
     55
     56#: admin/admin.php:218
     57msgid "News"
     58msgstr "News"
     59
     60#: admin/admin.php:236
    4961msgid "http://en.altervista.org/create-free-blog.html?ref=socialring"
    5062msgstr "http://it.altervista.org/crea-blog-gratis.php?ref=socialring"
    5163
    52 #: admin/admin.php:47
     64#: admin/admin.php:237
    5365msgid "Create your free blog!"
    5466msgstr "Crea il tuo blog gratis!"
    5567
    56 #: admin/admin.php:70
    57 #: includes/library.php:203
    58 msgid "en_US"
    59 msgstr "it_IT"
    60 
    61 #: admin/admin.php:90
     68#: admin/admin.php:266
    6269msgid "General Settings"
    6370msgstr "Impostazioni Generali"
    6471
    65 #: admin/admin.php:96
     72#: admin/admin.php:272
    6673msgid "Buttons"
    6774msgstr "Pulsanti"
    6875
    69 #: admin/admin.php:103
     76#: admin/admin.php:279
    7077msgid "Position"
    7178msgstr "Posizione"
    7279
    73 #: admin/admin.php:110
     80#: admin/admin.php:286
    7481msgid "Show on"
    7582msgstr "Mostra su"
    7683
    77 #: admin/admin.php:119
    78 msgid "Choose Social Ring position and behavior"
     84#: admin/admin.php:293
     85msgid "Counter"
     86msgstr "Contatore"
     87
     88#: admin/admin.php:300
     89msgid "Buttons Language"
     90msgstr "Lingua dei Bottoni"
     91
     92#: admin/admin.php:309
     93msgid "Choose sharing buttons position and behavior"
    7994msgstr "Scegli la posizione e il comportamento dei pulsanti di condivisione sui social network"
    8095
    81 #: admin/admin.php:133
     96#: admin/admin.php:317
     97msgid "Horizontal"
     98msgstr "Orizzontale"
     99
     100#: admin/admin.php:321
     101msgid "Vertical"
     102msgstr "Verticale"
     103
     104#: admin/admin.php:325
     105msgid "None"
     106msgstr "Nessuno"
     107
     108#: admin/admin.php:335
    82109msgid "Before content"
    83110msgstr "Prima del contenuto"
    84111
    85 #: admin/admin.php:137
     112#: admin/admin.php:339
    86113msgid "After content"
    87114msgstr "Dopo il contenuto"
    88115
    89 #: admin/admin.php:152
     116#: admin/admin.php:350
    90117msgid "Facebook Like"
    91118msgstr "Facebook Mi Piace"
    92119
    93 #: admin/admin.php:157
     120#: admin/admin.php:355
    94121msgid "Facebook Send"
    95122msgstr "Facebook Invia"
    96123
    97 #: admin/admin.php:163
     124#: admin/admin.php:361
    98125msgid "Facebook Share"
    99126msgstr "Facebook Condividi"
    100127
    101 #: admin/admin.php:168
     128#: admin/admin.php:366
    102129msgid "Twitter"
    103130msgstr "Twitter"
    104131
    105 #: admin/admin.php:169
     132#: admin/admin.php:367
    106133msgid "I use WordPress Social Ring on my blog"
    107134msgstr "Io uso WordPress Social Ring sul mio blog"
    108135
    109 #: admin/admin.php:173
     136#: admin/admin.php:371
    110137msgid "Google +1"
    111138msgstr "Google +1"
    112139
    113 #: admin/admin.php:174
    114 #: admin/admin.php:186
     140#: admin/admin.php:372
     141#: admin/admin.php:384
    115142msgid "http://wordpress.altervista.org/"
    116143msgstr "http://wordpress.altervista.org/"
    117144
    118 #: admin/admin.php:179
     145#: admin/admin.php:377
    119146msgid "LinkedIn"
    120147msgstr "LinkedIn"
    121148
    122 #: admin/admin.php:185
     149#: admin/admin.php:383
    123150msgid "Pin it"
    124151msgstr "Pin it"
    125152
    126 #: admin/admin.php:186
     153#: admin/admin.php:384
    127154msgid "WordPress tutorials, plugin and themes."
    128155msgstr "Tutorial WordPress, temi e plugin."
    129156
    130 #: admin/admin.php:202
     157#: admin/admin.php:388
     158msgid "StumbleUpon"
     159msgstr "StumbleUpon"
     160
     161#: admin/admin.php:400
    131162msgid "Home"
    132163msgstr "Home"
    133164
    134 #: admin/admin.php:206
     165#: admin/admin.php:404
    135166msgid "Pages"
    136167msgstr "Pagine"
    137168
    138 #: admin/admin.php:210
     169#: admin/admin.php:408
    139170msgid "Posts"
    140171msgstr "Post"
    141172
    142 #: admin/admin.php:214
     173#: admin/admin.php:412
    143174msgid "Categories"
    144175msgstr "Categorie"
    145176
    146 #: admin/admin.php:218
     177#: admin/admin.php:416
    147178msgid "Archive"
    148179msgstr "Archivi"
    149180
    150 #: admin/admin.php:256
    151 msgid "Social Ring settings"
    152 msgstr "Impostazioni Social Ring"
    153 
    154 #: admin/admin.php:256
    155 msgid "Social Ring"
    156 msgstr "Social Ring"
     181#: admin/admin.php:429
     182msgid "LinkedIn, Pin It and StumbleUpon don't support localization"
     183msgstr "LinkedIn, Pin It e StumbleUpon non supportano la traduzione"
    157184
    158185#: includes/widgets.php:11
     
    227254msgstr "Colore Bordo"
    228255
     256#~ msgid "WordPress Social Ring Settings"
     257#~ msgstr "Impostazioni WordPress Social Ring"
     258
     259#~ msgid "en_US"
     260#~ msgstr "it_IT"
     261
    229262#~ msgid "Your free WordPress blog, <b>without space and traffic limits</b>"
    230263#~ msgstr ""
     
    320353#~ "WordPress per evitare problemi grafici. Se vuoi, puoi riattivarla."
    321354
    322 #~ msgid "none"
    323 #~ msgstr "nessuno"
    324 
    325355#~ msgid "AV Optimizer"
    326356#~ msgstr "AV Optimizer"
  • wordpress-social-ring/trunk/readme.txt

    r614490 r618456  
    55Requires at least: 3.3
    66Tested up to: 3.4.2
    7 Version: 1.1.9
    8 Stable tag: 1.1.9
     7Version: 1.2.0
     8Stable tag: 1.2.0
    99
    1010WordPress Social Ring adds sharing buttons for Facebook, Twitter, Google+, Pinteres and LinkedIn.
  • wordpress-social-ring/trunk/wp-social-ring.php

    r617279 r618456  
    44Description: Let visitors share posts/pages on Facebook, Twitter and Google+. From admin page you can choose which button display: Facebook Like, Facebook Send, Facebook Share, Google +1 and Twitter.
    55Author: Niccol&ograve; Tapparo
    6 Version: 1.1.9
     6Version: 1.2.0
    77Author URI: http://wordpress.altervista.org/
    88Plugin URI: http://wordpress.altervista.org/wordpress-social-ring/
     
    2727}
    2828
    29 add_action('wp_head', 'social_ring_add_css');
    30 add_filter('the_content', 'social_ring_add_sharing');
    31 add_action('wp_footer', 'social_ring_add_js');
    32 add_shortcode('socialring', 'social_ring_shortcode');
    33 
    3429function social_ring_install() {
    3530
    36     if(version_compare(get_bloginfo('version'), '3.2', '<')) {
     31    if(version_compare(get_bloginfo('version'), '3.3', '<')) {
    3732        deactivate_plugins(basename(__FILE__));
    3833    } else {
    39         $wp_social_ring_options = array (
    40             'social_facebook_like_button' => 0,
    41             'social_facebook_send_button' => 0,
    42             'social_facebook_share_button' => 0,
    43             'social_twitter_button' => 0,
    44             'social_google_button' => 0,
    45             'social_pin_it_button' => 0,
    46             'social_on_home' => 0,
    47             'social_on_pages' => 0,
    48             'social_on_posts' => 0,
    49             'social_on_category' => 0,
    50             'social_on_archive' => 0,
    51             'social_before_content' => 0,
    52             'social_after_content' => 0,
    53             'opengraph' => 0,
    54             'social_cross_plugin_compatibility' => 0,
    55         );
     34        $wp_social_ring_options = get_option(WP_SOCIAL_RING.'_options');
     35        if(empty($wp_social_ring_options)) {
     36            $wp_social_ring_options = array (
     37                'social_facebook_like_button' => 1,
     38                'social_facebook_send_button' => 0,
     39                'social_facebook_share_button' => 1,
     40                'social_twitter_button' => 1,
     41                'social_google_button' => 1,
     42                'social_pin_it_button' => 1,
     43                'social_linkedin_button' => 1,
     44                'social_stumble_button' => 0,
     45                'social_on_home' => 0,
     46                'social_on_pages' => 0,
     47                'social_on_posts' => 1,
     48                'social_on_category' => 0,
     49                'social_on_archive' => 0,
     50                'social_before_content' => 1,
     51                'social_after_content' => 0,
     52                'language' => 'Englsh',
     53                'facebook_language' => 'en_US',
     54                'google_language' => 'en-US',
     55                'twitter_language' => 'en',
     56                'button_counter' => 'horizontal'
     57            );
     58        } else {
     59            if(!isset($wp_social_ring_options['language'])) {
     60                $wp_social_ring_options['language'] = 'English';
     61            }
     62            if(!isset($wp_social_ring_options['facebook_language'])) {
     63                $wp_social_ring_options['facebook_language'] = 'en_US';
     64            }
     65            if(!isset($wp_social_ring_options['google_language'])) {
     66                $wp_social_ring_options['google_language'] = 'en-US';
     67            }
     68            if(!isset($wp_social_ring_options['twitter_language'])) {
     69                $wp_social_ring_options['twitter_language'] = 'en';
     70            }
     71            if(!isset($wp_social_ring_options['button_counter'])) {
     72                $wp_social_ring_options['button_counter'] = 'horizontal';
     73            }
     74        }
    5675        update_option(WP_SOCIAL_RING.'_options', $wp_social_ring_options);
    5776    }
Note: See TracChangeset for help on using the changeset viewer.