Plugin Directory

Changeset 539681


Ignore:
Timestamp:
05/03/2012 09:44:33 PM (14 years ago)
Author:
sociable
Message:
 
File:
1 edited

Legend:

Unmodified
Added
Removed
  • sociable/trunk/sociable.php

    r536915 r539681  
    11<?php
     2
    23/*
    34
     5
     6
    47Plugin Name: Sociable
    58
     9
     10
    611Plugin URI: http://blogplay.com/plugin
    712
     13
     14
    815Description: Automatically add links on your posts, pages and RSS feed to your favorite social bookmarking sites.
    916
     17
     18
    1019Version: 4.2.7
    1120
     21
     22
    1223Author: Blogplay
    1324
     25
     26
    1427Author URI: http://blogplay.com/
    1528
     29
     30
    1631Copyright 2006 Peter Harkins ([email protected])
    1732
     33
     34
    1835Copyright 2008-2009 Joost de Valk ([email protected])
    1936
     37
     38
    2039Copyright 2009-Present Blogplay.com ([email protected])
    2140
     41
     42
    2243This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
    2344
     45
     46
    2447This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
    2548
     49
     50
    2651You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
     52
    2753*/
    2854
     55
     56
    2957/*
     58
    3059 * Define Some Paths
     60
    3161*/
    3262
     63
     64
    3365define( 'SOCIABLE_HTTP_PATH' , WP_PLUGIN_URL . '/' . str_replace(basename( __FILE__) , "" , plugin_basename(__FILE__) ) );
     66
    3467define( 'SOCIABLE_ABSPATH' , WP_PLUGIN_DIR . '/' . str_replace(basename( __FILE__) , "" , plugin_basename(__FILE__) ) );
     68
    3569/*
    3670
     71
     72
    3773 * Includes
    3874
     75
     76
    3977 */
    4078
     79
     80
    4181include 'includes/class-sociable_Admin_Options.php';
    4282
     83
     84
    4385include("includes/skyscraper_output.php");
    4486
     87
     88
    4589include 'includes/class-Sociable_Globals.php';
    4690
     91
     92
    4793include 'includes/sociable_output.php';
    4894
     95
     96
    4997/*
    5098
     99
     100
    51101 * Global Variables
    52102
     103
     104
    53105 */
     106
    54107//$sociable_known_sites = Sociable_Globals::default_sites();
    55108
     109
     110
    56111$sociable_options = get_option( 'sociable_options' );
    57112
     113
     114
    58115$skyscraper_options = get_option( 'skyscraper_options' );
    59116
     117
     118
    60119$skyscraper_latest = get_option( 'skyscraper_latest' );
    61120
     121
     122
    62123$skyscraper_mentions = get_option( 'skyscraper_mentions' );
    63124
     125
     126
    64127//$sociable_post_types = array(); //Set This blank here, won't work before init
    65128
     129
     130
    66131//$sociable_taxonomies = array(); //Same Here
     132
    67133/*
    68134
     135
     136
    69137 * General Init Function
    70138
     139
     140
    71141 */
     142
    72143function sociable_init(){
    73144
     145
     146
    74147    wp_enqueue_script('jquery');   
    75148
     149
     150
    76151    global $sociable_post_types, $sociable_taxonomies, $sociable_options, $skyscraper_options;
    77152
     153
     154
    78155    $import_call_asyn = true;
    79156
     157
     158
    80159    $url_shares = $_SERVER["REQUEST_URI"];
     160
    81161    if (strpos($url_shares, "wp-admin")){
    82162
     163
     164
    83165        if (strpos($url_shares, "wp-admin") && !strpos($url_shares, "page=skyscraper_options")){
     166
    84167            $import_call_asyn = false;
    85168
     169
     170
    86171        }
    87172
     173
     174
    88175    }
    89176
     177
     178
    90179    else{
     180
    91181        if (!isset($skyscraper_options["active"])){
     182
    92183            $import_call_asyn = false; 
    93184
     185
     186
    94187        }
    95188
     189
     190
    96191    }
    97192
     193
     194
    98195    if ($import_call_asyn){
     196
    99197        wp_enqueue_script( 'async_call' , SOCIABLE_HTTP_PATH . 'js/async_call.js' );
    100198
     199
     200
    101201        wp_enqueue_script( 'oplugin' , SOCIABLE_HTTP_PATH . 'js/oPlugin.js' );
    102202
     203
     204
    103205        wp_enqueue_style(  "skyscraper_style_shape",SOCIABLE_HTTP_PATH."css/shape.css");
    104206
     207
     208
    105209        wp_enqueue_style(  "skyscraper_style_toolbar", SOCIABLE_HTTP_PATH."css/toolbar.css");
    106210
     211
     212
    107213       
    108214
     215
     216
    109217    }
    110218
     219
     220
    111221    if (!isset($sociable_options['icon_size']) || $sociable_options['icon_size'] == "" || !isset($sociable_options['version'])) sociable_reset();
     222
    112223 
     224
    113225    if (!isset($skyscraper_options['accept_read_twitter'])){
    114226
     227
     228
    115229        //skyscraper_reset();
     230
    116231    }
     232
    117233   
     234
    118235   
     236
    119237    load_plugin_textdomain( 'sociable', false, dirname( plugin_basename( __FILE__ ) )."/languages" );
    120238
     239
     240
    121241    $active_sites = ( isset( $sociable_options['active_sites'] ) ) ? $sociable_options['active_sites'] : array() ;
    122242
     243
     244
    123245    //Set The Post Types
     246
    124247    $sociable_post_types = Sociable_Globals::sociable_get_post_types();
     248
    125249    //Set The Custom Taxonomies
     250
    126251    $sociable_taxonomies = Sociable_Globals::sociable_get_taxonomies();
     252
    127253    wp_enqueue_script( 'sociable' , SOCIABLE_HTTP_PATH . 'js/sociable.js' );
    128254
     255
     256
    129257    wp_enqueue_script( 'addtofavourites' , SOCIABLE_HTTP_PATH . 'js/addtofavorites.js' );
    130258
     259
     260
    131261    if( ! is_admin() ){
     262
    132263      //Load Up The Front Of Site CSS And JS
     264
    133265        if( array_key_exists( 'Add to favorites' , $active_sites ) ){
     266
    134267//            wp_enqueue_script( 'addtofavourites' , SOCIABLE_HTTP_PATH . 'js/addtofavorites.js' );
    135268
     269
     270
    136271        }
    137272
     273
     274
    138275        if( isset( $sociable_options['use_stylesheet'] ) ){
     276
    139277            wp_enqueue_style( 'sociablecss' , SOCIABLE_HTTP_PATH . 'css/sociable.css' );
    140278
     279
     280
    141281        }
    142282
     283
     284
    143285    }
    144286
     287
     288
    145289}
     290
    146291/*
    147292
     293
     294
    148295 * Hooks And Filters
    149296
     297
     298
    150299 */
     300
    151301add_action( 'admin_init' , array( 'sociable_Admin_Options' , 'init' ) );
    152302
     303
     304
    153305add_action( 'admin_menu' , array( 'sociable_Admin_Options' , 'add_menu_pages' ) );
    154306
     307
     308
    155309add_action( 'save_post' , array( 'sociable_Admin_Options' , 'save_post' ) );
    156310
     311
     312
    157313add_action( 'init' , 'sociable_init' );
    158314
     315
     316
    159317add_action( 'wp_head' , 'sociable_init_async' );
    160318
     319
     320
    161321function sociable_init_async(){
     322
    162323        echo "<script type='text/javascript'>";
    163324
     325
     326
    164327        echo  "var base_url_sociable = '".SOCIABLE_HTTP_PATH."'";
    165328
     329
     330
    166331        echo "</script><script type='text/javascript' src='http://apis.google.com/js/plusone.js'></script>";
    167332
     333
     334
    168335}
     336
    169337add_filter( 'the_content', 'auto_sociable' );
     338
    170339//add_filter( 'get_pages', 'auto_skyscraper' );
    171340
     341
     342
    172343//add_filter( 'the_excerpt', 'auto_skyscraper' );
    173344
     345
     346
    174347add_filter( 'the_excerpt', 'auto_sociable' );
    175348
     349
     350
    176351register_activation_hook(__FILE__, 'sociable_activate' );
    177352
     353
     354
    178355register_deactivation_hook( __FILE__, 'sociable_deactivate' );
    179356
     357
     358
    180359/*
    181360
     361
     362
    182363 * Activation Function
    183364
     365
     366
    184367 */
     368
    185369function sociable_activate(){
    186370
     371
     372
    187373    if( ! get_option( 'sociable_options' ) ){
     374
    188375        return sociable_reset();
    189376
     377
     378
    190379    }
    191380
     381
     382
    192383}
     384
    193385/*
    194386
     387
     388
    195389 * Reset Function
    196390
     391
     392
    197393 */
     394
    198395function sociable_reset(){
     396
    199397    global $wpdb;
     398
    200399    //reset all data to factory defaults, install if is there.
    201400
     401
     402
    202403    //Delete All Metadata From The Database ?
     404
    203405    $wpdb->query("DELETE FROM $wpdb->postmeta WHERE meta_key = '_sociableoff'");
     406
    204407    $sociable_options = array(
     408
    205409        'version' =>'4.2.7',
    206410
     411
     412
    207413        'automatic_mode'         => 'on',
    208414
     415
     416
    209417        'tagline'                => 'Be Sociable, Share!',
    210418
     419
     420
    211421        'custom_image_directory' => '',
    212422
     423
     424
    213425        'use_stylesheet'         => 'on',
    214426
     427
     428
    215429        'use_images'             => 'on',
    216430
     431
     432
    217433        'use_alphamask'          => 'on',
    218434
     435
     436
    219437        'new_window'             => 'on',
    220438
    221         'help_grow'              => 'on',
     439
     440
     441        'help_grow'              => '',
     442
     443
    222444
    223445        'locations'              => array(
    224446
     447
     448
    225449                                    'is_single' => 'on',
    226450
     451
     452
    227453                                    'is_page' => 'on'
    228454
     455
     456
    229457                                     ),
    230458
     459
     460
    231461        'active_sites'           => array(
    232462
     463
     464
    233465                                    'Twitter'  => 'on',
    234466
     467
     468
    235469                                    'Facebook' => 'on',
    236470
     471
     472
    237473                                    'email'=>'on',
    238474
     475
     476
    239477                                    'Add to favorites'=>'on',
    240478
     479
     480
    241481                                    'StumbleUpon'  =>'on',
    242482
     483
     484
    243485                                    'Delicious'   =>'on',
    244486
     487
     488
    245489                                    'Google Reader' =>'on',
    246490
     491
     492
    247493                                    'LinkedIn' => 'on',
    248494
     495
     496
    249497                                    'BlinkList' =>'on',
    250498
     499
     500
    251501                                    'More' => 'on',
    252502
     503
     504
    253505                                    'Twitter Counter' =>'on',
    254506
     507
     508
    255509                                    'Facebook Counter' =>'on',
    256510
     511
     512
    257513                                    'Google +' =>'on',
    258514
     515
     516
    259517                                    'LinkedIn Counter' =>'on',           
    260518
     519
     520
    261521                                    'StumbleUpon Counter' =>'on'
    262522
     523
     524
    263525                                    ),
    264526
     527
     528
    265529        'icon_size'       => '32',
    266530
     531
     532
    267533        'icon_option' => 'option1',
    268534
    269         "active"    => 1
     535
     536
     537        "active"    => 1,
     538
     539        'linksoptions' => ''
    270540
    271541    );
     542
    272543    $sociable_known_sites = array(
     544
    273545        'Facebook'    => array(
    274546
     547
     548
    275549                        'favicon' => 'facebook.png',
    276550
     551
     552
    277553                        'url' => 'http://www.facebook.com/share.php?u=PERMALINK&amp;t=TITLE',
    278554
     555
     556
    279557                        'spriteCoordinates' => Array(
    280558
     559
     560
    281561                                                '16' => array("-48px","0px"),
    282562
     563
     564
    283565                                                '32' => array("-96px","0px"),
    284566
     567
     568
    285569                                                '48' => array("-144px","0px"),
    286570
     571
     572
    287573                                                '64' => array("-192px","0px")
    288574
     575
     576
    289577                                            )
    290578
     579
     580
    291581                    ),
    292582
     583
     584
    293585        'Facebook Counter'    => array(
    294586
     587
     588
    295589                                    'counter' =>1,
    296590
     591
     592
    297593                                    'favicon' => 'likecounter.png',
    298594
     595
     596
    299597                                    'url' => '<iframe src="http://www.facebook.com/plugins/like.php?href=PERMALINKCOUNT&send=false&layout=button_count&show_faces=false&action=like&colorscheme=light&font" scrolling="no" frameborder="0" style="border:none; overflow:hidden;height:32px;width:100px" allowTransparency="true"></iframe>',
    300598
     599
     600
    301601                                    'spriteCoordinates' => Array(
    302602
     603
     604
    303605                                                            '16' => array("-48px","0px"),
    304606
     607
     608
    305609                                                            '32' => array("-96px","0px"),
    306610
     611
     612
    307613                                                            '48' => array("-144px","0px"),
    308614
     615
     616
    309617                                                            '64' => array("-192px","0px")
    310618
     619
     620
    311621                                                        )
    312622
     623
     624
    313625                                ),
     626
    314627        'Myspace'     => array(
    315628
     629
     630
    316631            'favicon' => 'myspace.png',
    317632
     633
     634
    318635            'url' => 'http://www.myspace.com/Modules/PostTo/Pages/?u=PERMALINK&amp;t=TITLE',
    319636
     637
     638
    320639            'spriteCoordinates' => Array(
    321640
     641
     642
    322643                '16' => array("0px","-16px"),
    323644
     645
     646
    324647                '32' => array("0px","-32px"),
    325648
     649
     650
    326651                '48' => array("0px","-48px"),
    327652
     653
     654
    328655                '64' => array("0px","-64px")
    329656
     657
     658
    330659            )
    331660
     661
     662
    332663        ),
     664
    333665        'Twitter'     => array(
    334666
     667
     668
    335669            'favicon' => 'twitter.png',
    336670
    337             'url' => 'http://twitter.com/intent/tweet?text=TITLE%20-%20PERMALINK%20(via%20@sociablesite)%20/blogplay.com/%20blogplay.com',
     671
     672
     673            'url' => 'http://twitter.com/intent/tweet?text=TITLE%20-%20PERMALINK%20  SHARETAG',
     674
     675
    338676
    339677            'spriteCoordinates' => Array(
    340678
     679
     680
    341681                '16' => array("-144px","-16px"),
    342682
     683
     684
    343685                '32' => array("-288px","-32px"),
    344686
     687
     688
    345689                '48' => array("-432px","-48px"),
    346690
     691
     692
    347693                '64' => array("-576px","-64px")
    348694
     695
     696
    349697            )
    350698
     699
     700
    351701        ),
     702
    352703                'Twitter Counter'     => array(
    353704
     705
     706
    354707            'counter' =>1,
    355708
     709
     710
    356711            'favicon' => 'twitter.png',
    357712
    358             'url' => '<a href="https://twitter.com/share" data-text="TITLECOUNT - PERMALINKCOUNT  *blogplay.com* blogplay.com" data-url="PERMALINKCOUNT" class="twitter-share-button" data-count="horizontal">Tweet</a><script type="text/javascript" src="//platform.twitter.com/widgets.js"></script>',
     713
     714
     715            'url' => '<a href="https://twitter.com/share" data-text="TITLECOUNT - PERMALINKCOUNT" data-url="PERMALINKCOUNT" class="twitter-share-button" data-count="horizontal">Tweet</a><script type="text/javascript" src="//platform.twitter.com/widgets.js"></script>',
     716
     717
    359718
    360719            'spriteCoordinates' => Array(
    361720
     721
     722
    362723                '16' => array("-144px","-16px"),
    363724
     725
     726
    364727                '32' => array("-288px","-32px"),
    365728
     729
     730
    366731                '48' => array("-432px","-48px"),
    367732
     733
     734
    368735                '64' => array("-576px","-64px")
    369736
     737
     738
    370739            )
    371740
     741
     742
    372743        ),
    373744
     745
     746
    374747        'LinkedIn'    => array(
    375748
     749
     750
    376751            'favicon' => 'linkedin.png',
    377752
     753
     754
    378755            'url' => 'http://www.linkedin.com/shareArticle?mini=true&amp;url=PERMALINK&amp;title=TITLE&amp;source=BLOGNAME&amp;summary=EXCERPT',
    379756
     757
     758
    380759            'spriteCoordinates' => Array(
    381760
     761
     762
    382763                '16' => array("-144px","0px"),
    383764
     765
     766
    384767                '32' => array("-288px","0px"),
    385768
     769
     770
    386771                '48' => array("-432px","0px"),
    387772
     773
     774
    388775                '64' => array("-576px","0px")
    389776
     777
     778
    390779            )
    391780
     781
     782
    392783        ),
     784
    393785                'LinkedIn Counter'    => array(
    394786
     787
     788
    395789                'counter'=>1,
    396790
     791
     792
    397793            'favicon' => 'linkedin.png',
    398794
     795
     796
    399797            'url' => '<script src="http://platform.linkedin.com/in.js" type="text/javascript"></script><script type="IN/Share" data-url="PERMALINKCOUNT" data-counter="right"></script>',
    400798
     799
     800
    401801            'spriteCoordinates' => Array(
     802
    402803                '16' => array("-144px","0px"),
    403804
     805
     806
    404807                '32' => array("-288px","0px"),
    405808
     809
     810
    406811                '48' => array("-432px","0px"),
    407812
     813
     814
    408815                '64' => array("-576px","0px")
    409816
     817
     818
    410819            )
    411820
     821
     822
    412823        ),
     824
    413825        'Delicious'   => array(
     826
    414827            'favicon' => 'delicious.png',
    415828
     829
     830
    416831            'url' => 'http://delicious.com/post?url=PERMALINK&amp;title=TITLE&amp;notes=EXCERPT',
    417832
     833
     834
    418835            'spriteCoordinates' => Array(
    419836
     837
     838
    420839                '16' => array("-16px","0px"),
    421840
     841
     842
    422843                '32' => array("-32px","0px"),
    423844
     845
     846
    424847                '48' => array("-48px","0px"),
    425848
     849
     850
    426851                '64' => array("-64px","0px")
    427852
     853
     854
    428855            )
    429856
     857
     858
    430859        ),       
     860
    431861        'Digg'        => array(
     862
    432863            'favicon' => 'digg.png',
    433864
     865
     866
    434867            'url' => 'http://digg.com/submit?phase=2&amp;url=PERMALINK&amp;title=TITLE&amp;bodytext=EXCERPT',
    435868
     869
     870
    436871            'spriteCoordinates' => Array(
    437872
     873
     874
    438875                '16' => array("-32px","0px"),
    439876
     877
     878
    440879                '32' => array("-64px","0px"),
    441880
     881
     882
    442883                '48' => array("-96px","0px"),
    443884
     885
     886
    444887                '64' => array("-128px","0px")
    445888
     889
     890
    446891            )
    447892
     893
     894
    448895        ),
    449896
     897
     898
    450899        'Digg Counter'        => array(
    451900
     901
     902
    452903            'counter' =>1,
    453904
     905
     906
    454907            'favicon' => 'digg.png',
    455908
     909
     910
    456911            'url' => "<script type='text/javascript'>(function() {var s = document.createElement('SCRIPT'), s1 = document.getElementsByTagName('SCRIPT')[0];s.type = 'text/javascript';s.async = true;s.src = 'http://widgets.digg.com/buttons.js';s1.parentNode.insertBefore(s, s1);})();</script><a href='http://digg.com/submit?url=PERMALINK&amp;title=TITLE'  class='DiggThisButton DiggCompact'></a>",
     912
    457913            'spriteCoordinates' => Array(
    458914
     915
     916
    459917                '16' => array("-32px","0px"),
    460918
     919
     920
    461921                '32' => array("-64px","0px"),
    462922
     923
     924
    463925                '48' => array("-96px","0px"),
    464926
     927
     928
    465929                '64' => array("-128px","0px")
    466930
     931
     932
    467933            )
    468934
     935
     936
    469937        ),
     938
    470939        'Reddit'      => array(
     940
    471941            'favicon' => 'reddit.png',
    472942
     943
     944
    473945 
    474946
     947
     948
    475949            'url' => 'http://reddit.com/submit?url=PERMALINK&amp;title=TITLE',
    476950
     951
     952
    477953            'spriteCoordinates' => Array(
    478954
     955
     956
    479957                '16' => array("-64px","-16px"),
    480958
     959
     960
    481961                '32' => array("-128px","-32px"),
    482962
     963
     964
    483965                '48' => array("-192px","-48px"),
    484966
     967
     968
    485969                '64' => array("-256px","-64px")
    486970
     971
     972
    487973            )
    488974
     975
     976
    489977        ),
    490978
     979
     980
    491981       
    492982
     983
     984
    493985        'StumbleUpon'  => array(
    494986
     987
     988
    495989            'favicon' => 'stumbleupon.png',
    496990
     991
     992
    497993            'url' => 'http://www.stumbleupon.com/submit?url=PERMALINK&title=TITLE',
    498994
     995
     996
    499997            'spriteCoordinates' => Array(
    500998
     999
     1000
    5011001                '16' => array("-112px","-16px"),
    5021002
     1003
     1004
    5031005                '32' => array("-224px","-32px"),
    5041006
     1007
     1008
    5051009                '48' => array("-336px","-48px"),
    5061010
     1011
     1012
    5071013                '64' => array("-448px","-64px")
    5081014
     1015
     1016
    5091017            )),
    5101018
     1019
     1020
    5111021           
    5121022
     1023
     1024
    5131025                    'StumbleUpon Counter'  => array(
    5141026
     1027
     1028
    5151029            'counter' =>1,
    5161030
     1031
     1032
    5171033            'favicon' => 'stumbleupon.png',
    5181034
     1035
     1036
    5191037            'url' => '<script src="http://www.stumbleupon.com/hostedbadge.php?s=2&r=PERMALINKCOUNT"></script>',
    5201038
     1039
     1040
    5211041            'spriteCoordinates' => Array(
    5221042
     1043
     1044
    5231045                '16' => array("-112px","-16px"),
    5241046
     1047
     1048
    5251049                '32' => array("-224px","-32px"),
    5261050
     1051
     1052
    5271053                '48' => array("-336px","-48px"),
    5281054
     1055
     1056
    5291057                '64' => array("-448px","-64px")
    5301058
     1059
     1060
    5311061            )
    5321062
     1063
     1064
    5331065        ),
    5341066
     1067
     1068
    5351069         'Google Bookmarks' => Array (
    5361070
     1071
     1072
    5371073                    'favicon' => 'google.png',
    5381074
     1075
     1076
    5391077                    'url' => 'http://www.google.com/bookmarks/mark?op=edit&amp;bkmk=PERMALINK&amp;title=TITLE&amp;annotation=EXCERPT',
    5401078
     1079
     1080
    5411081                    'description' => 'Google Bookmarks',
    5421082
     1083
     1084
    5431085                    'spriteCoordinates' => Array(
    5441086
     1087
     1088
    5451089                '16' => array("-96px","0px"),
    5461090
     1091
     1092
    5471093                '32' => array("-192px","0px"),
    5481094
     1095
     1096
    5491097                '48' => array("-288px","0px"),
    5501098
     1099
     1100
    5511101                '64' => array("-384px","0px")
    5521102
     1103
     1104
    5531105            )
    5541106
     1107
     1108
    5551109            ),
    5561110
     1111
     1112
    5571113           
    5581114
     1115
     1116
    5591117            'Google +' => Array (
    5601118
     1119
     1120
    5611121           
    5621122
     1123
     1124
    5631125                    'counter' =>1,
    5641126
     1127
     1128
    5651129                    'favicon' => 'google.png',
    5661130
     1131
     1132
    5671133                /*    'url' => '<script type="text/javascript" src="https://apis.google.com/js/plusone.js"></script>
    5681134
     1135
     1136
    5691137<g:plusone annotation="bubble" size="medium"></g:plusone>',*/
    5701138
     1139
     1140
    5711141                    'url' => '<g:plusone annotation="bubble" href="PERMALINKCOUNT" size="medium"></g:plusone>',
    5721142
     1143
     1144
    5731145/*
    5741146
     1147
     1148
    5751149    <script type="text/javascript">
    5761150
     1151
     1152
    5771153      window.___gcfg = {
    5781154
     1155
     1156
    5791157        lang: \'en-US\'
    5801158
     1159
     1160
    5811161      };
    5821162
     1163
     1164
    5831165      (function() {
    5841166
     1167
     1168
    5851169        var po = document.createElement(\'script\'); po.type = \'text/javascript\'; po.async = true;
    5861170
     1171
     1172
    5871173        po.src = \'https://apis.google.com/js/plusone.js\';
    5881174
     1175
     1176
    5891177        var s = document.getElementsByTagName(\'script\')[0]; s.parentNode.insertBefore(po, s);
    5901178
     1179
     1180
    5911181      })();
    5921182
     1183
     1184
    5931185    </script>
    5941186
     1187
     1188
    5951189',*/
    5961190
     1191
     1192
    5971193                    'description' => 'Google Bookmarks',
    5981194
     1195
     1196
    5991197                    'spriteCoordinates' => Array(
    6001198
     1199
     1200
    6011201                '16' => array("-96px","0px"),
    6021202
     1203
     1204
    6031205                '32' => array("-192px","0px"),
    6041206
     1207
     1208
    6051209                '48' => array("-288px","0px"),
    6061210
     1211
     1212
    6071213                '64' => array("-384px","0px")
    6081214
     1215
     1216
    6091217            )
    6101218
     1219
     1220
    6111221            ),
    6121222
     1223
     1224
    6131225           
    6141226
     1227
     1228
    6151229                        'HackerNews' => Array(
    6161230
     1231
     1232
    6171233                    'favicon' => 'hacker_news.png',
    6181234
     1235
     1236
    6191237                    'url' => 'http://news.ycombinator.com/submitlink?u=PERMALINK&amp;t=TITLE',
    6201238
     1239
     1240
    6211241                   'spriteCoordinates' => Array(
    6221242
     1243
     1244
    6231245                '16' => array("-128px","0px"),
    6241246
     1247
     1248
    6251249                '32' => array("-256px","0px"),
    6261250
     1251
     1252
    6271253                '48' => array("-384px","0px"),
    6281254
     1255
     1256
    6291257                '64' => array("-512px","0px")
    6301258
     1259
     1260
    6311261            )
    6321262
     1263
     1264
    6331265            ),
    6341266
     1267
     1268
    6351269               'MSNReporter' => Array(
    6361270
     1271
     1272
    6371273                    'favicon' => 'msn.png',
    6381274
     1275
     1276
    6391277                    'url' => 'http://reporter.es.msn.com/?fn=contribute&amp;Title=TITLE&amp;URL=PERMALINK&amp;cat_id=6&amp;tag_id=31&amp;Remark=EXCERPT',
    6401278
     1279
     1280
    6411281                    'description' => 'MSN Reporter',
    6421282
     1283
     1284
    6431285                    'spriteCoordinates' => Array(
    6441286
     1287
     1288
    6451289                '16' => array("-176px","0px"),
    6461290
     1291
     1292
    6471293                '32' => array("-352px","0px"),
    6481294
     1295
     1296
    6491297                '48' => array("-528px","0px"),
    6501298
     1299
     1300
    6511301                '64' => array("-704px","0px")
    6521302
     1303
     1304
    6531305            )
    6541306
     1307
     1308
    6551309            ),
    6561310
     1311
     1312
    6571313           
    6581314
     1315
     1316
    6591317             'BlinkList' => Array(
    6601318
     1319
     1320
    6611321                    'favicon' => 'blinklist.png',
    6621322
     1323
     1324
    6631325                    'url' => 'http://www.blinklist.com/index.php?Action=Blink/addblink.php&amp;Url=PERMALINK&amp;Title=TITLE',
    6641326
     1327
     1328
    6651329                    'spriteCoordinates' => Array(
    6661330
     1331
     1332
    6671333                '16' => array("0px","0px"),
    6681334
     1335
     1336
    6691337                '32' => array("0px","0px"),
    6701338
     1339
     1340
    6711341                '48' => array("0px","0px"),
    6721342
     1343
     1344
    6731345                '64' => array("0px","0px")
    6741346
     1347
     1348
    6751349            ),
    6761350
     1351
     1352
    6771353                    'supportsIframe' => false,
    6781354
     1355
     1356
    6791357            ),
    6801358
     1359
     1360
    6811361            'Sphinn' => Array(
    6821362
     1363
     1364
    6831365                    'favicon' => 'sphinn.png',
    6841366
     1367
     1368
    6851369                    'url' => 'http://sphinn.com/index.php?c=post&amp;m=submit&amp;link=PERMALINK',
    6861370
     1371
     1372
    6871373                    'spriteCoordinates' => Array(
    6881374
     1375
     1376
    6891377                '16' => array("-96px","-16px"),
    6901378
     1379
     1380
    6911381                '32' => array("-192px","-32px"),
    6921382
     1383
     1384
    6931385                '48' => array("-288px","-48px"),
    6941386
     1387
     1388
    6951389                '64' => array("-384px","-64px")
    6961390
     1391
     1392
    6971393            )
    6981394
     1395
     1396
    6991397            ),
    7001398
     1399
     1400
    7011401           
    7021402
     1403
     1404
    7031405            'Posterous' => Array(
    7041406
     1407
     1408
    7051409                    'favicon' => 'posterous.png',
    7061410
     1411
     1412
    7071413                    'url' => 'http://posterous.com/share?linkto=PERMALINK&amp;title=TITLE&amp;selection=EXCERPT',
    7081414
     1415
     1416
    7091417                    'spriteCoordinates' => Array(
    7101418
     1419
     1420
    7111421                '16' => array("-32px","-16px"),
    7121422
     1423
     1424
    7131425                '32' => array("-64px","-32px"),
    7141426
     1427
     1428
    7151429                '48' => array("-96px","-48px"),
    7161430
     1431
     1432
    7171433                '64' => array("-128px","-64px")
    7181434
     1435
     1436
    7191437            )
    7201438
     1439
     1440
    7211441            ),
    7221442
     1443
     1444
    7231445            'Tumblr' => Array(
    7241446
     1447
     1448
    7251449                    'favicon' => 'tumblr.png',
    7261450
     1451
     1452
    7271453                    'url' => 'http://www.tumblr.com/share?v=3&amp;u=PERMALINK&amp;t=TITLE&amp;s=EXCERPT',
    7281454
     1455
     1456
    7291457                   'spriteCoordinates' => Array(
    7301458
     1459
     1460
    7311461                '16' => array("-128px","-16px"),
    7321462
     1463
     1464
    7331465                '32' => array("-256px","-32px"),
    7341466
     1467
     1468
    7351469                '48' => array("-384px","-48px"),
    7361470
     1471
     1472
    7371473                '64' => array("-512px","-64px")
    7381474
     1475
     1476
    7391477                ),
    7401478
     1479
     1480
    7411481                    'supportsIframe' => false
    7421482
     1483
     1484
    7431485            ),
    7441486
     1487
     1488
    7451489            'email' => Array(
    7461490
     1491
     1492
    7471493                    'favicon' => 'gmail.png',
    7481494
     1495
     1496
    7491497                    'url' => 'https://mail.google.com/mail/?view=cm&fs=1&to&su=TITLE&body=PERMALINK&ui=2&tf=1&shva=1',
    7501498
     1499
     1500
    7511501                    'spriteCoordinates' => Array(
    7521502
     1503
     1504
    7531505                '16' => array("-80px","0px"),
    7541506
     1507
     1508
    7551509                '32' => array("-160px","0px"),
    7561510
     1511
     1512
    7571513                '48' => array("-240px","0px"),
    7581514
     1515
     1516
    7591517                '64' => array("-320px","0px")
    7601518
     1519
     1520
    7611521            ),
    7621522
     1523
     1524
    7631525                    'supportsIframe' => false
    7641526
     1527
     1528
    7651529            ),
    7661530
     1531
     1532
    7671533           
    7681534
     1535
     1536
    7691537            'Google Reader' => array (
    7701538
     1539
     1540
    7711541                    'favicon' => 'googlebuzz.png',
    7721542
     1543
     1544
    7731545                        'url' => 'http://www.google.com/reader/link?url=PERMALINK&amp;title=TITLE&amp;srcURL=PERMALINK&amp;srcTitle=BLOGNAME',
    7741546
     1547
     1548
    7751549                'spriteCoordinates' => Array(
    7761550
     1551
     1552
    7771553                '16' => array("-112px","0px"),
    7781554
     1555
     1556
    7791557                '32' => array("-224px","0px"),
    7801558
     1559
     1560
    7811561                '48' => array("-336px","0px"),
    7821562
     1563
     1564
    7831565                '64' =>  array("-448px","0px")
    7841566
     1567
     1568
    7851569            )
    7861570
     1571
     1572
    7871573            ),
    7881574
     1575
     1576
    7891577             'Add to favorites' => array(
    7901578
     1579
     1580
    7911581             'favicon' => 'favorites.png',
    7921582
     1583
     1584
    7931585             'url' => 'javascript:AddToFavorites();',
    7941586
     1587
     1588
    7951589             'spriteCoordinates' => Array(
    7961590
     1591
     1592
    7971593                '16' => array("-64px","0px"),
    7981594
     1595
     1596
    7991597                '32' => array("-128px","0px"),
    8001598
     1599
     1600
    8011601                '48' => array("-192px","0px"),
    8021602
     1603
     1604
    8031605                '64' => array("-256px","0px")
    8041606
     1607
     1608
    8051609            )
    8061610
     1611
     1612
    8071613         ),
    8081614
     1615
     1616
    8091617             'More' => array(
    8101618
     1619
     1620
    8111621             'favicon' => 'more.png',
    8121622
     1623
     1624
    8131625             'url' => 'javascript:more();',
    8141626
     1627
     1628
    8151629            'spriteCoordinates' => Array(
    8161630
     1631
     1632
    8171633                '16' => array("0px","0px"),
    8181634
     1635
     1636
    8191637                '32' => array("0px","0px"),
    8201638
     1639
     1640
    8211641                '48' =>  array("0px","0px"),
    8221642
     1643
     1644
    8231645                '64' => array("0px","0px")
    8241646
     1647
     1648
    8251649            )
    8261650
     1651
     1652
    8271653         ),
    8281654
     1655
     1656
    8291657    );
     1658
    8301659 
     1660
    8311661   
     1662
    8321663    //Update will create if it doesn't exist.
    8331664
     1665
     1666
    8341667   
     1668
    8351669    update_option( 'sociable_known_sites' , $sociable_known_sites );
     1670
    8361671    update_option( 'sociable_options'     , $sociable_options );
     1672
    8371673    update_option( 'sociable_helpus'      , 1);
     1674
    8381675}
    8391676
     1677
     1678
    8401679function skyscraper_reset(){
    8411680
     1681
     1682
    8421683    $skyscraper_options = array(
     1684
    8431685                        "version"                   => "1.0",
     1686
    8441687                        "widget_width"              => "60px",
     1688
    8451689                        "widget_position"           => "1",
     1690
    8461691                        "background_color"          => "#fefefe",
     1692
    8471693                        "labels_color"              => "#f7f7f7",
     1694
    8481695                        "text_size"                 => "10px",
     1696
    8491697                        "counters"                  => array("check" => "0",
     1698
    8501699                                                            "folded" => "0"),
     1700
    8511701                        "share"                     => array("check" => "0",
     1702
    8521703                                                            "folded" => "0"),
     1704
    8531705                        "num_tweets"                => 3,
     1706
    8541707                        "num_rss"                   =>3,
     1708
    8551709                        "locations"                 => array("is_front_page" => 1,
     1710
    8561711                                                            "is_home"        => 1,
     1712
    8571713                                                            "is_single"      => 1,
     1714
    8581715                                                            "is_page"        => 1,
     1716
    8591717                                                            "is_category"    => 1,
     1718
    8601719                                                            "is_date"        => 1,
     1720
    8611721                                                            "is_tag"         => 1,
     1722
    8621723                                                            "is_author"      => 1,
     1724
    8631725                                                            "is_search"      => 1,
     1726
    8641727                                                            "is_rss"         => 1  ),
     1728
    8651729                                                           
     1730
    8661731                      "counters"                    => array("check" => 1,
     1732
    8671733                                                             "folded" => 1),
     1734
    8681735                      "share"                       => array("check" => 1,
     1736
    8691737                                                             "folded" => 1),
    8701738
     1739
     1740
    8711741                      "sociable_banner"             => "",
    8721742
     1743
     1744
    8731745                      "sociable_banner_timer"       => 15,
    8741746
     1747
     1748
    8751749                      "sociable_banner_text"        => 'Please spread the word: Be Sociable, Share!',
    8761750
     1751
     1752
    8771753                      "sociable_banner_colorBack"   => '#FFFFFF',             
    8781754
     1755
     1756
    8791757                      "sociable_banner_fontSize"    => '9px',
    8801758
     1759
     1760
    8811761                      "sociable_banner_colorLabel"  => '#F7F7F7',
     1762
    8821763                     
     1764
    8831765                      "sociable_banner_colorFont"   => '#6A6A6A',
     1766
    8841767                     
     1768
    8851769                      "accept_read_twitter"         => '',
     1770
    8861771                     
     1772
    8871773                      "accept_read_rss"             => ''
     1774
    8881775    );
    8891776
     1777
     1778
    8901779    update_option( 'skyscraper_options'   , $skyscraper_options );
     1780
    8911781   
     1782
    8921783       
     1784
    8931785    $skyscraper_latest = array();
     1786
    8941787    update_option("skyscraper_latest",$skyscraper_latest );
     1788
    8951789   
     1790
    8961791    $skyscraper_mentions = array();
     1792
    8971793    update_option("skyscraper_mentions",$skyscraper_mentions );
     1794
    8981795}
    8991796
     1797
     1798
    9001799/*
     1800
    9011801 * De-Activate Function
     1802
    9021803 */
     1804
    9031805function sociable_deactivate(){
     1806
    9041807//    global $wpdb;
     1808
    9051809//    //Delete The Metadata
     1810
    9061811//    $wpdb->query("DELETE FROM $wpdb->postmeta WHERE meta_key = '_sociableoff'");
     1812
    9071813//    //delete The Options
     1814
    9081815//    return delete_option( 'sociable_options' );
     1816
    9091817}
    9101818
     1819
     1820
    9111821/*
     1822
    9121823 * Function To Completely Remove The Options
     1824
    9131825 */
     1826
    9141827function sociable_2_remove(){
     1828
    9151829    require_once( ABSPATH . '/wp-admin/includes/plugin.php' );
     1830
    9161831   
     1832
    9171833    global $wpdb;
     1834
    9181835    //Delete The Metadata
     1836
    9191837    $wpdb->query("DELETE FROM $wpdb->postmeta WHERE meta_key = '_sociableoff'");
     1838
    9201839    //delete The Options
     1840
    9211841    delete_option( 'sociable_options' );
     1842
    9221843    delete_option( 'skyscraper_options' );
     1844
    9231845   
     1846
    9241847 
    9251848
     1849
     1850
    9261851    deactivate_plugins( array( 'sociable/sociable.php' ) );
     1852
    9271853    wp_redirect( '/wp-admin/plugins.php?deactivate=true' );
     1854
    9281855}
    9291856
     1857
     1858
    9301859/*
     1860
    9311861 * Generic Plugin Wide Functions
     1862
    9321863 */
     1864
    9331865function _get_sociable_image_path(){
    9341866
     1867
     1868
    9351869    global $sociable_options;
    9361870
     1871
     1872
    9371873       
    9381874
     1875
     1876
    9391877    if( empty( $sociable_options['custom_icons'] )){
    9401878
     1879
     1880
    9411881        if ($sociable_options['icon_option'] !="option6"){
    9421882
     1883
     1884
    9431885        $path = trailingslashit( SOCIABLE_HTTP_PATH . 'images/'.$sociable_options['icon_option']."/" . $sociable_options['icon_size'] );
    9441886
     1887
     1888
    9451889        }else{
    9461890
     1891
     1892
    9471893       
    9481894
     1895
     1896
    9491897        $path = trailingslashit( SOCIABLE_HTTP_PATH . 'images/original/');
    9501898
     1899
     1900
    9511901        }
    9521902
     1903
     1904
    9531905    } else {
    9541906
     1907
     1908
    9551909        $path = trailingslashit( SOCIABLE_HTTP_PATH . 'images/customIcons/');
    9561910
     1911
     1912
    9571913    }
    9581914
     1915
     1916
    9591917 
    9601918
     1919
     1920
    9611921     
    9621922
     1923
     1924
    9631925    return $path;
    9641926
     1927
     1928
    9651929}
    9661930
     1931
     1932
    9671933function _get_sociable_image( $site, $description ){
    9681934
     1935
     1936
    9691937global $sociable_options;
    9701938
     1939
     1940
    9711941    $imageclass = '';
     1942
    9721943    $imagestyle = '';
     1944
    9731945    $imagepath = _get_sociable_image_path();
     1946
    9741947    //Get The Source Of The Image
     1948
    9751949    if ( ! isset( $site['spriteCoordinates'] ) || ! isset( $sociable_options['use_sprites'] ) || is_feed() ) {
    9761950
     1951
     1952
    9771953        if ( strpos( $site['favicon'], 'http' ) === 0 ) {
     1954
    9781955                $imagesource = $site['favicon'];
     1956
    9791957        } else {
     1958
    9801959                $imagesource = $imagepath.$site['favicon'];
     1960
    9811961        }
    9821962
     1963
     1964
    9831965    } else {
    9841966
     1967
     1968
    9851969        $imagesource = $imagepath . "services-sprite.gif";
     1970
    9861971        $services_sprite_url = $imagepath . "sprite.png";
    9871972
     1973
     1974
    9881975        $spriteCoords = $site['spriteCoordinates'];
     1976
    9891977       
     1978
    9901979        $size = $sociable_options['icon_size'];
    9911980
     1981
     1982
    9921983        $imagestyle = 'width: ' . $size . 'px; height: ' . $size . 'px; background: transparent url(' . $services_sprite_url . ') no-repeat; background-position:' . $spriteCoords[$size] . 'px 0';
    9931984
     1985
     1986
    9941987    }
     1988
    9951989   
    9961990
     1991
     1992
    9971993    if( isset( $sociable_options['use_alphamask'] ) ){
     1994
    9981995        $imageclass .= 'sociable-hovers';         
     1996
    9991997    }
    10001998
     1999
     2000
    10012001    //If A Class Has Been Specified, Ensure It Is Added To The Class Attribute.
     2002
    10022003    if ( isset( $site['class'] ) ) {
     2004
    10032005        $imageclass .= 'sociable_' . $site['class'];
     2006
    10042007    }
     2008
    10052009 
     2010
    10062011    if( $imagestyle != '' ){
     2012
    10072013        $imagestyle = 'style="' . $imagestyle . '"';
     2014
    10082015    }
     2016
    10092017    if ($sociable_options['icon_option'] !="option6"){
    10102018
     2019
     2020
    10112021    $image = '<img  src="' . $imagesource . '" title="' . $description . '" alt="' . $description . '"' . $imagestyle . ' />' ;
    10122022
     2023
     2024
    10132025    }else{
    10142026
     2027
     2028
    10152029    $image = '<img class="' . $imageclass . '" src="' . $imagesource . '" title="' . $description . '" alt="' . $description . '"' . $imagestyle . ' />' ;
    10162030
     2031
     2032
    10172033    }
     2034
    10182035   
     2036
    10192037    return $image;
     2038
    10202039}
    10212040
     2041
     2042
    10222043?>
Note: See TracChangeset for help on using the changeset viewer.