WordPress.org

Plugin Directory

Changeset 573181


Ignore:
Timestamp:
07/16/12 18:43:57 (22 months ago)
Author:
TimZ
Message:

Version 2.0.14

Location:
sociable-zyblog-edition/trunk
Files:
4 added
5 deleted
5 edited
2 moved

Legend:

Unmodified
Added
Removed
  • sociable-zyblog-edition/trunk/css/sociable.css

    r414953 r573181  
    5252    margin: 0; 
    5353    padding: 0; 
     54    border: none; 
    5455} 
    5556 
  • sociable-zyblog-edition/trunk/js/tool-man/coordinates.js

    r46633 r573181  
    88        // FIXME: Safari won't parse 'throw' and aborts trying to do anything with this file 
    99        //if (isNaN(x) || isNaN(y)) throw "invalid x,y: " + x + "," + y 
    10         return new _ToolManCoordinate(this, x, y) 
     10        return new _ToolManCoordinate(this, x, y); 
    1111    }, 
    1212 
    1313    origin : function() { 
    14         return this.create(0, 0) 
     14        return this.create(0, 0); 
    1515    }, 
    1616 
     
    1919     */ 
    2020    topLeftPosition : function(element) { 
    21         var left = parseInt(ToolMan.css().readStyle(element, "left")) 
    22         var left = isNaN(left) ? 0 : left 
    23         var top = parseInt(ToolMan.css().readStyle(element, "top")) 
    24         var top = isNaN(top) ? 0 : top 
     21        var left = parseInt(ToolMan.css().readStyle(element, "left")); 
     22        var left = isNaN(left) ? 0 : left; 
     23        var top = parseInt(ToolMan.css().readStyle(element, "top")); 
     24        var top = isNaN(top) ? 0 : top; 
    2525 
    26         return this.create(left, top) 
     26        return this.create(left, top); 
    2727    }, 
    2828 
    2929    bottomRightPosition : function(element) { 
    30         return this.topLeftPosition(element).plus(this._size(element)) 
     30        return this.topLeftPosition(element).plus(this._size(element)); 
    3131    }, 
    3232 
    3333    topLeftOffset : function(element) { 
    34         var offset = this._offset(element)  
     34        var offset = this._offset(element);  
    3535 
    36         var parent = element.offsetParent 
     36        var parent = element.offsetParent; 
    3737        while (parent) { 
    38             offset = offset.plus(this._offset(parent)) 
    39             parent = parent.offsetParent 
     38            offset = offset.plus(this._offset(parent)); 
     39            parent = parent.offsetParent; 
    4040        } 
    41         return offset 
     41        return offset; 
    4242    }, 
    4343 
    4444    bottomRightOffset : function(element) { 
    4545        return this.topLeftOffset(element).plus( 
    46                 this.create(element.offsetWidth, element.offsetHeight)) 
     46                this.create(element.offsetWidth, element.offsetHeight)); 
    4747    }, 
    4848 
    4949    scrollOffset : function() { 
    5050        if (window.pageXOffset) { 
    51             return this.create(window.pageXOffset, window.pageYOffset) 
     51            return this.create(window.pageXOffset, window.pageYOffset); 
    5252        } else if (document.documentElement) { 
    5353            return this.create( 
    5454                    document.body.scrollLeft + document.documentElement.scrollLeft,  
    55                     document.body.scrollTop + document.documentElement.scrollTop) 
     55                    document.body.scrollTop + document.documentElement.scrollTop); 
    5656        } else if (document.body.scrollLeft >= 0) { 
    57             return this.create(document.body.scrollLeft, document.body.scrollTop) 
     57            return this.create(document.body.scrollLeft, document.body.scrollTop); 
    5858        } else { 
    59             return this.create(0, 0) 
     59            return this.create(0, 0); 
    6060        } 
    6161    }, 
     
    6363    clientSize : function() { 
    6464        if (window.innerHeight >= 0) { 
    65             return this.create(window.innerWidth, window.innerHeight) 
     65            return this.create(window.innerWidth, window.innerHeight); 
    6666        } else if (document.documentElement) { 
    6767            return this.create(document.documentElement.clientWidth, 
    68                     document.documentElement.clientHeight) 
     68                    document.documentElement.clientHeight); 
    6969        } else if (document.body.clientHeight >= 0) { 
    7070            return this.create(document.body.clientWidth, 
    71                     document.body.clientHeight) 
     71                    document.body.clientHeight); 
    7272        } else { 
    73             return this.create(0, 0) 
     73            return this.create(0, 0); 
    7474        } 
    7575    }, 
     
    8282     */ 
    8383    mousePosition : function(event) { 
    84         event = ToolMan.events().fix(event) 
    85         return this.create(event.clientX, event.clientY) 
     84        event = ToolMan.events().fix(event); 
     85        return this.create(event.clientX, event.clientY); 
    8686    }, 
    8787 
     
    9090     */ 
    9191    mouseOffset : function(event) { 
    92         event = ToolMan.events().fix(event) 
     92        event = ToolMan.events().fix(event); 
    9393        if (event.pageX >= 0 || event.pageX < 0) { 
    94             return this.create(event.pageX, event.pageY) 
     94            return this.create(event.pageX, event.pageY); 
    9595        } else if (event.clientX >= 0 || event.clientX < 0) { 
    96             return this.mousePosition(event).plus(this.scrollOffset()) 
     96            return this.mousePosition(event).plus(this.scrollOffset()); 
    9797        } 
    9898    }, 
     
    100100    _size : function(element) { 
    101101    /* TODO: move to a Dimension class */ 
    102         return this.create(element.offsetWidth, element.offsetHeight) 
     102        return this.create(element.offsetWidth, element.offsetHeight); 
    103103    }, 
    104104 
    105105    _offset : function(element) { 
    106         return this.create(element.offsetLeft, element.offsetTop) 
     106        return this.create(element.offsetLeft, element.offsetTop); 
    107107    } 
    108 } 
     108}; 
    109109 
    110110function _ToolManCoordinate(factory, x, y) { 
    111     this.factory = factory 
    112     this.x = isNaN(x) ? 0 : x 
    113     this.y = isNaN(y) ? 0 : y 
     111    this.factory = factory; 
     112    this.x = isNaN(x) ? 0 : x; 
     113    this.y = isNaN(y) ? 0 : y; 
    114114} 
    115115 
    116116_ToolManCoordinate.prototype = { 
    117117    toString : function() { 
    118         return "(" + this.x + "," + this.y + ")" 
     118        return "(" + this.x + "," + this.y + ")"; 
    119119    }, 
    120120 
    121121    plus : function(that) { 
    122         return this.factory.create(this.x + that.x, this.y + that.y) 
     122        return this.factory.create(this.x + that.x, this.y + that.y); 
    123123    }, 
    124124 
    125125    minus : function(that) { 
    126         return this.factory.create(this.x - that.x, this.y - that.y) 
     126        return this.factory.create(this.x - that.x, this.y - that.y); 
    127127    }, 
    128128 
    129129    min : function(that) { 
    130130        return this.factory.create( 
    131                 Math.min(this.x , that.x), Math.min(this.y , that.y)) 
     131                Math.min(this.x , that.x), Math.min(this.y , that.y)); 
    132132    }, 
    133133 
    134134    max : function(that) { 
    135135        return this.factory.create( 
    136                 Math.max(this.x , that.x), Math.max(this.y , that.y)) 
     136                Math.max(this.x , that.x), Math.max(this.y , that.y)); 
    137137    }, 
    138138 
    139139    constrainTo : function (one, two) { 
    140         var min = one.min(two) 
    141         var max = one.max(two) 
     140        var min = one.min(two); 
     141        var max = one.max(two); 
    142142 
    143         return this.max(min).min(max) 
     143        return this.max(min).min(max); 
    144144    }, 
    145145 
    146146    distance : function (that) { 
    147         return Math.sqrt(Math.pow(this.x - that.x, 2) + Math.pow(this.y - that.y, 2)) 
     147        return Math.sqrt(Math.pow(this.x - that.x, 2) + Math.pow(this.y - that.y, 2)); 
    148148    }, 
    149149 
    150150    reposition : function(element) { 
    151         element.style["top"] = this.y + "px" 
    152         element.style["left"] = this.x + "px" 
     151        element.style["top"] = this.y + "px"; 
     152        element.style["left"] = this.x + "px"; 
    153153    } 
    154 } 
     154}; 
  • sociable-zyblog-edition/trunk/js/wists.js

    r414953 r573181  
    104104                if (n > 0)  
    105105                { 
    106                         return s  
     106                        return s;  
    107107                }  
    108108                else { 
     
    146146                o.parentNode.removeChild(o); 
    147147        } 
    148 } 
     148}; 
    149149 
    150150function resizeImage(img) { 
     
    162162        var new_img_width = 0; 
    163163        var new_img_height = 0; 
    164         var new_aspect_ratio = 0; 
     164//        var new_aspect_ratio = 0; 
    165165 
    166166        // if no resize needed 
     
    199199        var img = imgs[i]; 
    200200        if (img.className == 'sociable-hovers sociable_wists') { 
    201             img.onclick = function() { Wistlet.init(); return false; } 
     201            img.onclick = function() { Wistlet.init(); return false; }; 
    202202        } 
    203203    } 
  • sociable-zyblog-edition/trunk/readme.txt

    r414956 r573181  
    11=== Sociable Zyblog Edition === 
    22Contributors: TimZ 
     3Donate link: http://www.kiva.org/invitedby/tim5156 
    34Tags: sociable, social, bookmark, bookmarks, bookmarking, social bookmarking, social bookmarks, posts 
    4 Requires at least: 2.2 
    5 Tested up to: 3.2.1 
    6 stable tag: 2.0.13 
     5Requires at least: 2.8 
     6Tested up to: 3.4.1 
     7stable tag: 2.0.14 
     8License: GPLv2 or later 
     9License URI: http://www.gnu.org/licenses/gpl-2.0.html 
    710 
    811Automatically add links on your posts to popular social bookmarking sites. 
     
    1114 
    1215This plugin automatically add links on your posts to popular social bookmarking sites. 
    13 It is an enhanced version of Peter Harkins Sociable plugin. Aside from small changes to the code I added many new bookmarking services. 
     16It is an enhanced version of Peter Harkins Sociable plugin. 
    1417 
    1518= Supported Bookmarking Services = 
    1619 
    17 Now __*133 social bookmarking services*__ are included! Supported services are: 
     20__*100 social bookmarking services*__ are included! Supported services are: 
    1821 
    19 Alltagz, Ask, BarraPunto, blinkbits, BlinkList, Bloglines, blogmarks, BlogMemes, BlogMemes Cn, BlogMemes Fr, BlogMemes Jp, BlogMemes Sp, Blogosphere News, Blogsvine, blogtercimlap, Book.mark.hu, Bumpzee, co.mments, Colivia, connotea, De.lirio.us, del.icio.us, Design Float, Digg, DotNetKicks, DZone, eKudos, email, Facebook, Fark, Faves, feedmelinks, Fleck, Folkd, Furl, Gamebuzz, Global Grind, Google Bookmarks, Gwar, Haohao, HealthRanker, Hemidemi, Hype, IndiaGram, IndianPad, Infopirat, Internetmedia, kick.ie, Kirtsy, Klickts, Laaik.it, Leonaut, Lieblnk, LinkaGoGo, Linkarchiv, Linkarena, LinkedIn, Linkter, Live-MSN, Lufee, Ma.gnolia, Maodi, Meneame, MisterWong, Mixx, muti, MyShare, Myspace, MyTagz, N4G, Netscape, Netselector, Netvouz, newskick, Newsrider, Newstube, NewsVine, NuJIJ, OKnotizie, Oneview, PlugIM, Pownce, ppnow, Print, Propeller, Ratimarks, Readster, Rec6, Reddit, Rojo, SalesMarks, Scoopeo, scuttle, seekXL, Segnalo, SEOigg, Shadows, Simpy, Slashdot, Smarking, Social-Bookmarking.dk, Socialdust, Socializer, Socialogs, SphereIt, Sphinn, Spurl, Squidoo, StumbleUpon, Taggly, TailRank, Tausendreporter, Technorati, ThisNext, TwitThis, Upnews, VoteForIt, Webbrille, Weblinkr, Webnews, Webride, Wikio, Wikio DE, Wikio ES, Wikio FR, Wikio IT, Wikio UK, Wists, Wykop, Xerpi, Yahoo Buzz, YahooMyWeb, YiGG,  
    20  
    21 = Updated Icons = 
    22  
    23 I reviewed most of the original service icons. Now all icons have the same size of 16x16 pixel and are smaller than 1 kb. 
    24 Every combination of services will now show up as a clean line of icons and will load faster. 
    25  
    26 = Note = 
    27  
    28 It was not my intention to create a fork of the plugin code, but I tried to contact Peter Harkins several times and did not get any reaction from him. 
    29  
     22Ask, BarraPunto, BlinkList, Bloglines, Blogosphere News, Blogsvine, Book.mark.hu, Colivia, DZone, De.lirio.us, Design Float, Digg, DotNetKicks, Facebook, Fark, Folkd, Furl, Gamebuzz, Global Grind, Google Bookmarks, Gwar, Haohao, HealthRanker, Hemidemi, Hype, Internetmedia, Kirtsy, Klickts, LinkaGoGo, Linkarchiv, Linkarena, LinkedIn, Linkter, Live-MSN, Lufee, Meneame, MisterWong, Mixx, MyShare, MySpace, MyTagz, N4G, Netscape, Netselector, Netvouz, NewsVine, Newsrider, NuJIJ, Oneview, Print, Ratimarks, Readster, Reddit, Rojo, SEOigg, SalesMarks, Scoopeo, Segnalo, Simpy, Slashdot, Smarking, Social-Bookmarking.dk, Socializer, Socialogs, SphereIt, Squidoo, StumbleUpon, Technorati, ThisNext, Twitter, Upnews, VoteForIt, Webbrille, Weblinkr, Webnews, Webride, Wikio, Wikio DE, Wikio ES, Wikio FR, Wikio IT, Wikio UK, Wists, Wykop, XING, Xerpi, Y!GG, YahooBuzz, YahooMyWeb, blogmarks, blogtercimlap, co.mments, connotea, del.icio.us, eKudos, email, feedmelinks, newskick, scuttle, seekXL 
    3023 
    3124== Installation == 
    3225 
    33 Install 
     26* Install via the admin interface 
     27* If you upload manually by FTP, make sure you upload useing FTP 'binary' mode. 
    3428 
    35 * Unzip the sociable-zyblog-edition.zip file. 
    36 * Upload the the sociable-zyblog-edition folder (not just the files in it!) in your wp-contents/plugins folder. If you're using FTP, use 'binary' mode. 
    37  
    38 Activate 
    39  
    40 * In your WordPress administration, go to the Plugins page 
    41 * Activate the plugin and a submenu called "Sociable" will appear in your Options menu. 
    42  
    43 Upgrade 
    44  
    45 * First deactivate Sociable 
    46 * Remove the sociable-zyblog-edition directory 
    47 * Install and activate the plugin 
    48  
    49 Advanced Users: 
     29= Advanced Users: = 
    5030 
    5131Sociable hooks `the_content()` and `the_excerpt()` to display without requiring theme editing. To heavily customize the display, use the admin panel to turn off the display on all pages, then add calls to your theme files: 
    5232 
    53 `// This is optional extra customization for advanced users 
    54 <?php print sociable_html(); ?> // all active sites 
    55 <?php print sociable_html(Array("Reddit", "del.icio.us")); ?> // only these sites if they are active` 
     33`// This is optional extra customization for advanced users` 
     34`<?php print sociable_html(); ?> // all active sites?` 
     35`<?php print sociable_html(Array("Reddit", "del.icio.us")); ?> // only these sites if they are active` 
    5636 
    5737== Changelog == 
    5838 
    59 Base version was 2.0.2 of Peter Harkins Sociable plugin. 
     39= 2.0.14 = 
     40* 16.07.12 Cleanup: removed 33 no longer existing bookmark sites and fixed other sites; code fixes: removed deprecated code and restructured the files; Now requires at least WordPress Version 2.8 or later 
    6041 
    61 Here are my changes: 
     42= 2.0.13 = 
     43* 25.07.11 Added Xing; small structure change; small internal updates 
    6244 
    63 **Added much more services** 
     45= 2.0.12 = 
     46* 11.01.09 Added MyTagz and small fix for Scuttle 
    6447 
    65 **Reviewed the images** 
     48= 2.0.11 = 
     49* 11.11.08 Fixes and Updates; 3 new services, now 132 services 
    6650 
    67 I added the images for the services above and added the filenames to the required files section in the sociable source code. 
    68 And I resized some of the old images to be 16x16 pixel. Now every combination of services will show up as a clean line of icons. 
    69 I did some compression on the larger images to reduce the filesize. Now all images are below 1 kb. 
     51= 2.0.10 = 
     52* 14.10.08 Bugfix; StumbleUpon button is working again 
    7053 
    71 **Added new keywords to the service descriptions** 
     54= 2.0.9 = 
     55* 16.08.08 31 new services; a little code cleanup 
    7256 
    73 `RAW_TITLE` and `RAW_PERMALINK` can be used now for services which require these strings not to be encoded. For example Bloglines, Folkd and MSN-Live. 
     57= 2.0.8 = 
     58* 18.05.08 initial release on the wordpress plugin directory; renamed the plugin to sociable-zyblog-edition 
     59 
     60= 2.0.7 = 
     61* 09.02.08 some icons caused a validation error 
     62 
     63= 2.0.6 = 
     64* 29.12.07 twenty new services 
     65 
     66= 2.0.5 = 
     67* 25.09.07 new service lufee.de, removed update function, bugfix in sociable.css 
     68 
     69= 2.0.4 = 
     70* 22.08.07 new service: VoteForIt and rel="nofollow" set for all generated links 
    7471 
    7572= 2.0.3 = 
    7673* 24.07.07 new service: SeekXL 
    7774 
    78 = 2.0.4 = 
    79 * 22.08.07 new service: VoteForIt and rel="nofollow" set for all generated links 
     75= 2.0.2 = 
     76* Base version was 2.0.2 of Peter Harkins Sociable plugin. 
     77* Changes: 
     78 * Added much more services** 
     79 * Added the images for the services above and added the filenames to the required files section in the sociable source code. 
     80 * Resized old images to be 16x16 pixel. Now every combination of services will show up as a clean line of icons. 
     81 * Compression of the larger images to reduce the filesize. Now all images are below 1 kb. 
     82 * Added new keywords to the service descriptions `RAW_TITLE` and `RAW_PERMALINK` can be used now for services which require these strings not to be encoded. For example Bloglines, Folkd and MSN-Live. 
    8083 
    81 = 2.0.5 = 
    82 * 25.09.07 new service lufee.de, removed update function, bugfix in sociable.css 
    8384 
    84 = 2.0.6 = 
    85 * 29.12.07 twenty new services 
     85== Upgrade Notice == 
    8686 
    87 = 2.0.7 = 
    88 * 09.02.08 some icons caused a validation error 
    89  
    90 = 2.0.8 = 
    91 * 18.05.08 initial release on the wordpress plugin directory; renamed the plugin to sociable-zyblog-edition 
    92  
    93 = 2.0.9 = 
    94 * 16.08.08 31 new services; a little code cleanup 
    95  
    96 = 2.0.10 = 
    97 * 14.10.08 Bugfix; StumbleUpon button is working again 
    98  
    99 = 2.0.11 = 
    100 * 11.11.08 Fixes and Updates; 3 new services, now 132 services 
    101  
    102 = 2.0.12 = 
    103 * 11.01.09 Added MyTagz and small fix for Scuttle 
    104  
    105 = 2.0.13 = 
    106 * 25.07.11 Added Xing; small structure change; small internal updates 
     87= 2.0.14 = 
     88Bugfix & Maintenance update; internal cleanup, no functional changes; install this update, if you want to get rid of the outdated working bookmark sites; Now requires WordPress Version 2.8 or later! 
  • sociable-zyblog-edition/trunk/sociable.php

    r414953 r573181  
    33Plugin Name: Sociable Zyblog Edition 
    44Plugin URI: http://www.zyblog.de/wordpress-plugins/sociable-zyblog-edition/ 
    5 Description: Automatically add links on your posts to popular social bookmarking sites. Go to Options -> Sociable for setup. 
    6 Version: 2.0.13 
     5Description: Automatically add links on your posts to popular social bookmarking sites. 
     6Version: 2.0.14 
    77Author: Tim Zylinski 
    88Author URI: http://www.zyblog.de 
    9 */ 
    109 
    11 /* 
    1210Copyright 2006 Peter Harkins (ph@malaprop.org) 
    13 Copyright 2009 Tim Zylinski ( websitecontact [a t ] zylinski DOT de) 
     11Copyright 2009-2012 Tim Zylinski ( websitecontact [a t ] zylinski DOT de) 
    1412 
    1513This program is free software; you can redistribute it and/or modify 
     
    2826*/ 
    2927 
    30 // Pre-2.6 compatibility 
    31 if ( ! defined( 'WP_CONTENT_URL' ) ) 
    32       define( 'WP_CONTENT_URL', get_option( 'siteurl' ).DIRECTORY_SEPARATOR.'wp-content' ); 
    33 if ( ! defined( 'WP_CONTENT_DIR' ) ) 
    34       define( 'WP_CONTENT_DIR', ABSPATH.'wp-content' ); 
    35 if ( ! defined( 'WP_PLUGIN_URL' ) ) 
    36       define( 'WP_PLUGIN_URL', WP_CONTENT_URL.'/plugins' ); 
    37 if ( ! defined( 'WP_PLUGIN_DIR' ) ) 
    38       define( 'WP_PLUGIN_DIR', WP_CONTENT_DIR.'/plugins' ); 
    3928 
    4029 
    41 require_once('sociable-sites.php'); 
    42 require_once('sociable-files.php'); 
     30require_once('php/sociable-sites.php'); 
     31require_once('php/sociable-files.php'); 
    4332 
    4433function sociable_init_locale(){ 
    45     load_plugin_textdomain('sociable', 'wp-content/plugins/'.plugin_basename(dirname(__FILE__)).'/i18n'); 
     34    load_plugin_textdomain('sociable', false, dirname( plugin_basename(__FILE__) ) . '/languages'); 
    4635} 
    4736 
     
    9887 
    9988        $html .= "<a href=\"$url\" title=\"$sitename\""; 
    100         if ($site['description']) 
     89        if (isset($site['description']) && $site['description']) 
    10190                    $html .= " onfocus=\"sociable_description_link(this, '{$site['description']}')\""; 
    10291                $html .= " rel=\"nofollow\" target=\"_blank\">"; 
    10392        $html .= "<img src=\"$imagepath{$site['favicon']}\" title=\"$sitename\" alt=\"$sitename\" class=\"sociable-hovers"; 
    104                 if ($site['class']) 
     93                if (isset($site['class']) && $site['class']) 
    10594                    $html .= " sociable_{$site['class']}"; 
    10695                $html .= "\" />"; 
     
    142131    echo '<link rel="stylesheet" type="text/css" media="screen" href="' . get_bloginfo('wpurl') . '/wp-content/plugins/sociable-zyblog-edition/css/sociable.css" />'; 
    143132 
    144 } 
    145  
    146 // load wp rss functions for update checking. 
    147 if (!function_exists('parse_w3cdtf')) { 
    148     require_once(ABSPATH . WPINC . '/rss.php'); 
    149133} 
    150134 
     
    190174} 
    191175 
    192 // Hook the admin_menu display to add admin page 
    193 add_action('admin_menu', 'sociable_admin_menu'); 
    194 function sociable_admin_menu() { 
    195     add_submenu_page('options-general.php', 'Sociable', 'Sociable', 8, 'Sociable', 'sociable_submenu'); 
    196 } 
    197176 
    198 // Admin page header 
    199 add_action('admin_head', 'sociable_admin_head'); 
    200 function sociable_admin_head() { 
    201 ?> 
    202  
    203 <!-- The ToolMan lib provides drag and drop: http://tool-man.org/examples/sorting.html --> 
    204 <script language="JavaScript" type="text/javascript" src="<?php echo get_bloginfo('wpurl'); ?>/wp-content/plugins/sociable-zyblog-edition/tool-man/core.js"></script> 
    205 <script language="JavaScript" type="text/javascript" src="<?php echo get_bloginfo('wpurl'); ?>/wp-content/plugins/sociable-zyblog-edition/tool-man/coordinates.js"></script> 
    206 <script language="JavaScript" type="text/javascript" src="<?php echo get_bloginfo('wpurl'); ?>/wp-content/plugins/sociable-zyblog-edition/tool-man/css.js"></script> 
    207 <script language="JavaScript" type="text/javascript" src="<?php echo get_bloginfo('wpurl'); ?>/wp-content/plugins/sociable-zyblog-edition/tool-man/drag.js"></script> 
    208 <script language="JavaScript" type="text/javascript" src="<?php echo get_bloginfo('wpurl'); ?>/wp-content/plugins/sociable-zyblog-edition/tool-man/dragsort.js"></script> 
    209 <script language="JavaScript" type="text/javascript" src="<?php echo get_bloginfo('wpurl'); ?>/wp-content/plugins/sociable-zyblog-edition/tool-man/events.js"></script> 
    210 <script language="JavaScript" type="text/javascript"><!-- 
    211 var dragsort = ToolMan.dragsort(); 
    212 var junkdrawer = ToolMan.junkdrawer(); 
    213  
    214 function save_reorder(id) { 
    215     site_order = document.getElementById('site_order'); 
    216  
    217     old_order = site_order.value; 
    218     new_order = junkdrawer.serializeList(document.getElementById('sociable_site_list')); 
    219     site_order.value = new_order; 
    220  
    221     if (!site_order.used || new_order == old_order) 
    222         toggle_checkbox(id); 
    223     site_order.used = true; 
    224 } 
    225  
    226 /* make checkbox action prettier */ 
    227 function toggle_checkbox(id) { 
    228     var checkbox = document.getElementById(id); 
    229  
    230     checkbox.checked = !checkbox.checked; 
    231     if (checkbox.checked) 
    232         checkbox.parentNode.className = 'active'; 
    233     else 
    234         checkbox.parentNode.className = 'inactive'; 
    235 } 
    236 --></script> 
    237  
    238 <link rel="stylesheet" type="text/css" media="screen" href="<?php echo get_bloginfo('wpurl'); ?>/wp-content/plugins/sociable-zyblog-edition/css/sociable-admin.css" /> 
    239 <?php 
    240 } 
    241  
    242 function sociable_message($message) { 
    243     echo "<div id=\"message\" class=\"updated fade\"><p>$message</p></div>\n"; 
    244 } 
    245  
    246 // Sanity check the upload worked 
    247 function sociable_upload_errors() { 
    248     global $sociable_files; 
    249  
    250     $cwd = getcwd(); // store current dir for restoration 
    251     if (!@chdir('../wp-content/plugins')) 
    252         return __("Couldn't find wp-content/plugins folder. Please make sure WordPress is installed correctly.", 'sociable'); 
    253     if (!is_dir(plugin_basename(dirname(__FILE__)))) 
    254         return __("Can't find sociable folder.", 'sociable'); 
    255     chdir(plugin_basename(dirname(__FILE__))); 
    256  
    257     foreach($sociable_files as $file) { 
    258         if (substr($file, -1) == '/') { 
    259             if (!is_dir(substr($file, 0, strlen($file) - 1))) 
    260                 return __("Can't find folder:", 'sociable') . " <kbd>$file</kbd>"; 
    261         } else if (!is_file($file)) 
    262         return __("Can't find file:", 'sociable') . " <kbd>$file</kbd>"; 
    263     } 
     177require_once('php/sociable-admin.php'); 
    264178 
    265179 
    266     $header_filename = '../../themes/' . get_option('template') . '/header.php'; 
    267     if (!file_exists($header_filename) or strpos(@file_get_contents($header_filename), 'wp_head()') === false) 
    268         return __("Your theme isn't set up for Sociable to load its style. Please edit <kbd>header.php</kbd> and add a line reading <kbd>&lt?php wp_head(); ?&gt;</kbd> before <kbd>&lt;/head&gt;</kbd> to fix this.", 'sociable'); 
    269  
    270     chdir($cwd); // restore cwd 
    271  
    272     return false; 
    273 } 
    274  
    275 // The admin page 
    276 function sociable_submenu() { 
    277     global $sociable_known_sites, $sociable_files; 
    278  
    279     // update options in db if requested 
    280     if ($_REQUEST['restore']) { 
    281         sociable_restore_config(True); 
    282     sociable_message(__("Restored all settings to defaults.", 'sociable')); 
    283     } else if ($_REQUEST['save']) { 
    284         // update active sites 
    285         $active_sites = Array(); 
    286         if (!$_REQUEST['active_sites']) 
    287             $_REQUEST['active_sites'] = Array(); 
    288         foreach($_REQUEST['active_sites'] as $sitename=>$dummy) 
    289             $active_sites[] = $sitename; 
    290         update_option('sociable_active_sites', $active_sites); 
    291         // have to delete and re-add because update doesn't hit the db for identical arrays 
    292         // (sorting does not influence associated array equality in PHP) 
    293         delete_option('sociable_active_sites', $active_sites); 
    294         add_option('sociable_active_sites', $active_sites); 
    295  
    296         // update conditional displays 
    297         $conditionals = Array(); 
    298         if (!$_REQUEST['conditionals']) 
    299             $_REQUEST['conditionals'] = Array(); 
    300         foreach(get_option('sociable_conditionals') as $condition=>$toggled) 
    301             $conditionals[$condition] = array_key_exists($condition, $_REQUEST['conditionals']); 
    302         update_option('sociable_conditionals', $conditionals); 
    303  
    304         // update tagline 
    305         if (!$_REQUEST['tagline']) 
    306             $_REQUEST['tagline'] = ""; 
    307         update_option('sociable_tagline', $_REQUEST['tagline']); 
    308  
    309         sociable_message(__("Saved changes.", 'sociable')); 
    310     } 
    311  
    312     if ($str = sociable_upload_errors()) 
    313         sociable_message("$str</p><p>" . __("In your plugins/sociable folder, you must have these files:", 'sociable') . ' <pre>' . implode("\n", $sociable_files) ); 
    314  
    315     // show active sites first and in order 
    316     $active_sites = get_option('sociable_active_sites'); 
    317     $active = Array(); $disabled = $sociable_known_sites; 
    318     foreach($active_sites as $sitename) { 
    319         $active[$sitename] = $disabled[$sitename]; 
    320         unset($disabled[$site]); 
    321     } 
    322     uksort($disabled, "strnatcasecmp"); 
    323  
    324     // load options from db to display 
    325     $tagline = get_option('sociable_tagline'); 
    326     $conditionals = get_option('sociable_conditionals'); 
    327  
    328     // display options 
    329180?> 
    330 <form action="<?php echo $_SERVER['REQUEST_URI']; ?>" method="post"> 
    331  
    332 <div class="wrap" id="sociable_options"> 
    333 <fieldset id="sociable_sites"> 
    334  
    335 <h3><?php _e("Sociable Options", 'sociable'); ?></h3> 
    336  
    337 <p><?php _e("Drag and drop sites to reorder them. Only the sites you check will appear publicly.", 'sociable'); ?></p> 
    338  
    339 <ul id="sociable_site_list"> 
    340 <?php foreach (array_merge($active, $disabled) as $sitename=>$site) { ?> 
    341     <li 
    342         id="<?php echo $sitename; ?>" 
    343         class="sociable_site <?php echo (in_array($sitename, $active_sites)) ? "active" : "inactive"; ?>" 
    344         onmouseup="javascript:save_reorder('cb_<?php echo $sitename; ?>');" 
    345     > 
    346         <input 
    347             type="checkbox" 
    348             id="cb_<?php echo $sitename; ?>" 
    349             class="checkbox" 
    350             name="active_sites[<?php echo $sitename; ?>]" 
    351             onclick="javascript:toggle_checkbox('cb_<?php echo $sitename; ?>');" 
    352             <?php echo (in_array($sitename, $active_sites)) ? ' checked="checked"' : ''; ?> 
    353         /> 
    354         <img src="../wp-content/plugins/sociable-zyblog-edition/images/<?php echo $site['favicon']?>" width="16" height="16" alt="" /> 
    355         <?php print $sitename; ?> 
    356     </li> 
    357 <?php } ?> 
    358 </ul> 
    359 <input type="hidden" id="site_order" name="site_order" value="<?php echo join('|', array_keys($sociable_known_sites)) ?>" /> 
    360 <script language="JavaScript" type="text/javascript"><!-- 
    361     dragsort.makeListSortable(document.getElementById("sociable_site_list")); 
    362 --></script> 
    363  
    364 </fieldset> 
    365 <div style="clear: left; display: none;"><br/></div> 
    366  
    367 <fieldset id="sociable_tagline"> 
    368 <p> 
    369 <?php _e("Change the text displayed in front of the icons below. For complete customization, edit <kbd>sociable.css</kbd> in the Sociable plugin directory.", 'sociable'); ?> 
    370 </p> 
    371 <input type="text" name="tagline" value="<?php echo htmlspecialchars($tagline); ?>" /> 
    372 </fieldset> 
    373  
    374  
    375 <fieldset id="sociable_conditionals"> 
    376 <p><?php _e("The icons appear at the end of each blog post, and posts may show on many different types of pages. Depending on your theme and audience, it may be tacky to display icons on all types of pages.", 'sociable'); ?></p> 
    377  
    378 <ul style="list-style-type: none"> 
    379     <li><input type="checkbox" name="conditionals[is_home]"<?php echo ($conditionals['is_home']) ? ' checked="checked"' : ''; ?> /> <?php _e("Front page of the blog", 'sociable'); ?></li> 
    380     <li><input type="checkbox" name="conditionals[is_single]"<?php echo ($conditionals['is_single']) ? ' checked="checked"' : ''; ?> /> <?php _e("Individual blog posts", 'sociable'); ?></li> 
    381     <li><input type="checkbox" name="conditionals[is_page]"<?php echo ($conditionals['is_page']) ? ' checked="checked"' : ''; ?> /> <?php _e('Individual WordPress "Pages"', 'sociable'); ?></li> 
    382     <li><input type="checkbox" name="conditionals[is_category]"<?php echo ($conditionals['is_category']) ? ' checked="checked"' : ''; ?> /> <?php _e("Category archives", 'sociable'); ?></li> 
    383     <li><input type="checkbox" name="conditionals[is_date]"<?php echo ($conditionals['is_date']) ? ' checked="checked"' : ''; ?> /> <?php _e("Date-based archives", 'sociable'); ?></li> 
    384     <li><input type="checkbox" name="conditionals[is_search]"<?php echo ($conditionals['is_search']) ? ' checked="checked"' : ''; ?> /> <?php _e("Search results", 'sociable'); ?></li> 
    385 </ul> 
    386 </fieldset> 
    387  
    388 <p class="submit"><input name="save" id="save" tabindex="3" value="<?php _e("Save Changes", 'sociable'); ?>" type="submit" /></p> 
    389 <p class="submit"><input name="restore" id="restore" tabindex="3" value="<?php _e("Restore Built-in Defaults", 'sociable'); ?>" type="submit" style="border: 2px solid #e00;" /></p> 
    390  
    391 </div> 
    392  
    393 <div class="wrap"> 
    394 <p> 
    395 <?php _e('<a href="http://www.zyblog.de/wordpress-plugins/sociable-zyblog-edition/">Sociable ZyBlog Edition</a> is an enhanced version of <a href="http://push.cx/">Peter Harkins</a> plugin Sociable released under the GNU GPL version 2 or later.', 'sociable'); ?> 
    396 </p> 
    397 </div> 
    398  
    399 </form> 
    400  
    401 <?php 
    402 } 
    403  
    404 ?> 
Note: See TracChangeset for help on using the changeset viewer.