Plugin Directory

Changeset 573722


Ignore:
Timestamp:
07/17/2012 06:53:24 PM (13 years ago)
Author:
sociable
Message:
 
File:
1 edited

Legend:

Unmodified
Added
Removed
  • sociable/trunk/sociable.php

    r565601 r573722  
    44Plugin URI: http://blogplay.com/plugin
    55Description: Automatically add links on your posts, pages and RSS feed to your favorite social bookmarking sites.
    6 Version: 4.3.0
     6Version: 4.3.1
    77Author: Blogplay
    88Author URI: http://blogplay.com/
     
    377377        'blogplay_tags' => 1,
    378378
    379         'version' =>'4.3.0',
     379        'version' =>'4.3.1',
    380380
    381381        'automatic_mode'         => 'on',
     
    16251625    );
    16261626
     1627
     1628    //Update will create if it doesn't exist.
     1629
     1630    update_option( 'sociable_known_sites' , $sociable_known_sites );
     1631
     1632    update_option( 'sociable_options'     , $sociable_options );
     1633
     1634    update_option( 'sociable_helpus'      , 1);
     1635}
     1636
     1637
     1638
     1639function skyscraper_reset(){
     1640
     1641
     1642
     1643    $skyscraper_options = array(
     1644                       
     1645                        "pixel"                     => "",
     1646                       
     1647                        "version"                   => "1.0",
     1648
     1649                        "widget_width"              => "60px",
     1650
     1651                        "widget_position"           => "1",
     1652
     1653                        "background_color"          => "#fefefe",
     1654
     1655                        "labels_color"              => "#f7f7f7",
     1656
     1657                        "text_size"                 => "10px",
     1658
     1659                        "counters"                  => array("check" => "0",
     1660
     1661                                                            "folded" => "0"),
     1662
     1663                        "share"                     => array("check" => "0",
     1664
     1665                                                            "folded" => "0"),
     1666
     1667                        "num_tweets"                => 3,
     1668
     1669                        "num_rss"                   =>3,
     1670
     1671                        "locations"                 => array("is_front_page" => 1,
     1672
     1673                                                            "is_home"        => 1,
     1674
     1675                                                            "is_single"      => 1,
     1676
     1677                                                            "is_page"        => 1,
     1678
     1679                                                            "is_category"    => 1,
     1680
     1681                                                            "is_date"        => 1,
     1682
     1683                                                            "is_tag"         => 1,
     1684
     1685                                                            "is_author"      => 1,
     1686
     1687                                                            "is_search"      => 1,
     1688
     1689                                                            "is_rss"         => 1  ),
     1690
     1691                                                           
     1692
     1693                      "counters"                    => array("check" => 1,
     1694
     1695                                                             "folded" => 1),
     1696
     1697                      "share"                       => array("check" => 1,
     1698
     1699                                                             "folded" => 1),
     1700
     1701
     1702
     1703                      "sociable_banner"             => "",
     1704
     1705
     1706
     1707                      "sociable_banner_timer"       => 15,
     1708
     1709
     1710
     1711                      "sociable_banner_text"        => 'Please spread the word: Be Sociable, Share!',
     1712
     1713
     1714
     1715                      "sociable_banner_colorBack"   => '#FFFFFF',             
     1716
     1717
     1718
     1719                      "sociable_banner_fontSize"    => '9px',
     1720
     1721
     1722
     1723                      "sociable_banner_colorLabel"  => '#F7F7F7',
     1724
     1725                     
     1726
     1727                      "sociable_banner_colorFont"   => '#6A6A6A',
     1728
     1729                     
     1730
     1731                      "accept_read_twitter"         => '',
     1732
     1733                     
     1734
     1735                      "accept_read_rss"             => ''
     1736
     1737    );
     1738
     1739
     1740
     1741    update_option( 'skyscraper_options'   , $skyscraper_options );
     1742
     1743   
     1744
     1745       
     1746
     1747    $skyscraper_latest = array();
     1748
     1749    update_option("skyscraper_latest",$skyscraper_latest );
     1750
     1751   
     1752
     1753    $skyscraper_mentions = array();
     1754
     1755    update_option("skyscraper_mentions",$skyscraper_mentions );
     1756
     1757}
     1758
     1759
     1760
     1761/*
     1762
     1763 * De-Activate Function
     1764
     1765 */
     1766
     1767function sociable_deactivate(){
     1768
     1769//    global $wpdb;
     1770
     1771//    //Delete The Metadata
     1772
     1773//    $wpdb->query("DELETE FROM $wpdb->postmeta WHERE meta_key = '_sociableoff'");
     1774
     1775//    //delete The Options
     1776
     1777//    return delete_option( 'sociable_options' );
     1778
     1779}
     1780
     1781
     1782
     1783/*
     1784
     1785 * Function To Completely Remove The Options
     1786
     1787 */
     1788
     1789function sociable_2_remove(){
     1790
     1791    require_once( ABSPATH . '/wp-admin/includes/plugin.php' );
     1792
     1793   
     1794
     1795    global $wpdb;
     1796
     1797    //Delete The Metadata
     1798
     1799    $wpdb->query("DELETE FROM $wpdb->postmeta WHERE meta_key = '_sociableoff'");
     1800
     1801    //delete The Options
     1802
     1803    delete_option( 'sociable_options' );
     1804
     1805    delete_option( 'skyscraper_options' );
     1806
     1807   
     1808
    16271809 
    16281810
     1811
     1812
     1813    deactivate_plugins( array( 'sociable/sociable.php' ) );
     1814
     1815    wp_redirect( '/wp-admin/plugins.php?deactivate=true' );
     1816
     1817}
     1818
     1819
     1820
     1821/*
     1822
     1823 * Generic Plugin Wide Functions
     1824
     1825 */
     1826
     1827function _get_sociable_image_path(){
     1828
     1829
     1830
     1831    global $sociable_options;
     1832
     1833
     1834
     1835       
     1836
     1837
     1838
     1839    if( empty( $sociable_options['custom_icons'] )){
     1840
     1841
     1842
     1843        if ($sociable_options['icon_option'] !="option6"){
     1844
     1845
     1846
     1847        $path = trailingslashit( SOCIABLE_HTTP_PATH . 'images/'.$sociable_options['icon_option']."/" . $sociable_options['icon_size'] );
     1848
     1849
     1850
     1851        }else{
     1852
     1853
     1854
     1855       
     1856
     1857
     1858
     1859        $path = trailingslashit( SOCIABLE_HTTP_PATH . 'images/original/');
     1860
     1861
     1862
     1863        }
     1864
     1865
     1866
     1867    } else {
     1868
     1869
     1870
     1871        $path = trailingslashit( SOCIABLE_HTTP_PATH . 'images/customIcons/');
     1872
     1873
     1874
     1875    }
     1876
     1877
     1878
     1879 
     1880
     1881
     1882
     1883     
     1884
     1885
     1886
     1887    return $path;
     1888
     1889
     1890
     1891}
     1892
     1893
     1894
     1895function _get_sociable_image( $site, $description ){
     1896
     1897
     1898
     1899global $sociable_options;
     1900
     1901
     1902
     1903    $imageclass = '';
     1904
     1905    $imagestyle = '';
     1906
     1907    $imagepath = _get_sociable_image_path();
     1908
     1909    //Get The Source Of The Image
     1910
     1911    if ( ! isset( $site['spriteCoordinates'] ) || ! isset( $sociable_options['use_sprites'] ) || is_feed() ) {
     1912
     1913
     1914
     1915        if ( strpos( $site['favicon'], 'http' ) === 0 ) {
     1916
     1917                $imagesource = $site['favicon'];
     1918
     1919        } else {
     1920
     1921                $imagesource = $imagepath.$site['favicon'];
     1922
     1923        }
     1924
     1925
     1926
     1927    } else {
     1928
     1929
     1930
     1931        $imagesource = $imagepath . "services-sprite.gif";
     1932
     1933        $services_sprite_url = $imagepath . "sprite.png";
     1934
     1935
     1936
     1937        $spriteCoords = $site['spriteCoordinates'];
     1938
     1939       
     1940
     1941        $size = $sociable_options['icon_size'];
     1942
     1943
     1944
     1945        $imagestyle = 'width: ' . $size . 'px; height: ' . $size . 'px; background: transparent url(' . $services_sprite_url . ') no-repeat; background-position:' . $spriteCoords[$size] . 'px 0';
     1946
     1947
     1948
     1949    }
     1950
    16291951   
    16301952
    1631     //Update will create if it doesn't exist.
    1632 
    1633 
    1634 
    1635    
    1636 
    1637     update_option( 'sociable_known_sites' , $sociable_known_sites );
    1638 
    1639     update_option( 'sociable_options'     , $sociable_options );
    1640 
    1641     update_option( 'sociable_helpus'      , 1);
     1953
     1954
     1955    if( isset( $sociable_options['use_alphamask'] ) ){
     1956
     1957        $imageclass .= 'sociable-hovers';         
     1958
     1959    }
     1960
     1961
     1962
     1963    //If A Class Has Been Specified, Ensure It Is Added To The Class Attribute.
     1964
     1965    if ( isset( $site['class'] ) ) {
     1966
     1967        $imageclass .= 'sociable_' . $site['class'];
     1968
     1969    }
     1970
     1971 
     1972
     1973    if( $imagestyle != '' ){
     1974
     1975        $imagestyle = 'style="' . $imagestyle . '"';
     1976
     1977    }
     1978
     1979    if ($sociable_options['icon_option'] !="option6"){
     1980
     1981
     1982
     1983    $image = '<img  src="' . $imagesource . '" title="' . $description . '" alt="' . $description . '"' . $imagestyle . ' />' ;
     1984
     1985
     1986
     1987    }else{
     1988
     1989
     1990
     1991    $image = '<img class="' . $imageclass . '" src="' . $imagesource . '" title="' . $description . '" alt="' . $description . '"' . $imagestyle . ' />' ;
     1992
     1993
     1994
     1995    }
     1996
     1997   
     1998
     1999    return $image;
    16422000
    16432001}
     
    16452003
    16462004
    1647 function skyscraper_reset(){
    1648 
    1649 
    1650 
    1651     $skyscraper_options = array(
    1652 
    1653                         "version"                   => "1.0",
    1654 
    1655                         "widget_width"              => "60px",
    1656 
    1657                         "widget_position"           => "1",
    1658 
    1659                         "background_color"          => "#fefefe",
    1660 
    1661                         "labels_color"              => "#f7f7f7",
    1662 
    1663                         "text_size"                 => "10px",
    1664 
    1665                         "counters"                  => array("check" => "0",
    1666 
    1667                                                             "folded" => "0"),
    1668 
    1669                         "share"                     => array("check" => "0",
    1670 
    1671                                                             "folded" => "0"),
    1672 
    1673                         "num_tweets"                => 3,
    1674 
    1675                         "num_rss"                   =>3,
    1676 
    1677                         "locations"                 => array("is_front_page" => 1,
    1678 
    1679                                                             "is_home"        => 1,
    1680 
    1681                                                             "is_single"      => 1,
    1682 
    1683                                                             "is_page"        => 1,
    1684 
    1685                                                             "is_category"    => 1,
    1686 
    1687                                                             "is_date"        => 1,
    1688 
    1689                                                             "is_tag"         => 1,
    1690 
    1691                                                             "is_author"      => 1,
    1692 
    1693                                                             "is_search"      => 1,
    1694 
    1695                                                             "is_rss"         => 1  ),
    1696 
    1697                                                            
    1698 
    1699                       "counters"                    => array("check" => 1,
    1700 
    1701                                                              "folded" => 1),
    1702 
    1703                       "share"                       => array("check" => 1,
    1704 
    1705                                                              "folded" => 1),
    1706 
    1707 
    1708 
    1709                       "sociable_banner"             => "",
    1710 
    1711 
    1712 
    1713                       "sociable_banner_timer"       => 15,
    1714 
    1715 
    1716 
    1717                       "sociable_banner_text"        => 'Please spread the word: Be Sociable, Share!',
    1718 
    1719 
    1720 
    1721                       "sociable_banner_colorBack"   => '#FFFFFF',             
    1722 
    1723 
    1724 
    1725                       "sociable_banner_fontSize"    => '9px',
    1726 
    1727 
    1728 
    1729                       "sociable_banner_colorLabel"  => '#F7F7F7',
    1730 
    1731                      
    1732 
    1733                       "sociable_banner_colorFont"   => '#6A6A6A',
    1734 
    1735                      
    1736 
    1737                       "accept_read_twitter"         => '',
    1738 
    1739                      
    1740 
    1741                       "accept_read_rss"             => ''
    1742 
    1743     );
    1744 
    1745 
    1746 
    1747     update_option( 'skyscraper_options'   , $skyscraper_options );
    1748 
    1749    
    1750 
    1751        
    1752 
    1753     $skyscraper_latest = array();
    1754 
    1755     update_option("skyscraper_latest",$skyscraper_latest );
    1756 
    1757    
    1758 
    1759     $skyscraper_mentions = array();
    1760 
    1761     update_option("skyscraper_mentions",$skyscraper_mentions );
    1762 
    1763 }
    1764 
    1765 
    1766 
    1767 /*
    1768 
    1769  * De-Activate Function
    1770 
    1771  */
    1772 
    1773 function sociable_deactivate(){
    1774 
    1775 //    global $wpdb;
    1776 
    1777 //    //Delete The Metadata
    1778 
    1779 //    $wpdb->query("DELETE FROM $wpdb->postmeta WHERE meta_key = '_sociableoff'");
    1780 
    1781 //    //delete The Options
    1782 
    1783 //    return delete_option( 'sociable_options' );
    1784 
    1785 }
    1786 
    1787 
    1788 
    1789 /*
    1790 
    1791  * Function To Completely Remove The Options
    1792 
    1793  */
    1794 
    1795 function sociable_2_remove(){
    1796 
    1797     require_once( ABSPATH . '/wp-admin/includes/plugin.php' );
    1798 
    1799    
    1800 
    1801     global $wpdb;
    1802 
    1803     //Delete The Metadata
    1804 
    1805     $wpdb->query("DELETE FROM $wpdb->postmeta WHERE meta_key = '_sociableoff'");
    1806 
    1807     //delete The Options
    1808 
    1809     delete_option( 'sociable_options' );
    1810 
    1811     delete_option( 'skyscraper_options' );
    1812 
    1813    
    1814 
    1815  
    1816 
    1817 
    1818 
    1819     deactivate_plugins( array( 'sociable/sociable.php' ) );
    1820 
    1821     wp_redirect( '/wp-admin/plugins.php?deactivate=true' );
    1822 
    1823 }
    1824 
    1825 
    1826 
    1827 /*
    1828 
    1829  * Generic Plugin Wide Functions
    1830 
    1831  */
    1832 
    1833 function _get_sociable_image_path(){
    1834 
    1835 
    1836 
    1837     global $sociable_options;
    1838 
    1839 
    1840 
    1841        
    1842 
    1843 
    1844 
    1845     if( empty( $sociable_options['custom_icons'] )){
    1846 
    1847 
    1848 
    1849         if ($sociable_options['icon_option'] !="option6"){
    1850 
    1851 
    1852 
    1853         $path = trailingslashit( SOCIABLE_HTTP_PATH . 'images/'.$sociable_options['icon_option']."/" . $sociable_options['icon_size'] );
    1854 
    1855 
    1856 
    1857         }else{
    1858 
    1859 
    1860 
    1861        
    1862 
    1863 
    1864 
    1865         $path = trailingslashit( SOCIABLE_HTTP_PATH . 'images/original/');
    1866 
    1867 
    1868 
    1869         }
    1870 
    1871 
    1872 
    1873     } else {
    1874 
    1875 
    1876 
    1877         $path = trailingslashit( SOCIABLE_HTTP_PATH . 'images/customIcons/');
    1878 
    1879 
    1880 
    1881     }
    1882 
    1883 
    1884 
    1885  
    1886 
    1887 
    1888 
    1889      
    1890 
    1891 
    1892 
    1893     return $path;
    1894 
    1895 
    1896 
    1897 }
    1898 
    1899 
    1900 
    1901 function _get_sociable_image( $site, $description ){
    1902 
    1903 
    1904 
    1905 global $sociable_options;
    1906 
    1907 
    1908 
    1909     $imageclass = '';
    1910 
    1911     $imagestyle = '';
    1912 
    1913     $imagepath = _get_sociable_image_path();
    1914 
    1915     //Get The Source Of The Image
    1916 
    1917     if ( ! isset( $site['spriteCoordinates'] ) || ! isset( $sociable_options['use_sprites'] ) || is_feed() ) {
    1918 
    1919 
    1920 
    1921         if ( strpos( $site['favicon'], 'http' ) === 0 ) {
    1922 
    1923                 $imagesource = $site['favicon'];
    1924 
    1925         } else {
    1926 
    1927                 $imagesource = $imagepath.$site['favicon'];
    1928 
    1929         }
    1930 
    1931 
    1932 
    1933     } else {
    1934 
    1935 
    1936 
    1937         $imagesource = $imagepath . "services-sprite.gif";
    1938 
    1939         $services_sprite_url = $imagepath . "sprite.png";
    1940 
    1941 
    1942 
    1943         $spriteCoords = $site['spriteCoordinates'];
    1944 
    1945        
    1946 
    1947         $size = $sociable_options['icon_size'];
    1948 
    1949 
    1950 
    1951         $imagestyle = 'width: ' . $size . 'px; height: ' . $size . 'px; background: transparent url(' . $services_sprite_url . ') no-repeat; background-position:' . $spriteCoords[$size] . 'px 0';
    1952 
    1953 
    1954 
    1955     }
    1956 
    1957    
    1958 
    1959 
    1960 
    1961     if( isset( $sociable_options['use_alphamask'] ) ){
    1962 
    1963         $imageclass .= 'sociable-hovers';         
    1964 
    1965     }
    1966 
    1967 
    1968 
    1969     //If A Class Has Been Specified, Ensure It Is Added To The Class Attribute.
    1970 
    1971     if ( isset( $site['class'] ) ) {
    1972 
    1973         $imageclass .= 'sociable_' . $site['class'];
    1974 
    1975     }
    1976 
    1977  
    1978 
    1979     if( $imagestyle != '' ){
    1980 
    1981         $imagestyle = 'style="' . $imagestyle . '"';
    1982 
    1983     }
    1984 
    1985     if ($sociable_options['icon_option'] !="option6"){
    1986 
    1987 
    1988 
    1989     $image = '<img  src="' . $imagesource . '" title="' . $description . '" alt="' . $description . '"' . $imagestyle . ' />' ;
    1990 
    1991 
    1992 
    1993     }else{
    1994 
    1995 
    1996 
    1997     $image = '<img class="' . $imageclass . '" src="' . $imagesource . '" title="' . $description . '" alt="' . $description . '"' . $imagestyle . ' />' ;
    1998 
    1999 
    2000 
    2001     }
    2002 
    2003    
    2004 
    2005     return $image;
    2006 
    2007 }
    2008 
    2009 
    2010 
    20112005?>
Note: See TracChangeset for help on using the changeset viewer.