WordPress.org

Plugin Directory

Changeset 615192


Ignore:
Timestamp:
10/21/12 10:45:27 (18 months ago)
Author:
M66B
Message:

1.167 dev new feature: subscribe button

Location:
add-link-to-facebook
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • add-link-to-facebook/tags/1.166/readme.txt

    r614401 r615192  
    784784 
    785785= Development version = 
    786 * ... 
     786* New feature: shortcode/template tag/widget for Facebook subscribe button 
    787787 
    788788Follow these steps to install the development version: 
  • add-link-to-facebook/trunk/add-link-to-facebook-class.php

    r614137 r615192  
    114114            add_shortcode('al2fb_like_box', array(&$this, 'Shortcode_like_box')); 
    115115            add_shortcode('al2fb_send_button', array(&$this, 'Shortcode_send_button')); 
     116            add_shortcode('al2fb_subscribe_button', array(&$this, 'Shortcode_subscribe_button')); 
    116117            add_shortcode('al2fb_comments_plugin', array(&$this, 'Shortcode_comments_plugin')); 
    117118            add_shortcode('al2fb_face_pile', array(&$this, 'Shortcode_face_pile')); 
     
    21042105        } 
    21052106 
     2107        // Shortcode send button 
     2108        function Shortcode_subscribe_button($atts) { 
     2109            extract(shortcode_atts(array('post_id' => null), $atts)); 
     2110            if (empty($post_id)) 
     2111                global $post; 
     2112            else 
     2113                $post = get_post($post_id); 
     2114            if (isset($post)) 
     2115                return WPAL2Int::Get_subscribe_button($post); 
     2116            else 
     2117                return ''; 
     2118        } 
     2119 
    21062120        // Shortcode comments plugin 
    21072121        function Shortcode_comments_plugin($atts) { 
  • add-link-to-facebook/trunk/add-link-to-facebook-int.php

    r611811 r615192  
    12691269        } 
    12701270 
     1271        static function Get_subscribe_button($post) { 
     1272            $user_ID = WPAL2Facebook::Get_user_ID($post); 
     1273            if ($user_ID && !WPAL2Facebook::Is_excluded_post_type($post) && !WPAL2Int::social_in_excerpt($user_ID)) { 
     1274                // Get options 
     1275                $font = get_user_meta($user_ID, c_al2fb_meta_like_font, true); 
     1276                $colorscheme = get_user_meta($user_ID, c_al2fb_meta_like_colorscheme, true); 
     1277                $faces = get_user_meta($user_ID, c_al2fb_meta_like_faces, true); 
     1278                $layout = ''; 
     1279                $width = ''; 
     1280 
     1281                // Get link 
     1282                $page_id = WPAL2Int::Get_page_id($user_ID, false); 
     1283                $info = WPAL2Int::Get_fb_info_cached($user_ID, empty($page_id) ? 'me' : $page_id); 
     1284 
     1285                // Send button 
     1286                $content = '<div class="al2fb_subscribe_button">'; 
     1287                $content .= '<div id="fb-root"></div>'; 
     1288                $content .= WPAL2Int::Get_fb_script($user_ID); 
     1289                $content .= '<fb:subscribe'; 
     1290                $content .= ' font="' . (empty($font) ? 'arial' : $font) . '"'; 
     1291                $content .= ' colorscheme="' . (empty($colorscheme) ? 'light' : $colorscheme) . '"'; 
     1292                $content .= ' show_faces="' . ($faces ? 'true' : 'false') . '"'; 
     1293                $content .= ' layout="' . (empty($layout) ? 'standard' : $layout) . '"'; 
     1294                $content .= ' width="' . (empty($width) ? '450' : $width) . '"'; 
     1295                $content .= ' href="' . $info->link . '"></fb:subscribe>'; 
     1296                $content .= '</div>'; 
     1297 
     1298                return $content; 
     1299            } 
     1300            else 
     1301                return ''; 
     1302        } 
     1303 
    12711304        // Get HTML for comments plugin 
    12721305        static function Get_comments_plugin($post) { 
  • add-link-to-facebook/trunk/add-link-to-facebook-widget.php

    r535780 r615192  
    5555        $like_box = isset($instance['al2fb_like_box']) ? $instance['al2fb_like_box'] : false; 
    5656        $send_button = isset($instance['al2fb_send_button']) ? $instance['al2fb_send_button'] : false; 
     57        $subscribe_button = isset($instance['al2fb_subscribe_button']) ? $instance['al2fb_subscribe_button'] : false; 
    5758        $comments_plugin = isset($instance['al2fb_comments_plugin']) ? $instance['al2fb_comments_plugin'] : false; 
    5859        $face_pile = isset($instance['al2fb_face_pile']) ? $instance['al2fb_face_pile'] : false; 
     
    9495 
    9596        if ($fb_comments || $fb_messages || 
    96             $like_button || $like_box || $send_button || 
     97            $like_button || $like_box || $send_button || $subscribe_button || 
    9798            $comments_plugin || $face_pile || 
    9899            $profile || $registration || $login || $activity) { 
     
    132133            if ($send_button) 
    133134                echo WPAL2Int::Get_send_button($post); 
     135 
     136            if ($subscribe_button) 
     137                echo WPAL2Int::Get_subscribe_button($post); 
    134138 
    135139            // Facebook comments plugins 
     
    280284            $instance['al2fb_like_box'] = $new_instance['al2fb_like_box']; 
    281285            $instance['al2fb_send_button'] = $new_instance['al2fb_send_button']; 
     286            $instance['al2fb_subscribe_button'] = $new_instance['al2fb_subscribe_button']; 
    282287            $instance['al2fb_comments_plugin'] = $new_instance['al2fb_comments_plugin']; 
    283288            $instance['al2fb_face_pile'] = $new_instance['al2fb_face_pile']; 
     
    314319        if (empty($instance['al2fb_send_button'])) 
    315320            $instance['al2fb_send_button'] = false; 
     321        if (empty($instance['al2fb_subscribe_button'])) 
     322            $instance['al2fb_subscribe_button'] = false; 
    316323        if (empty($instance['al2fb_comments_plugin'])) 
    317324            $instance['al2fb_comments_plugin'] = false; 
     
    345352        $chk_box = ($instance['al2fb_like_box'] ? ' checked ' : ''); 
    346353        $chk_send = ($instance['al2fb_send_button'] ? ' checked ' : ''); 
     354        $chk_subscribe = ($instance['al2fb_subscribe_button'] ? ' checked ' : ''); 
    347355        $chk_comments_plugin = ($instance['al2fb_comments_plugin'] ? ' checked ' : ''); 
    348356        $chk_face_pile = ($instance['al2fb_face_pile'] ? ' checked ' : ''); 
     
    392400            <br /> 
    393401 
     402            <input class="checkbox" type="checkbox" <?php echo $chk_subscribe ?> id="<?php echo $this->get_field_id('al2fb_subscribe_button'); ?>" name="<?php echo $this->get_field_name('al2fb_subscribe_button'); ?>" /> 
     403            <label for="<?php echo $this->get_field_id('al2fb_subscribe_button'); ?>"><?php _e('Show Facebook subscribe button', c_al2fb_text_domain); ?></label> 
     404            <br /> 
     405 
    394406            <input class="checkbox" type="checkbox" <?php echo $chk_comments_plugin; ?> id="<?php echo $this->get_field_id('al2fb_comments_plugin'); ?>" name="<?php echo $this->get_field_name('al2fb_comments_plugin'); ?>" /> 
    395407            <label for="<?php echo $this->get_field_id('al2fb_comments_plugin'); ?>"><?php _e('Show Facebook comments plugin', c_al2fb_text_domain); ?></label> 
  • add-link-to-facebook/trunk/add-link-to-facebook.php

    r614137 r615192  
    186186        if (isset($post)) 
    187187            echo WPAL2Int::Get_send_button($post); 
     188    } 
     189} 
     190 
     191// Template tag for Facebook subscribe button 
     192if (!function_exists('al2fb_subscribe_button')) { 
     193    function al2fb_subscribe_button($post_ID = null) { 
     194        if (empty($post_ID)) 
     195            global $post; 
     196        else 
     197            $post = get_post($post_ID); 
     198        if (isset($post)) 
     199            echo WPAL2Int::Get_subscribe_button($post); 
    188200    } 
    189201} 
  • add-link-to-facebook/trunk/language/add-link-to-facebook-nl_BE.po

    r611811 r615192  
    99"Content-Type: text/plain; charset=UTF-8\n" 
    1010"Content-Transfer-Encoding: 8bit\n" 
    11 "PO-Revision-Date: 2012-10-13 08:00+0100\n" 
     11"PO-Revision-Date: 2012-10-21 12:41+0100\n" 
    1212"Last-Translator: Marcel Bokhorst\n" 
    1313"Language-Team: Marcel Bokhorst\n" 
     
    10411041msgstr "Facebook laat altijd een kleine afbeelding zien" 
    10421042 
     1043msgid "Show Facebook subscribe button" 
     1044msgstr "Toon Facebook abonneren knop" 
     1045 
  • add-link-to-facebook/trunk/language/add-link-to-facebook-nl_NL.po

    r611811 r615192  
    99"Content-Type: text/plain; charset=UTF-8\n" 
    1010"Content-Transfer-Encoding: 8bit\n" 
    11 "PO-Revision-Date: 2012-10-13 08:00+0100\n" 
     11"PO-Revision-Date: 2012-10-21 12:41+0100\n" 
    1212"Last-Translator: Marcel Bokhorst\n" 
    1313"Language-Team: Marcel Bokhorst\n" 
     
    10411041msgstr "Facebook laat altijd een kleine afbeelding zien" 
    10421042 
     1043msgid "Show Facebook subscribe button" 
     1044msgstr "Toon Facebook abonneren knop" 
     1045 
  • add-link-to-facebook/trunk/readme.txt

    r614401 r615192  
    784784 
    785785= Development version = 
    786 * ... 
     786* New feature: shortcode/template tag/widget for Facebook subscribe button 
    787787 
    788788Follow these steps to install the development version: 
Note: See TracChangeset for help on using the changeset viewer.