[pLog-svn] r3767 - in plugins/trunk: . sociable sociable/class sociable/class/action sociable/class/sociable sociable/class/sociable/images sociable/class/sociable/tool-man sociable/class/view sociable/locale sociable/templates

pwestbro at devel.lifetype.net pwestbro at devel.lifetype.net
Sat Jul 22 04:30:06 GMT 2006


Author: pwestbro
Date: 2006-07-22 04:30:05 +0000 (Sat, 22 Jul 2006)
New Revision: 3767

Added:
   plugins/trunk/sociable/
   plugins/trunk/sociable/README.txt
   plugins/trunk/sociable/class/
   plugins/trunk/sociable/class/action/
   plugins/trunk/sociable/class/action/pluginsociableconfigaction.class.php
   plugins/trunk/sociable/class/action/pluginsociableupdateconfigaction.class.php
   plugins/trunk/sociable/class/sociable/
   plugins/trunk/sociable/class/sociable/images/
   plugins/trunk/sociable/class/sociable/images/blinkbits.png
   plugins/trunk/sociable/class/sociable/images/blinklist.png
   plugins/trunk/sociable/class/sociable/images/blogmarks.png
   plugins/trunk/sociable/class/sociable/images/co.mments.gif
   plugins/trunk/sociable/class/sociable/images/connotea.png
   plugins/trunk/sociable/class/sociable/images/delicious.png
   plugins/trunk/sociable/class/sociable/images/delirious.png
   plugins/trunk/sociable/class/sociable/images/digg.png
   plugins/trunk/sociable/class/sociable/images/fark.png
   plugins/trunk/sociable/class/sociable/images/feedmelinks.png
   plugins/trunk/sociable/class/sociable/images/furl.png
   plugins/trunk/sociable/class/sociable/images/linkagogo.png
   plugins/trunk/sociable/class/sociable/images/magnolia.png
   plugins/trunk/sociable/class/sociable/images/netvouz.png
   plugins/trunk/sociable/class/sociable/images/newsvine.png
   plugins/trunk/sociable/class/sociable/images/rawsugar.png
   plugins/trunk/sociable/class/sociable/images/reddit.png
   plugins/trunk/sociable/class/sociable/images/scuttle.png
   plugins/trunk/sociable/class/sociable/images/shadows.png
   plugins/trunk/sociable/class/sociable/images/simpy.png
   plugins/trunk/sociable/class/sociable/images/smarking.png
   plugins/trunk/sociable/class/sociable/images/spurl.png
   plugins/trunk/sociable/class/sociable/images/tailrank.png
   plugins/trunk/sociable/class/sociable/images/wists.png
   plugins/trunk/sociable/class/sociable/images/yahoomyweb.png
   plugins/trunk/sociable/class/sociable/readme.txt
   plugins/trunk/sociable/class/sociable/sociable-admin.css
   plugins/trunk/sociable/class/sociable/sociable.css
   plugins/trunk/sociable/class/sociable/sociable.php
   plugins/trunk/sociable/class/sociable/tool-man/
   plugins/trunk/sociable/class/sociable/tool-man/coordinates.js
   plugins/trunk/sociable/class/sociable/tool-man/core.js
   plugins/trunk/sociable/class/sociable/tool-man/css.js
   plugins/trunk/sociable/class/sociable/tool-man/drag.js
   plugins/trunk/sociable/class/sociable/tool-man/dragsort.js
   plugins/trunk/sociable/class/sociable/tool-man/events.js
   plugins/trunk/sociable/class/view/
   plugins/trunk/sociable/class/view/pluginsociableconfigview.class.php
   plugins/trunk/sociable/locale/
   plugins/trunk/sociable/locale/locale_en_UK.php
   plugins/trunk/sociable/pluginsociable.class.php
   plugins/trunk/sociable/templates/
   plugins/trunk/sociable/templates/sociable.template
Log:
Added port of the Sociable WordPress plugin

http://push.cx/sociable

This allows links to social bookmarking sites to be added for each posts


Added: plugins/trunk/sociable/README.txt
===================================================================
--- plugins/trunk/sociable/README.txt	2006-07-21 18:11:54 UTC (rev 3766)
+++ plugins/trunk/sociable/README.txt	2006-07-22 04:30:05 UTC (rev 3767)
@@ -0,0 +1,23 @@
+[DESCRIPTION]
+Sociable is a port of the WordPress plugin of the same name, written by Peter Harkins. (http://push.cx/sociable)
+
+The Sociable plugin adds links to social bookmarking sites to each of your blog posts.
+
+[USAGES]: 
+1. Upload: Upload all the extract files and directories to $LifeType_Install_Dir/plugin/sociable 
+2. Add the following to header.template in the <head> section
+      {$sociable->showCSS()}
+
+3. Add the following to post.template:
+    $sociable->show($postId) 
+
+
+[EXAMPLE]: 
+Add the following code in post.template : 
+
+Code: 
+{assign var="postId" value=$post->getId()} 
+{$sociable->show($)} 
+
+[TODO]:
+1) Move string into local files, to make the plugin easier to localize.
\ No newline at end of file

Added: plugins/trunk/sociable/class/action/pluginsociableconfigaction.class.php
===================================================================
--- plugins/trunk/sociable/class/action/pluginsociableconfigaction.class.php	2006-07-21 18:11:54 UTC (rev 3766)
+++ plugins/trunk/sociable/class/action/pluginsociableconfigaction.class.php	2006-07-22 04:30:05 UTC (rev 3767)
@@ -0,0 +1,45 @@
+<?php
+
+    /*
+    Copyright 2006 Paul Westbrook (paul at westbrooks.org)
+    
+    This 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.
+    
+    This 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.
+    
+    You 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
+    */
+    
+
+	include_once( PLOG_CLASS_PATH."class/action/admin/adminaction.class.php" );
+	include_once( PLOG_CLASS_PATH."plugins/sociable/class/view/pluginsociableconfigview.class.php" );
+
+	/**
+	 * shows a form with the current configuration
+	 */
+	class PluginSociableConfigAction extends AdminAction
+	{
+		
+		function PluginSociableConfigAction( $actionInfo, $request )
+		{
+			$this->AdminAction( $actionInfo, $request );
+		}
+		
+		function perform()
+		{
+            $this->_view = new PluginSociableConfigView( $this->_blogInfo );
+			
+			$this->setCommonData();
+			
+			return true;
+		}
+	}
+?>
\ No newline at end of file

Added: plugins/trunk/sociable/class/action/pluginsociableupdateconfigaction.class.php
===================================================================
--- plugins/trunk/sociable/class/action/pluginsociableupdateconfigaction.class.php	2006-07-21 18:11:54 UTC (rev 3766)
+++ plugins/trunk/sociable/class/action/pluginsociableupdateconfigaction.class.php	2006-07-22 04:30:05 UTC (rev 3767)
@@ -0,0 +1,95 @@
+<?php
+
+    /*
+    Copyright 2006 Paul Westbrook (paul at westbrooks.org)
+    
+    This 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.
+    
+    This 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.
+    
+    You 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
+    */
+
+	include_once( PLOG_CLASS_PATH."class/action/admin/adminaction.class.php" );
+	include_once( PLOG_CLASS_PATH."plugins/sociable/class/view/pluginsociableconfigview.class.php" );
+		
+	/**
+	 * updates the plugin configuration
+	 */
+	class PluginSociableUpdateConfigAction extends AdminAction
+	{
+		var $_pluginEnabled;
+		var $_sitesArray;
+		
+		function PluginSociableUpdateConfigAction( $actionInfo, $request )
+		{
+			$this->AdminAction( $actionInfo, $request );
+		}
+		
+		function validate()
+		{
+            global $sociable_builtin_known_sites;
+        	include( PLOG_CLASS_PATH."plugins/sociable/class/sociable/sociable.php" );
+
+            $this->_pluginEnabled = $this->_request->getValue( "pluginEnabled" );
+            $this->_pluginEnabled = ($this->_pluginEnabled != "" );			
+			
+			$this->_sitesArray = Array();
+			
+		    foreach($sociable_builtin_known_sites as $sitename=>$site)
+		    {
+		          $siteEnabled = $this->_request->getValue( strtr($sitename, ".", "_") );
+		          $this->_sitesArray[$sitename] = ($siteEnabled != "" );
+            }
+			return true;
+		}
+		        
+		function perform()
+		{
+            global $sociable_builtin_known_sites;
+        	include( PLOG_CLASS_PATH."plugins/sociable/class/sociable/sociable.php" );
+
+            // update the plugin configurations to blog setting
+			$blogSettings = $this->_blogInfo->getSettings();
+            $blogSettings->setValue( "plugin_sociable_enabled", $this->_pluginEnabled );
+            $this->_blogInfo->setSettings( $blogSettings ); 
+		
+   		    foreach($sociable_builtin_known_sites as $sitename=>$site)
+		    {
+                  $blogSettings->setValue( "plugin_sociable_" . $sitename . "_enabled", $this->_sitesArray[$sitename] );
+            }
+
+			// save the blogs settings
+			$blogs = new Blogs();
+            if( !$blogs->updateBlog( $this->_blogInfo )) {
+                $this->_view = new PluginSociableConfigView( $this->_blogInfo );
+                $this->_view->setErrorMessage( $this->_locale->tr("error_updating_settings"));
+                $this->setCommonData();
+
+                return false;                       
+            }
+			
+			// if everything went ok...
+            $this->_blogInfo->setSettings( $blogSettings );
+            $this->_session->setValue( "blogInfo", $this->_blogInfo );
+            $this->saveSession();
+			
+			$this->_view = new PluginSociableConfigView( $this->_blogInfo );
+			$this->_view->setSuccessMessage( $this->_locale->tr("sociable_settings_saved_ok"));			
+			$this->setCommonData();
+			
+			// clear the cache
+			CacheControl::resetBlogCache( $this->_blogInfo->getId());					
+            
+            return true;		
+		}
+	}
+?>
\ No newline at end of file

Added: plugins/trunk/sociable/class/sociable/images/blinkbits.png
===================================================================
(Binary files differ)


Property changes on: plugins/trunk/sociable/class/sociable/images/blinkbits.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: plugins/trunk/sociable/class/sociable/images/blinklist.png
===================================================================
(Binary files differ)


Property changes on: plugins/trunk/sociable/class/sociable/images/blinklist.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: plugins/trunk/sociable/class/sociable/images/blogmarks.png
===================================================================
(Binary files differ)


Property changes on: plugins/trunk/sociable/class/sociable/images/blogmarks.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: plugins/trunk/sociable/class/sociable/images/co.mments.gif
===================================================================
(Binary files differ)


Property changes on: plugins/trunk/sociable/class/sociable/images/co.mments.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: plugins/trunk/sociable/class/sociable/images/connotea.png
===================================================================
(Binary files differ)


Property changes on: plugins/trunk/sociable/class/sociable/images/connotea.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: plugins/trunk/sociable/class/sociable/images/delicious.png
===================================================================
(Binary files differ)


Property changes on: plugins/trunk/sociable/class/sociable/images/delicious.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: plugins/trunk/sociable/class/sociable/images/delirious.png
===================================================================
(Binary files differ)


Property changes on: plugins/trunk/sociable/class/sociable/images/delirious.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: plugins/trunk/sociable/class/sociable/images/digg.png
===================================================================
(Binary files differ)


Property changes on: plugins/trunk/sociable/class/sociable/images/digg.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: plugins/trunk/sociable/class/sociable/images/fark.png
===================================================================
(Binary files differ)


Property changes on: plugins/trunk/sociable/class/sociable/images/fark.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: plugins/trunk/sociable/class/sociable/images/feedmelinks.png
===================================================================
(Binary files differ)


Property changes on: plugins/trunk/sociable/class/sociable/images/feedmelinks.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: plugins/trunk/sociable/class/sociable/images/furl.png
===================================================================
(Binary files differ)


Property changes on: plugins/trunk/sociable/class/sociable/images/furl.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: plugins/trunk/sociable/class/sociable/images/linkagogo.png
===================================================================
(Binary files differ)


Property changes on: plugins/trunk/sociable/class/sociable/images/linkagogo.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: plugins/trunk/sociable/class/sociable/images/magnolia.png
===================================================================
(Binary files differ)


Property changes on: plugins/trunk/sociable/class/sociable/images/magnolia.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: plugins/trunk/sociable/class/sociable/images/netvouz.png
===================================================================
(Binary files differ)


Property changes on: plugins/trunk/sociable/class/sociable/images/netvouz.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: plugins/trunk/sociable/class/sociable/images/newsvine.png
===================================================================
(Binary files differ)


Property changes on: plugins/trunk/sociable/class/sociable/images/newsvine.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: plugins/trunk/sociable/class/sociable/images/rawsugar.png
===================================================================
(Binary files differ)


Property changes on: plugins/trunk/sociable/class/sociable/images/rawsugar.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: plugins/trunk/sociable/class/sociable/images/reddit.png
===================================================================
(Binary files differ)


Property changes on: plugins/trunk/sociable/class/sociable/images/reddit.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: plugins/trunk/sociable/class/sociable/images/scuttle.png
===================================================================
(Binary files differ)


Property changes on: plugins/trunk/sociable/class/sociable/images/scuttle.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: plugins/trunk/sociable/class/sociable/images/shadows.png
===================================================================
(Binary files differ)


Property changes on: plugins/trunk/sociable/class/sociable/images/shadows.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: plugins/trunk/sociable/class/sociable/images/simpy.png
===================================================================
(Binary files differ)


Property changes on: plugins/trunk/sociable/class/sociable/images/simpy.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: plugins/trunk/sociable/class/sociable/images/smarking.png
===================================================================
(Binary files differ)


Property changes on: plugins/trunk/sociable/class/sociable/images/smarking.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: plugins/trunk/sociable/class/sociable/images/spurl.png
===================================================================
(Binary files differ)


Property changes on: plugins/trunk/sociable/class/sociable/images/spurl.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: plugins/trunk/sociable/class/sociable/images/tailrank.png
===================================================================
(Binary files differ)


Property changes on: plugins/trunk/sociable/class/sociable/images/tailrank.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: plugins/trunk/sociable/class/sociable/images/wists.png
===================================================================
(Binary files differ)


Property changes on: plugins/trunk/sociable/class/sociable/images/wists.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: plugins/trunk/sociable/class/sociable/images/yahoomyweb.png
===================================================================
(Binary files differ)


Property changes on: plugins/trunk/sociable/class/sociable/images/yahoomyweb.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: plugins/trunk/sociable/class/sociable/readme.txt
===================================================================
--- plugins/trunk/sociable/class/sociable/readme.txt	2006-07-21 18:11:54 UTC (rev 3766)
+++ plugins/trunk/sociable/class/sociable/readme.txt	2006-07-22 04:30:05 UTC (rev 3767)
@@ -0,0 +1,6 @@
+==== Sociable ====
+
+Tags: social, bookmark, bookmarks, bookmarking, social bookmarking, social bookmarks
+Contributors: Kirk Montgomery, Peter Harkins
+
+Automatically add links on your posts to popular social bookmarking sites.

Added: plugins/trunk/sociable/class/sociable/sociable-admin.css
===================================================================
--- plugins/trunk/sociable/class/sociable/sociable-admin.css	2006-07-21 18:11:54 UTC (rev 3766)
+++ plugins/trunk/sociable/class/sociable/sociable-admin.css	2006-07-22 04:30:05 UTC (rev 3767)
@@ -0,0 +1,37 @@
+#sociable_options fieldset {
+	margin: 1em;
+}
+
+#sociable_site_list {
+	list-style-type: none;
+	margin: 0;
+	padding: 0;
+}
+#sociable_site_list li {
+	cursor: move;
+	position: relative;
+	float: left;
+	margin: 2px 2px 0 0;
+	width: 10em;
+	height: 20px;
+	text-align: left;
+	padding: 4px;
+	-moz-border-radius: 5px;
+}
+#sociable_site_list li.active { background-color: #6da6d1; }
+#sociable_site_list li.active img {
+	-moz-opacity: 1;
+	filter:alpha(opacity=100);
+}
+#sociable_site_list li.inactive { background-color: #dddddd; }
+#sociable_site_list li.inactive img {
+	-moz-opacity: .4;
+	filter:alpha(opacity=40);
+}
+#sociable_site_list li input {
+	margin: 2px;
+}
+
+#sociable_tagline input {
+	width: 30em;
+}

Added: plugins/trunk/sociable/class/sociable/sociable.css
===================================================================
--- plugins/trunk/sociable/class/sociable/sociable.css	2006-07-21 18:11:54 UTC (rev 3766)
+++ plugins/trunk/sociable/class/sociable/sociable.css	2006-07-22 04:30:05 UTC (rev 3767)
@@ -0,0 +1,25 @@
+div .sociable { margin: 3em 0; }
+
+span.sociable_tagline { position: relative; }
+span.sociable_tagline span { display: none; width: 14em; }
+span.sociable_tagline:hover span {
+	position: absolute;
+	display: block;
+	top: -5em;
+	background: #ffe;
+	border: 1px solid #ccc;
+	color: black;
+	line-height: 1.25em;
+}
+
+.sociable span { display: block; }
+.sociable ul { display: inline; }
+.sociable li {
+	background: none;
+	display: inline;
+	list-style-type: none;
+	margin: 0;
+	padding: 2px;
+}
+.sociable ul li:before { content: ""; }
+.sociable img { border: 0; }

Added: plugins/trunk/sociable/class/sociable/sociable.php
===================================================================
--- plugins/trunk/sociable/class/sociable/sociable.php	2006-07-21 18:11:54 UTC (rev 3766)
+++ plugins/trunk/sociable/class/sociable/sociable.php	2006-07-22 04:30:05 UTC (rev 3767)
@@ -0,0 +1,572 @@
+<?php
+/*
+Plugin Name: Sociable
+Plugin URI: http://push.cx/sociable
+Description: Automatically add links on your posts to popular <a href="http://www.maxpower.ca/bookmarking">social bookmarking sites</a>.
+Version: 1.2
+Author: Peter Harkins
+Author URI: http://push.cx
+*/
+$sociable_date = '2006-03-26'; // date this version was released, beats a version #
+
+/*
+Copyright 2006 Peter Harkins (ph at malaprop.org)
+
+This 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.
+
+This 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.
+
+You 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
+*/
+
+$sociable_builtin_known_sites = Array(
+
+	'blinkbits' => Array(
+		'favicon' => 'blinkbits.png',
+		'url' => 'http://www.blinkbits.com/bookmarklets/save.php?v=1&amp;source_url=PERMALINK&amp;title=TITLE&amp;body=TITLE',
+	),
+
+	'BlinkList' => Array(
+		'favicon' => 'blinklist.png',
+		'url' => 'http://www.blinklist.com/index.php?Action=Blink/addblink.php&amp;Description=&amp;Url=PERMALINK&amp;Title=TITLE',
+	),
+
+
+	'blogmarks' => Array(
+		'favicon' => 'blogmarks.png',
+		'url' => 'http://blogmarks.net/my/new.php?mini=1&amp;simple=1&amp;url=PERMALINK&amp;title=TITLE',
+	),
+
+	'co.mments' => Array(
+		'favicon' => 'co.mments.gif',
+		'url' => 'http://co.mments.com/track?url=PERMALINK&amp;title=TITLE',
+	),
+
+	'connotea' => Array(
+		'favicon' => 'connotea.png',
+		'url' => 'http://www.connotea.org/addpopup?continue=confirm&amp;uri=PERMALINK&amp;title=TITLE',
+	),
+
+
+	'del.icio.us' => Array(
+		'favicon' => 'delicious.png',
+		'url' => 'http://del.icio.us/post?url=PERMALINK&amp;title=TITLE',
+	),
+
+	'De.lirio.us' => Array(
+		'favicon' => 'delirious.png',
+		'url' => 'http://de.lirio.us/rubric/post?uri=PERMALINK;title=TITLE;when_done=go_back',
+	),
+
+	'digg' => Array(
+		'favicon' => 'digg.png',
+		'url' => 'http://digg.com/submit?phase=2&amp;url=PERMALINK&amp;title=TITLE',
+	),
+
+	'Fark' => Array(
+		'favicon' => 'fark.png',
+		'url' => 'http://cgi.fark.com/cgi/fark/edit.pl?new_url=PERMALINK&amp;new_comment=TITLE&amp;new_comment=BLOGNAME&amp;linktype=Misc',
+		// To post to a different category, see the drop-down box labeled "Link Type" at
+		// http://cgi.fark.com/cgi/fark/submit.pl for a complete list
+	),
+
+	'feedmelinks' => Array(
+		'favicon' => 'feedmelinks.png',
+		'url' => 'http://feedmelinks.com/categorize?from=toolbar&amp;op=submit&amp;url=PERMALINK&amp;name=TITLE',
+	),
+
+	'Furl' => Array(
+		'favicon' => 'furl.png',
+		'url' => 'http://www.furl.net/storeIt.jsp?u=PERMALINK&amp;t=TITLE',
+	),
+
+	'LinkaGoGo' => Array(
+		'favicon' => 'linkagogo.png',
+		'url' => 'http://www.linkagogo.com/go/AddNoPopup?url=PERMALINK&amp;title=TITLE',
+	),
+
+	'Ma.gnolia' => Array(
+		'favicon' => 'magnolia.png',
+		'url' => 'http://ma.gnolia.com/beta/bookmarklet/add?url=PERMALINK&amp;title=TITLE&amp;description=TITLE',
+	),
+
+	'NewsVine' => Array(
+		'favicon' => 'newsvine.png',
+		'url' => 'http://www.newsvine.com/_tools/seed&amp;save?u=PERMALINK&amp;h=TITLE',
+	),
+
+	'Netvouz' => Array(
+		'favicon' => 'netvouz.png',
+		'url' => 'http://www.netvouz.com/action/submitBookmark?url=PERMALINK&amp;title=TITLE&amp;description=TITLE',
+	),
+
+	'RawSugar' => Array(
+		'favicon' => 'rawsugar.png',
+		'url' => 'http://www.rawsugar.com/tagger/?turl=PERMALINK&amp;tttl=TITTLE',
+	),
+
+
+	'Reddit' => Array(
+		'favicon' => 'reddit.png',
+		'url' => 'http://reddit.com/submit?url=PERMALINK&amp;title=TITLE',
+	),
+
+	'scuttle' => Array(
+		'favicon' => 'scuttle.png',
+		'url' => 'http://www.scuttle.org/bookmarks.php/maxpower?action=add&amp;address=PERMALINK&amp;title=TITLE&amp;description=TITLE',
+	),
+
+	'Shadows' => Array(
+		'favicon' => 'shadows.png',
+		'url' => 'http://www.shadows.com/features/tcr.htm?url=PERMALINK&amp;title=TITLE',
+	),
+
+	'Simpy' => Array(
+		'favicon' => 'simpy.png',
+		'url' => 'http://www.simpy.com/simpy/LinkAdd.do?href=PERMALINK&amp;title=TITLE',
+	),
+
+	'Smarking' => Array(
+		'favicon' => 'smarking.png',
+		'url' => 'http://smarking.com/editbookmark/?url=PERMALINK&amp;description=TITLE',
+	),
+
+	'Spurl' => Array(
+		'favicon' => 'spurl.png',
+		'url' => 'http://www.spurl.net/spurl.php?url=PERMALINK&amp;title=TITLE',
+	),
+
+	'TailRank' => Array(
+		'favicon' => 'tailrank.png',
+		'url' => 'http://tailrank.com/share/?text=&amp;link_href=PERMALINK&amp;title=TITLE',
+	),
+
+	'Wists' => Array(
+		'favicon' => 'wists.png',
+		'url' => 'http://wists.com/r.php?c=&amp;r=PERMALINK&amp;title=TITLE',
+	),
+
+	'YahooMyWeb' => Array(
+		'favicon' => 'yahoomyweb.png',
+		'url' => 'http://myweb2.search.yahoo.com/myresults/bookmarklet?u=PERMALINK&amp;=TITLE',
+	),
+
+);
+
+$sociable_files = Array(
+	'sociable.php',
+	'sociable.css',
+	'sociable-admin.css',
+	'images/',
+	'images/blinkbits.png',
+	'images/blinklist.png',
+	'images/blogmarks.png',
+	'images/co.mments.gif',
+	'images/connotea.png',
+	'images/delicious.png',
+	'images/delirious.png',
+	'images/digg.png',
+	'images/fark.png',
+	'images/feedmelinks.png',
+	'images/furl.png',
+	'images/linkagogo.png',
+	'images/magnolia.png',
+	'images/netvouz.png',
+	'images/newsvine.png',
+	'images/rawsugar.png',
+	'images/reddit.png',
+	'images/scuttle.png',
+	'images/shadows.png',
+	'images/simpy.png',
+	'images/smarking.png',
+	'images/spurl.png',
+	'images/tailrank.png',
+	'images/wists.png',
+	'images/yahoomyweb.png',
+	'tool-man/',
+	'tool-man/coordinates.js',
+	'tool-man/core.js',
+	'tool-man/css.js',
+	'tool-man/drag.js',
+	'tool-man/dragsort.js',
+	'tool-man/events.js',
+);
+
+/*
+function sociable_html($display=Array()) {
+	$known_sites = get_option('sociable_known_sites');
+	$active_sites = get_option('sociable_active_sites');
+
+	$html = "";
+
+	$imagepath = get_bloginfo('wpurl') . '/wp-content/plugins/sociable/images/';
+
+	// if no sites are specified, display all active
+	// have to check $active_sites has contente because WP
+	// won't save an empty array as an option
+	if (empty($display) and $active_sites) {
+		// have to do this to keep the order from known_sites
+		foreach($known_sites as $sitename=>$site) {
+			if (in_array($sitename, $active_sites))
+				$display[] = $sitename;
+		}
+	}
+	// if no sites are active, display nothing
+	if (empty($display))
+		return "";
+
+	// Load the post's data
+	$blogname = urlencode(get_bloginfo('wpurl'));
+	global $wp_query; 
+	$post = $wp_query->post;
+	$permalink = get_permalink($post->ID);
+	$title = urlencode($post->post_title);
+
+	$html .= '<div class="sociable"><span class="sociable_tagline">';
+	$html .= get_option("sociable_tagline");
+	$html .= '<span>These icons link to social bookmarking sites where readers can share and discover new web pages.</span></span><ul>' . "\n";
+
+	foreach($display as $sitename) {
+		// if they specify an unknown or inactive site, ignore it
+		if (!in_array($sitename, $active_sites))
+			continue;
+
+		$site = $known_sites[$sitename];
+		$html .= "\t<li>";
+
+		$url = $site['url'];
+		$url = str_replace('PERMALINK', $permalink, $url);
+		$url = str_replace('TITLE', $title, $url);
+		$url = str_replace('BLOGNAME', $blogname, $url);
+
+		$html .= "<a href=\"$url\" title=\"$sitename\">";
+		$html .= "<img src=\"$imagepath{$site['favicon']}\" alt=\"$sitename\" />";
+		$html .= "</a></li>\n";
+	}
+
+	$html .= "</ul></div>\n";
+
+	return $html;
+}
+
+// Hook the_content to output html if we should display on any page
+$sociable_contitionals = get_option('sociable_conditionals');
+if (is_array($sociable_contitionals) and in_array(true, $sociable_contitionals)) {
+	add_filter('the_content', 'sociable_display_hook');
+	add_filter('the_excerpt', 'sociable_display_hook');
+	
+	function sociable_display_hook($content='') {
+		$conditionals = get_option('sociable_conditionals');
+		if ((is_home() and $conditionals['is_home']) or
+		    (is_single() and $conditionals['is_single']) or
+		    (is_page() and $conditionals['is_page']) or
+		    (is_category() and $conditionals['is_category']) or
+		    (is_date() and $conditionals['is_date']) or
+		    (is_search() and $conditionals['is_search']) or
+	            0)
+			$content .= sociable_html();
+	
+		return $content;
+	}
+}
+
+// Hook wp_head to add css
+add_action('wp_head', 'sociable_wp_head');
+function sociable_wp_head() {
+	echo '<link rel="stylesheet" type="text/css" media="screen" href="' . get_bloginfo('wpurl') . '/wp-content/plugins/sociable/sociable.css" />';
+}
+
+// load wp rss functions for update checking.
+require_once(ABSPATH . WPINC . '/rss-functions.php');
+
+// Plugin config/data setup
+if (function_exists('register_activation_hook')) {
+	// for WP 2
+	register_activation_hook(__FILE__, 'sociable_activation_hook');
+} else {
+	// for WP 1.5, which doesn't have any activation hook
+	if (!is_array(get_option('sociable_known_sites')))
+		sociable_activation_hook();
+}
+function sociable_activation_hook() {
+	return sociable_restore_config(False);
+}
+
+// restore built-in defaults, optionally overwriting existing values
+function sociable_restore_config($force=False) {
+	// Load defaults, taking care not to smash already-set options
+	global $sociable_builtin_known_sites;
+
+	// known_sites defaults to builtin array
+	if ($force or !is_array(get_option('sociable_known_sites')))
+		update_option('sociable_known_sites', $sociable_builtin_known_sites);
+
+	// active_sites defaults to all known_sites
+	if ($force or !is_array(get_option('sociable_active_sites')))
+		update_option('sociable_active_sites', array_keys($sociable_builtin_known_sites));
+
+	// tagline defaults to a Hitchiker's Guide to the Galaxy reference
+	if ($force or !is_string(get_option('sociable_tagline')))
+		update_option('sociable_tagline', "<strong>Share and Enjoy:</strong>");
+
+	// only display on single posts and pages by default
+	if ($force or !is_array(get_option('sociable_conditionals')))
+		update_option('sociable_conditionals', array(
+			'is_home' => False,
+			'is_single' => True,
+			'is_page' => True,
+			'is_category' => False,
+			'is_date' => False,
+			'is_search' => False,
+		));
+
+	// last-updated date defaults to 0000-00-00
+	// this is to trigger the update check on first run
+	if ($force or !get_option('sociable_updated'))
+		update_option('sociable_updated', '0000-00-00');
+}
+
+// Hook the admin_menu display to add admin page
+add_action('admin_menu', 'sociable_admin_menu');
+function sociable_admin_menu() {
+	add_submenu_page('options-general.php', 'Sociable', 'Sociable', 8, 'Sociable', 'sociable_submenu');
+}
+
+// Admin page header
+add_action('admin_head', 'sociable_admin_head');
+function sociable_admin_head() {
+?>
+
+<!-- The ToolMan lib provides drag and drop: http://tool-man.org/examples/sorting.html -->
+<script language="JavaScript" type="text/javascript" src="<?php echo get_bloginfo('wpurl'); ?>/wp-content/plugins/sociable/tool-man/core.js"></script>
+<script language="JavaScript" type="text/javascript" src="<?php echo get_bloginfo('wpurl'); ?>/wp-content/plugins/sociable/tool-man/coordinates.js"></script>
+<script language="JavaScript" type="text/javascript" src="<?php echo get_bloginfo('wpurl'); ?>/wp-content/plugins/sociable/tool-man/css.js"></script>
+<script language="JavaScript" type="text/javascript" src="<?php echo get_bloginfo('wpurl'); ?>/wp-content/plugins/sociable/tool-man/drag.js"></script>
+<script language="JavaScript" type="text/javascript" src="<?php echo get_bloginfo('wpurl'); ?>/wp-content/plugins/sociable/tool-man/dragsort.js"></script>
+<script language="JavaScript" type="text/javascript" src="<?php echo get_bloginfo('wpurl'); ?>/wp-content/plugins/sociable/tool-man/events.js"></script>
+<script language="JavaScript" type="text/javascript"><!--
+var dragsort = ToolMan.dragsort();
+var junkdrawer = ToolMan.junkdrawer();
+window.onload = function() {
+	dragsort.makeListSortable(document.getElementById("sociable_site_list"));
+}
+*/
+/* make checkbox action prettier */
+/*function toggle_checkbox(id) {
+	var checkbox = document.getElementById(id);
+	if (checkbox.checked)
+		checkbox.parentNode.className = 'active';
+	else
+		checkbox.parentNode.className = 'inactive';
+}
+--></script>
+
+<link rel="stylesheet" type="text/css" media="screen" href="<?php echo get_bloginfo('wpurl'); ?>/wp-content/plugins/sociable/sociable-admin.css" />
+<?
+}
+
+function sociable_update_version() {
+	global $sociable_date;
+
+	$known_update = get_option('sociable_known_update');
+	$found_update = $known_update;
+
+	// check for new versions if it's been a week
+	if (date("Y-m-d", time() + 7 * 24 * 60 * 60) > get_option('sociable_updated')) {
+		// note the updating and fetch potential updates
+		update_option('sociable_updated', date("Y-m-d"));
+		$update = fetch_rss("http://push.cx/tag/sociable/feed");
+
+		if ($update === False) {
+			echo '<div id="message" class="updated fade"><p>Sociable tried to check for updates but couldn\'t. This might be the way PHP is set up, or just random network issues. Please <a href="http://push.cx/sociable">visit the Sociable website</a> to update manually if needed.</p></div>';
+			return;
+		}
+
+		// loop through feed, pulling out any updates
+		foreach($update->items as $item) {
+			$updates = Array();
+			if (preg_match('|<!-- Sociable:Update date="(\d{4}-\d{2}-\d{2})" -->|', $item['content']['encoded'], $updates)) {
+				// if this is the newest update, save it
+				if ($updates[1] > $found_update)
+					$found_update = $updates[1];
+			}
+		}
+	}
+
+	// if an newer update was found, save it
+	if ($found_update > $known_update)
+		update_option('sociable_known_update', $found_update);
+
+	// if the best-known update is newer than this ver, tell user
+	if ($found_update > $sociable_date)
+		echo '<div id="message" class="updated fade"><p>A <a href="http://push.cx/sociable">new version of Sociable is available</a> (as of ' . $found_update . ').</p></div>';
+}
+
+// Sanity check the upload worked
+function sociable_upload_errors() {
+	global $sociable_files;
+
+	$cwd = getcwd(); // store current dir for restoration
+	if (!@chdir('../wp-content/plugins'))
+		return "Couldn't find wp-admin/plugins folder. Please make sure WordPress is installed correctly.";
+	if (!is_dir('sociable'))
+		return "Can't find sociable folder.";
+	chdir('sociable');
+
+	foreach($sociable_files as $file) {
+		if (substr($file, -1) == '/') {
+			if (!is_dir(substr($file, 0, strlen($file) - 1)))
+				return "Can't find folder: <kbd>$file</kbd>";
+		} else if (!is_file($file))
+			return "Can't find file: <kbd>$file</kbd>";
+	}
+
+	chdir($cwd); // restore cwd
+	return false;
+}
+
+// The admin page
+function sociable_submenu() {
+	global $sociable_date, $sociable_files;
+
+	// update options in db if requested
+	if ($_REQUEST['restore']) {
+		sociable_restore_config(True);
+		echo '<div id="message" class="updated fade"><p>Restored all settings to defaults.</p></div>';
+	} else if ($_REQUEST['save']) {
+		// update active sites
+		$active_sites = Array();
+		if (!$_REQUEST['active_sites'])
+			$_REQUEST['active_sites'] = Array();
+		foreach(get_option('sociable_known_sites') as $sitename=>$site) {
+			if (array_key_exists($sitename, $_REQUEST['active_sites']))
+				$active_sites[] = $sitename;
+		}
+		update_option('sociable_active_sites', $active_sites);
+
+		// update site order
+		$reordered_known_sites = Array();
+		$known_sites = get_option('sociable_known_sites');
+		foreach(explode('|', $_REQUEST['site_order']) as $sitename) {
+			$reordered_known_sites[$sitename] = $known_sites[$sitename];
+		}
+		// have to delete and re-add because update doesn't hit the db for identical arrays
+		// (sorting does not influence associated array equality in PHP)
+		delete_option('sociable_known_sites', $reordered_known_sites);
+		add_option('sociable_known_sites', $reordered_known_sites);
+
+		// update conditional displays
+		$conditionals = Array();
+		if (!$_REQUEST['conditionals'])
+			$_REQUEST['conditionals'] = Array();
+		foreach(get_option('sociable_conditionals') as $condition=>$toggled)
+			$conditionals[$condition] = array_key_exists($condition, $_REQUEST['conditionals']);
+		update_option('sociable_conditionals', $conditionals);
+
+		// update tagline
+		if (!$_REQUEST['tagline'])
+			$_REQUEST['tagline'] = "";
+		update_option('sociable_tagline', $_REQUEST['tagline']);
+		
+		echo '<div id="message" class="updated fade"><p>Saved changes.</p></div>';
+	}
+
+	if ($str = sociable_upload_errors())
+		echo '<div id="message" class="updated fade"><p>' . $str . '</p><p>In your plugins/sociable folder, you must have these files: <pre>' . implode("\n", $sociable_files) . '</pre></div>';
+	sociable_update_version();
+
+	// load options from db to display
+	$known_sites = get_option('sociable_known_sites');
+	$active_sites = get_option('sociable_active_sites');
+	$tagline = get_option('sociable_tagline');
+	$conditionals = get_option('sociable_conditionals');
+	$updated = get_option('sociable_updated');
+
+	// display options
+?>
+<form action="<?php echo $_SERVER['REQUEST_URI']; ?>" method="post">
+
+<div class="wrap" id="sociable_options">
+<fieldset id="sociable_sites">
+
+<h3>Sociable Options</h3>
+
+<p>Drag and drop sites to reorder them. Only the sites you check will appear
+publicly.</p>
+
+<ul id="sociable_site_list">
+<?php foreach ($known_sites as $sitename=>$site) { ?>
+	<li class="sociable_site <?php echo (in_array($sitename, $active_sites)) ? "active" : "inactive"; ?>" id="<?php echo $sitename; ?>" onMouseUp="javascript:document.getElementById('site_order').value=junkdrawer.serializeList(document.getElementById('sociable_site_list'));">
+		<input type="checkbox" id="cb_<?php echo $sitename; ?>" name="active_sites[<?php echo $sitename; ?>]"<?php echo (in_array($sitename, $active_sites)) ? " checked" : ""; ?> onClick="javascript:toggle_checkbox('cb_<?php echo $sitename; ?>');" />
+		<img src="../wp-content/plugins/sociable/images/<?php echo $site['favicon']?>" width="16" height="16" alt="" />
+		<?php print $sitename; ?>
+	</li>
+<?php } ?>
+</ul>
+<input type="hidden" id="site_order" name="site_order" value="<?php echo join('|', array_keys($known_sites)) ?>" />
+
+</fieldset>
+<div style="clear: left; display: none;"><br/></div>
+
+<fieldset id="sociable_tagline">
+<p>
+Change the text displayed in front of the icons below. For complete
+customization, edit <i>sociable.css</i> in the Sociable plugin directory.
+</p>
+<input type="text" name="tagline" value="<?php echo htmlspecialchars($tagline); ?>" />
+</fieldset>
+
+
+<fieldset id="sociable_conditionals">
+<p>The icons appear at the end of each blog post, and while 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.</p>
+
+<ul style="list-style-type: none">
+	<li><input type="checkbox" name="conditionals[is_home]"<?php echo ($conditionals['is_home']) ? " checked" : ""; ?>> Front page of the blog</li>
+	<li><input type="checkbox" name="conditionals[is_single]"<?php echo ($conditionals['is_single']) ? " checked" : ""; ?>> Individual blog posts</li>
+	<li><input type="checkbox" name="conditionals[is_page]"<?php echo ($conditionals['is_page']) ? " checked" : ""; ?>> Individual WordPress "Pages"</li>
+	<li><input type="checkbox" name="conditionals[is_category]"<?php echo ($conditionals['is_category']) ? " checked" : ""; ?>> Category archives</li>
+	<li><input type="checkbox" name="conditionals[is_date]"<?php echo ($conditionals['is_date']) ? " checked" : ""; ?>> Date-based archives</li>
+	<li><input type="checkbox" name="conditionals[is_search]"<?php echo ($conditionals['is_search']) ? " checked" : ""; ?>> Search results</li>
+</ul>
+</fieldset>
+
+<p class="submit"><input name="save" id="save" tabindex="3" value="Save Changes" type="submit" /></p>
+<p class="submit"><input name="restore" id="restore" tabindex="3" value="Restore Built-in Defaults" type="submit" style="border: 2px solid #e00;" /></p>
+
+</div>
+
+<div class="wrap">
+<h3>Automatic Updates</h3>
+<p>
+Sociable checks for new versions when you bring up this page. (At most once per week.)
+</p>
+
+<p>This copy of Sociable is from <b><?php echo $sociable_date; ?></b>.</p>
+<p>Last checked on <b><?php echo $updated; ?></b>.</p>
+</div>
+
+<div class="wrap">
+<p>
+<a href="http://push.cx/sociable">Sociable</a> is copyright 2006 by <a
+href="http://push.cx/">Peter Harkins</a>, released under the GNU GPL version 2
+or later. If you like Sociable, please send a link my way so other folks can
+find out about it. If you have any problems or good ideas, <a
+href="mailto:ph at malaprop.org">mail me</a>.
+</p>
+</div>
+
+</form>
+
+<?php
+}
+*/
+?>

Added: plugins/trunk/sociable/class/sociable/tool-man/coordinates.js
===================================================================
--- plugins/trunk/sociable/class/sociable/tool-man/coordinates.js	2006-07-21 18:11:54 UTC (rev 3766)
+++ plugins/trunk/sociable/class/sociable/tool-man/coordinates.js	2006-07-22 04:30:05 UTC (rev 3767)
@@ -0,0 +1,154 @@
+/* Copyright (c) 2005 Tim Taylor Consulting (see LICENSE.txt) */
+
+/* FIXME: assumes position styles are specified in 'px' */
+
+ToolMan._coordinatesFactory = {
+
+	create : function(x, y) {
+		// FIXME: Safari won't parse 'throw' and aborts trying to do anything with this file
+		//if (isNaN(x) || isNaN(y)) throw "invalid x,y: " + x + "," + y
+		return new _ToolManCoordinate(this, x, y)
+	},
+
+	origin : function() {
+		return this.create(0, 0)
+	},
+
+	/*
+	 * FIXME: Safari 1.2, returns (0,0) on absolutely positioned elements
+	 */
+	topLeftPosition : function(element) {
+		var left = parseInt(ToolMan.css().readStyle(element, "left"))
+		var left = isNaN(left) ? 0 : left
+		var top = parseInt(ToolMan.css().readStyle(element, "top"))
+		var top = isNaN(top) ? 0 : top
+
+		return this.create(left, top)
+	},
+
+	bottomRightPosition : function(element) {
+		return this.topLeftPosition(element).plus(this._size(element))
+	},
+
+	topLeftOffset : function(element) {
+		var offset = this._offset(element) 
+
+		var parent = element.offsetParent
+		while (parent) {
+			offset = offset.plus(this._offset(parent))
+			parent = parent.offsetParent
+		}
+		return offset
+	},
+
+	bottomRightOffset : function(element) {
+		return this.topLeftOffset(element).plus(
+				this.create(element.offsetWidth, element.offsetHeight))
+	},
+
+	scrollOffset : function() {
+		if (window.pageXOffset) {
+			return this.create(window.pageXOffset, window.pageYOffset)
+		} else if (document.documentElement) {
+			return this.create(
+					document.body.scrollLeft + document.documentElement.scrollLeft, 
+					document.body.scrollTop + document.documentElement.scrollTop)
+		} else if (document.body.scrollLeft >= 0) {
+			return this.create(document.body.scrollLeft, document.body.scrollTop)
+		} else {
+			return this.create(0, 0)
+		}
+	},
+
+	clientSize : function() {
+		if (window.innerHeight >= 0) {
+			return this.create(window.innerWidth, window.innerHeight)
+		} else if (document.documentElement) {
+			return this.create(document.documentElement.clientWidth,
+					document.documentElement.clientHeight)
+		} else if (document.body.clientHeight >= 0) {
+			return this.create(document.body.clientWidth,
+					document.body.clientHeight)
+		} else {
+			return this.create(0, 0)
+		}
+	},
+
+	/**
+	 * mouse coordinate relative to the window (technically the
+	 * browser client area) i.e. the part showing your page
+	 *
+	 * NOTE: in Safari the coordinate is relative to the document
+	 */
+	mousePosition : function(event) {
+		event = ToolMan.events().fix(event)
+		return this.create(event.clientX, event.clientY)
+	},
+
+	/**
+	 * mouse coordinate relative to the document
+	 */
+	mouseOffset : function(event) {
+		event = ToolMan.events().fix(event)
+		if (event.pageX >= 0 || event.pageX < 0) {
+			return this.create(event.pageX, event.pageY)
+		} else if (event.clientX >= 0 || event.clientX < 0) {
+			return this.mousePosition(event).plus(this.scrollOffset())
+		}
+	},
+
+	_size : function(element) {
+	/* TODO: move to a Dimension class */
+		return this.create(element.offsetWidth, element.offsetHeight)
+	},
+
+	_offset : function(element) {
+		return this.create(element.offsetLeft, element.offsetTop)
+	}
+}
+
+function _ToolManCoordinate(factory, x, y) {
+	this.factory = factory
+	this.x = isNaN(x) ? 0 : x
+	this.y = isNaN(y) ? 0 : y
+}
+
+_ToolManCoordinate.prototype = {
+	toString : function() {
+		return "(" + this.x + "," + this.y + ")"
+	},
+
+	plus : function(that) {
+		return this.factory.create(this.x + that.x, this.y + that.y)
+	},
+
+	minus : function(that) {
+		return this.factory.create(this.x - that.x, this.y - that.y)
+	},
+
+	min : function(that) {
+		return this.factory.create(
+				Math.min(this.x , that.x), Math.min(this.y , that.y))
+	},
+
+	max : function(that) {
+		return this.factory.create(
+				Math.max(this.x , that.x), Math.max(this.y , that.y))
+	},
+
+	constrainTo : function (one, two) {
+		var min = one.min(two)
+		var max = one.max(two)
+
+		return this.max(min).min(max)
+	},
+
+	distance : function (that) {
+		return Math.sqrt(Math.pow(this.x - that.x, 2) + Math.pow(this.y - that.y, 2))
+	},
+
+	reposition : function(element) {
+		element.style["top"] = this.y + "px"
+		element.style["left"] = this.x + "px"
+	}
+}


Property changes on: plugins/trunk/sociable/class/sociable/tool-man/coordinates.js
___________________________________________________________________
Name: svn:executable
   + *

Added: plugins/trunk/sociable/class/sociable/tool-man/core.js
===================================================================
--- plugins/trunk/sociable/class/sociable/tool-man/core.js	2006-07-21 18:11:54 UTC (rev 3766)
+++ plugins/trunk/sociable/class/sociable/tool-man/core.js	2006-07-22 04:30:05 UTC (rev 3767)
@@ -0,0 +1,172 @@
+/*
+Copyright (c) 2005 Tim Taylor Consulting <http://tool-man.org/>
+
+Permission is hereby granted, free of charge, to any person obtaining a
+copy of this software and associated documentation files (the "Software"),
+to deal in the Software without restriction, including without limitation
+the rights to use, copy, modify, merge, publish, distribute, sublicense,
+and/or sell copies of the Software, and to permit persons to whom the
+Software is furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included
+in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+IN THE SOFTWARE.
+*/
+
+var ToolMan = {
+	events : function() {
+		if (!ToolMan._eventsFactory) throw "ToolMan Events module isn't loaded";
+		return ToolMan._eventsFactory
+	},
+
+	css : function() {
+		if (!ToolMan._cssFactory) throw "ToolMan CSS module isn't loaded";
+		return ToolMan._cssFactory
+	},
+
+	coordinates : function() {
+		if (!ToolMan._coordinatesFactory) throw "ToolMan Coordinates module isn't loaded";
+		return ToolMan._coordinatesFactory
+	},
+
+	drag : function() {
+		if (!ToolMan._dragFactory) throw "ToolMan Drag module isn't loaded";
+		return ToolMan._dragFactory
+	},
+
+	dragsort : function() {
+		if (!ToolMan._dragsortFactory) throw "ToolMan DragSort module isn't loaded";
+		return ToolMan._dragsortFactory
+	},
+
+	helpers : function() {
+		return ToolMan._helpers
+	},
+
+/* Sociable doesn't need these
+	cookies : function() {
+		if (!ToolMan._cookieOven) throw "ToolMan Cookie module isn't loaded";
+		return ToolMan._cookieOven
+	},
+*/
+
+	junkdrawer : function() {
+		return ToolMan._junkdrawer
+	}
+
+}
+
+ToolMan._helpers = {
+	map : function(array, func) {
+		for (var i = 0, n = array.length; i < n; i++) func(array[i])
+	},
+
+	nextItem : function(item, nodeName) {
+		if (item == null) return
+		var next = item.nextSibling
+		while (next != null) {
+			if (next.nodeName == nodeName) return next
+			next = next.nextSibling
+		}
+		return null
+	},
+
+	previousItem : function(item, nodeName) {
+		var previous = item.previousSibling
+		while (previous != null) {
+			if (previous.nodeName == nodeName) return previous
+			previous = previous.previousSibling
+		}
+		return null
+	},
+
+	moveBefore : function(item1, item2) {
+		var parent = item1.parentNode
+		parent.removeChild(item1)
+		parent.insertBefore(item1, item2)
+	},
+
+	moveAfter : function(item1, item2) {
+		var parent = item1.parentNode
+		parent.removeChild(item1)
+		parent.insertBefore(item1, item2 ? item2.nextSibling : null)
+	}
+}
+
+/** 
+ * scripts without a proper home
+ *
+ * stuff here is subject to change unapologetically and without warning
+ */
+ToolMan._junkdrawer = {
+	serializeList : function(list) {
+		var items = list.getElementsByTagName("li")
+		var array = new Array()
+		for (var i = 0, n = items.length; i < n; i++) {
+			var item = items[i]
+
+			array.push(ToolMan.junkdrawer()._identifier(item))
+		}
+		return array.join('|')
+	},
+
+	inspectListOrder : function(id) {
+		alert(ToolMan.junkdrawer().serializeList(document.getElementById(id)))
+	},
+
+	restoreListOrder : function(listID) {
+		var list = document.getElementById(listID)
+		if (list == null) return
+
+		var cookie = ToolMan.cookies().get("list-" + listID)
+		if (!cookie) return;
+
+		var IDs = cookie.split('|')
+		var items = ToolMan.junkdrawer()._itemsByID(list)
+
+		for (var i = 0, n = IDs.length; i < n; i++) {
+			var itemID = IDs[i]
+			if (itemID in items) {
+				var item = items[itemID]
+				list.removeChild(item)
+				list.insertBefore(item, null)
+			}
+		}
+	},
+
+	_identifier : function(item) {
+		var trim = ToolMan.junkdrawer().trim
+		var identifier
+
+		identifier = trim(item.getAttribute("id"))
+		if (identifier != null && identifier.length > 0) return identifier;
+		
+		identifier = trim(item.getAttribute("itemID"))
+		if (identifier != null && identifier.length > 0) return identifier;
+		
+		// FIXME: strip out special chars or make this an MD5 hash or something
+		return trim(item.innerHTML)
+	},
+
+	_itemsByID : function(list) {
+		var array = new Array()
+		var items = list.getElementsByTagName('li')
+		for (var i = 0, n = items.length; i < n; i++) {
+			var item = items[i]
+			array[ToolMan.junkdrawer()._identifier(item)] = item
+		}
+		return array
+	},
+
+	trim : function(text) {
+		if (text == null) return null
+		return text.replace(/^(\s+)?(.*\S)(\s+)?$/, '$2')
+	}
+}


Property changes on: plugins/trunk/sociable/class/sociable/tool-man/core.js
___________________________________________________________________
Name: svn:executable
   + *

Added: plugins/trunk/sociable/class/sociable/tool-man/css.js
===================================================================
--- plugins/trunk/sociable/class/sociable/tool-man/css.js	2006-07-21 18:11:54 UTC (rev 3766)
+++ plugins/trunk/sociable/class/sociable/tool-man/css.js	2006-07-22 04:30:05 UTC (rev 3767)
@@ -0,0 +1,17 @@
+/* Copyright (c) 2005 Tim Taylor Consulting (see LICENSE.txt) */
+
+// TODO: write unit tests
+ToolMan._cssFactory = {
+	readStyle : function(element, property) {
+		if (element.style[property]) {
+			return element.style[property]
+		} else if (element.currentStyle) {
+			return element.currentStyle[property]
+		} else if (document.defaultView && document.defaultView.getComputedStyle) {
+			var style = document.defaultView.getComputedStyle(element, null)
+			return style.getPropertyValue(property)
+		} else {
+			return null
+		}
+	}
+}


Property changes on: plugins/trunk/sociable/class/sociable/tool-man/css.js
___________________________________________________________________
Name: svn:executable
   + *

Added: plugins/trunk/sociable/class/sociable/tool-man/drag.js
===================================================================
--- plugins/trunk/sociable/class/sociable/tool-man/drag.js	2006-07-21 18:11:54 UTC (rev 3766)
+++ plugins/trunk/sociable/class/sociable/tool-man/drag.js	2006-07-22 04:30:05 UTC (rev 3767)
@@ -0,0 +1,235 @@
+/* Copyright (c) 2005 Tim Taylor Consulting (see LICENSE.txt) */
+
+ToolMan._dragFactory = {
+	createSimpleGroup : function(element, handle) {
+		handle = handle ? handle : element
+		var group = this.createGroup(element)
+		group.setHandle(handle)
+		group.transparentDrag()
+		group.onTopWhileDragging()
+		return group
+	},
+
+	createGroup : function(element) {
+		var group = new _ToolManDragGroup(this, element)
+
+		var position = ToolMan.css().readStyle(element, 'position')
+		if (position == 'static') {
+			element.style["position"] = 'relative'
+		} else if (position == 'absolute') {
+			/* for Safari 1.2 */
+			ToolMan.coordinates().topLeftOffset(element).reposition(element)
+		}
+
+		// TODO: only if ToolMan.isDebugging()
+		group.register('draginit', this._showDragEventStatus)
+		group.register('dragmove', this._showDragEventStatus)
+		group.register('dragend', this._showDragEventStatus)
+
+		return group
+	},
+
+	_showDragEventStatus : function(dragEvent) {
+		window.status = dragEvent.toString()
+	},
+
+	constraints : function() {
+		return this._constraintFactory
+	},
+
+	_createEvent : function(type, event, group) {
+		return new _ToolManDragEvent(type, event, group)
+	}
+}
+
+function _ToolManDragGroup(factory, element) {
+	this.factory = factory
+	this.element = element
+	this._handle = null
+	this._thresholdDistance = 0
+	this._transforms = new Array()
+	// TODO: refactor into a helper object, move into events.js
+	this._listeners = new Array()
+	this._listeners['draginit'] = new Array()
+	this._listeners['dragstart'] = new Array()
+	this._listeners['dragmove'] = new Array()
+	this._listeners['dragend'] = new Array()
+}
+
+_ToolManDragGroup.prototype = {
+	/*
+	 * TODO:
+	 *   - unregister(type, func)
+	 *   - move custom event listener stuff into Event library
+	 *   - keyboard nudging of "selected" group
+	 */
+
+	setHandle : function(handle) {
+		var events = ToolMan.events()
+
+		handle.toolManDragGroup = this
+		events.register(handle, 'mousedown', this._dragInit)
+		handle.onmousedown = function() { return false }
+
+		if (this.element != handle)
+			events.unregister(this.element, 'mousedown', this._dragInit)
+	},
+
+	register : function(type, func) {
+		this._listeners[type].push(func)
+	},
+
+	addTransform : function(transformFunc) {
+		this._transforms.push(transformFunc)
+	},
+
+	verticalOnly : function() {
+		this.addTransform(this.factory.constraints().vertical())
+	},
+
+	horizontalOnly : function() {
+		this.addTransform(this.factory.constraints().horizontal())
+	},
+
+	setThreshold : function(thresholdDistance) {
+		this._thresholdDistance = thresholdDistance
+	},
+
+	transparentDrag : function(opacity) {
+		var opacity = typeof(opacity) != "undefined" ? opacity : 0.75;
+		var originalOpacity = ToolMan.css().readStyle(this.element, "opacity")
+
+		this.register('dragstart', function(dragEvent) {
+			var element = dragEvent.group.element
+			element.style.opacity = opacity
+			element.style.filter = 'alpha(opacity=' + (opacity * 100) + ')'
+		})
+		this.register('dragend', function(dragEvent) {
+			var element = dragEvent.group.element
+			element.style.opacity = originalOpacity
+			element.style.filter = 'alpha(opacity=100)'
+		})
+	},
+
+	onTopWhileDragging : function(zIndex) {
+		var zIndex = typeof(zIndex) != "undefined" ? zIndex : 100000;
+		var originalZIndex = ToolMan.css().readStyle(this.element, "z-index")
+
+		this.register('dragstart', function(dragEvent) {
+			dragEvent.group.element.style.zIndex = zIndex
+		})
+		this.register('dragend', function(dragEvent) {
+			dragEvent.group.element.style.zIndex = originalZIndex
+		})
+	},
+
+	_dragInit : function(event) {
+		event = ToolMan.events().fix(event)
+		var group = document.toolManDragGroup = this.toolManDragGroup
+		var dragEvent = group.factory._createEvent('draginit', event, group)
+
+		group._isThresholdExceeded = false
+		group._initialMouseOffset = dragEvent.mouseOffset
+		group._grabOffset = dragEvent.mouseOffset.minus(dragEvent.topLeftOffset)
+		ToolMan.events().register(document, 'mousemove', group._drag)
+		document.onmousemove = function() { return false }
+		ToolMan.events().register(document, 'mouseup', group._dragEnd)
+
+		group._notifyListeners(dragEvent)
+	},
+
+	_drag : function(event) {
+		event = ToolMan.events().fix(event)
+		var coordinates = ToolMan.coordinates()
+		var group = this.toolManDragGroup
+		if (!group) return
+		var dragEvent = group.factory._createEvent('dragmove', event, group)
+
+		var newTopLeftOffset = dragEvent.mouseOffset.minus(group._grabOffset)
+
+		// TODO: replace with DragThreshold object
+		if (!group._isThresholdExceeded) {
+			var distance = 
+					dragEvent.mouseOffset.distance(group._initialMouseOffset)
+			if (distance < group._thresholdDistance) return
+			group._isThresholdExceeded = true
+			group._notifyListeners(
+					group.factory._createEvent('dragstart', event, group))
+		}
+
+		for (i in group._transforms) {
+			var transform = group._transforms[i]
+			newTopLeftOffset = transform(newTopLeftOffset, dragEvent)
+		}
+
+		var dragDelta = newTopLeftOffset.minus(dragEvent.topLeftOffset)
+		var newTopLeftPosition = dragEvent.topLeftPosition.plus(dragDelta)
+		newTopLeftPosition.reposition(group.element)
+		dragEvent.transformedMouseOffset = newTopLeftOffset.plus(group._grabOffset)
+
+		group._notifyListeners(dragEvent)
+
+		var errorDelta = newTopLeftOffset.minus(coordinates.topLeftOffset(group.element))
+		if (errorDelta.x != 0 || errorDelta.y != 0) {
+			coordinates.topLeftPosition(group.element).plus(errorDelta).reposition(group.element)
+		}
+	},
+
+	_dragEnd : function(event) {
+		event = ToolMan.events().fix(event)
+		var group = this.toolManDragGroup
+		var dragEvent = group.factory._createEvent('dragend', event, group)
+
+		group._notifyListeners(dragEvent)
+
+		this.toolManDragGroup = null
+		ToolMan.events().unregister(document, 'mousemove', group._drag)
+		document.onmousemove = null
+		ToolMan.events().unregister(document, 'mouseup', group._dragEnd)
+	},
+
+	_notifyListeners : function(dragEvent) {
+		var listeners = this._listeners[dragEvent.type]
+		for (i in listeners) {
+			listeners[i](dragEvent)
+		}
+	}
+}
+
+function _ToolManDragEvent(type, event, group) {
+	this.type = type
+	this.group = group
+	this.mousePosition = ToolMan.coordinates().mousePosition(event)
+	this.mouseOffset = ToolMan.coordinates().mouseOffset(event)
+	this.transformedMouseOffset = this.mouseOffset
+	this.topLeftPosition = ToolMan.coordinates().topLeftPosition(group.element)
+	this.topLeftOffset = ToolMan.coordinates().topLeftOffset(group.element)
+}
+
+_ToolManDragEvent.prototype = {
+	toString : function() {
+		return "mouse: " + this.mousePosition + this.mouseOffset + "    " +
+				"xmouse: " + this.transformedMouseOffset + "    " +
+				"left,top: " + this.topLeftPosition + this.topLeftOffset
+	}
+}
+
+ToolMan._dragFactory._constraintFactory = {
+	vertical : function() {
+		return function(coordinate, dragEvent) {
+			var x = dragEvent.topLeftOffset.x
+			return coordinate.x != x
+					? coordinate.factory.create(x, coordinate.y) 
+					: coordinate
+		}
+	},
+
+	horizontal : function() {
+		return function(coordinate, dragEvent) {
+			var y = dragEvent.topLeftOffset.y
+			return coordinate.y != y
+					? coordinate.factory.create(coordinate.x, y) 
+					: coordinate
+		}
+	}
+}


Property changes on: plugins/trunk/sociable/class/sociable/tool-man/drag.js
___________________________________________________________________
Name: svn:executable
   + *

Added: plugins/trunk/sociable/class/sociable/tool-man/dragsort.js
===================================================================
--- plugins/trunk/sociable/class/sociable/tool-man/dragsort.js	2006-07-21 18:11:54 UTC (rev 3766)
+++ plugins/trunk/sociable/class/sociable/tool-man/dragsort.js	2006-07-22 04:30:05 UTC (rev 3767)
@@ -0,0 +1,87 @@
+/* Copyright (c) 2005 Tim Taylor Consulting (see LICENSE.txt) */
+
+ToolMan._dragsortFactory = {
+	makeSortable : function(item) {
+		var group = ToolMan.drag().createSimpleGroup(item)
+
+		group.register('dragstart', this._onDragStart)
+		group.register('dragmove', this._onDragMove)
+		group.register('dragend', this._onDragEnd)
+
+		return group
+	},
+
+	/** 
+	 * Iterates over a list's items, making them sortable, applying
+	 * optional functions to each item.
+	 *
+	 * example: makeListSortable(myList, myFunc1, myFunc2, ... , myFuncN)
+	 */
+	makeListSortable : function(list) {
+		var helpers = ToolMan.helpers()
+		var coordinates = ToolMan.coordinates()
+		var items = list.getElementsByTagName("li")
+
+		helpers.map(items, function(item) {
+			var dragGroup = dragsort.makeSortable(item)
+			dragGroup.setThreshold(4)
+			var min, max
+			dragGroup.addTransform(function(coordinate, dragEvent) {
+				return coordinate.constrainTo(min, max)
+			})
+			dragGroup.register('dragstart', function() {
+				var items = list.getElementsByTagName("li")
+				min = max = coordinates.topLeftOffset(items[0])
+				for (var i = 1, n = items.length; i < n; i++) {
+					var offset = coordinates.topLeftOffset(items[i])
+					min = min.min(offset)
+					max = max.max(offset)
+				}
+			})
+		})
+		for (var i = 1, n = arguments.length; i < n; i++)
+			helpers.map(items, arguments[i])
+	},
+
+	_onDragStart : function(dragEvent) {
+	},
+
+	_onDragMove : function(dragEvent) {
+		var helpers = ToolMan.helpers()
+		var coordinates = ToolMan.coordinates()
+
+		var item = dragEvent.group.element
+		var xmouse = dragEvent.transformedMouseOffset
+		var moveTo = null
+
+		var previous = helpers.previousItem(item, item.nodeName)
+		while (previous != null) {
+			var bottomRight = coordinates.bottomRightOffset(previous)
+			if (xmouse.y <= bottomRight.y && xmouse.x <= bottomRight.x) {
+				moveTo = previous
+			}
+			previous = helpers.previousItem(previous, item.nodeName)
+		}
+		if (moveTo != null) {
+			helpers.moveBefore(item, moveTo)
+			return
+		}
+
+		var next = helpers.nextItem(item, item.nodeName)
+		while (next != null) {
+			var topLeft = coordinates.topLeftOffset(next)
+			if (topLeft.y <= xmouse.y && topLeft.x <= xmouse.x) {
+				moveTo = next
+			}
+			next = helpers.nextItem(next, item.nodeName)
+		}
+		if (moveTo != null) {
+			helpers.moveBefore(item, helpers.nextItem(moveTo, item.nodeName))
+			return
+		}
+	},
+
+	_onDragEnd : function(dragEvent) {
+		ToolMan.coordinates().create(0, 0).reposition(dragEvent.group.element)
+	}
+}


Property changes on: plugins/trunk/sociable/class/sociable/tool-man/dragsort.js
___________________________________________________________________
Name: svn:executable
   + *

Added: plugins/trunk/sociable/class/sociable/tool-man/events.js
===================================================================
--- plugins/trunk/sociable/class/sociable/tool-man/events.js	2006-07-21 18:11:54 UTC (rev 3766)
+++ plugins/trunk/sociable/class/sociable/tool-man/events.js	2006-07-22 04:30:05 UTC (rev 3767)
@@ -0,0 +1,43 @@
+/* Copyright (c) 2005 Tim Taylor Consulting (see LICENSE.txt) */
+
+ToolMan._eventsFactory = {
+	fix : function(event) {
+		if (!event) event = window.event
+
+		if (event.target) {
+			if (event.target.nodeType == 3) event.target = event.target.parentNode
+		} else if (event.srcElement) {
+			event.target = event.srcElement
+		}
+
+		return event
+	},
+
+	register : function(element, type, func) {
+		if (element.addEventListener) {
+			element.addEventListener(type, func, false)
+		} else if (element.attachEvent) {
+			if (!element._listeners) element._listeners = new Array()
+			if (!element._listeners[type]) element._listeners[type] = new Array()
+			var workaroundFunc = function() {
+				func.apply(element, new Array())
+			}
+			element._listeners[type][func] = workaroundFunc
+			element.attachEvent('on' + type, workaroundFunc)
+		}
+	},
+
+	unregister : function(element, type, func) {
+		if (element.removeEventListener) {
+			element.removeEventListener(type, func, false)
+		} else if (element.detachEvent) {
+			if (element._listeners 
+					&& element._listeners[type] 
+					&& element._listeners[type][func]) {
+
+				element.detachEvent('on' + type, 
+						element._listeners[type][func])
+			}
+		}
+	}
+}


Property changes on: plugins/trunk/sociable/class/sociable/tool-man/events.js
___________________________________________________________________
Name: svn:executable
   + *

Added: plugins/trunk/sociable/class/view/pluginsociableconfigview.class.php
===================================================================
--- plugins/trunk/sociable/class/view/pluginsociableconfigview.class.php	2006-07-21 18:11:54 UTC (rev 3766)
+++ plugins/trunk/sociable/class/view/pluginsociableconfigview.class.php	2006-07-22 04:30:05 UTC (rev 3767)
@@ -0,0 +1,61 @@
+<?php
+    /*
+    Copyright 2006 Paul Westbrook (paul at westbrooks.org)
+    
+    This 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.
+    
+    This 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.
+    
+    You 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
+    */
+
+	
+	include_once( PLOG_CLASS_PATH."class/view/admin/adminplugintemplatedview.class.php" );
+
+	/**
+	 * implements the main view of the feed reader plugin
+	 */
+	class PluginSociableConfigView extends AdminPluginTemplatedView
+	{
+        var $_pm;
+
+
+
+		function PluginSociableConfigView( $blogInfo )
+		{
+			$this->AdminPluginTemplatedView( $blogInfo, "sociable", "sociable" );
+			
+			$this->_pm =& PluginManager::getPluginManager();
+			$this->_pm->setBlogInfo( $this->_blogInfo );
+
+		}
+		
+		function render()
+		{
+			// load some configuration settings
+			$blogSettings = $this->_blogInfo->getSettings();
+			$pluginEnabled = $blogSettings->getValue( "plugin_sociable_enabled" );
+			
+			// create a view and export the settings to the template
+			$this->setValue( "pluginEnabled", $pluginEnabled );		
+			
+			$plugins = $this->_pm->getPlugins();
+
+            // now $plugins is an array where the key is the plugin id
+            // and the value is an instance of the PluginXXX class
+            $plugin = $plugins["sociable"];
+
+			$this->setValue( sociable, $plugin );
+			
+			parent::render();
+		}
+	}
+?>
\ No newline at end of file

Added: plugins/trunk/sociable/locale/locale_en_UK.php
===================================================================
--- plugins/trunk/sociable/locale/locale_en_UK.php	2006-07-21 18:11:54 UTC (rev 3766)
+++ plugins/trunk/sociable/locale/locale_en_UK.php	2006-07-22 04:30:05 UTC (rev 3767)
@@ -0,0 +1,13 @@
+<?php
+$messages["manageAppearancePlugins"] = "Appearance Management";
+$messages["sociable"] = "Sociable";
+
+$messages["sociable_plugin_enabled"] = "Enable this plugin";
+$messages["sociable_plugin"] = "Sociable Plugin";
+$messages["detail"] = "Detail";
+
+$messages["sociable_settings_saved_ok"] = "Sociable settings saved successfully!";
+
+$messages["label_configuration"] = "Configuration";
+$messages["label_enable"] = "Enable";
+?>
\ No newline at end of file

Added: plugins/trunk/sociable/pluginsociable.class.php
===================================================================
--- plugins/trunk/sociable/pluginsociable.class.php	2006-07-21 18:11:54 UTC (rev 3766)
+++ plugins/trunk/sociable/pluginsociable.class.php	2006-07-22 04:30:05 UTC (rev 3767)
@@ -0,0 +1,169 @@
+<?php
+    /*
+    Copyright 2006 Paul Westbrook (paul at westbrooks.org)
+    
+    Based on Sociable by Peter Harkins
+    http://push.cx/sociable
+    
+    This 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.
+    
+    This 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.
+    
+    You 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
+    */
+
+
+
+	include_once( PLOG_CLASS_PATH."class/plugin/pluginbase.class.php" );
+	include_once( PLOG_CLASS_PATH."class/plugin/pluginmanager.class.php" );
+	include_once( PLOG_CLASS_PATH."plugins/sociable/class/sociable/sociable.php" );
+
+
+	class PluginSociable extends PluginBase
+	{
+		var $pluginEnabled;
+		
+		function PluginSociable()
+		{
+			$this->PluginBase();
+
+			$this->id      = "sociable";
+			$this->author  = "Paul Westbrook";
+			$this->desc    = "The Sociable plugin appends links for your readers to use those sites to the end of each of your blogÕs posts, increasing your potential audience.";
+
+			$this->locales = Array( "en_UK");
+
+			$this->init();
+		}
+
+		function init()
+		{
+            $this->registerAdminAction( "sociableConfig", "PluginSociableConfigAction" );
+			$this->registerAdminAction( "updateSociableConfig", "PluginSociableUpdateConfigAction" );
+			
+			$menu =& Menu::getMenu();
+			if( !$menu->entryExists( "/menu/controlCenter/manageAppearancePlugins" ))						
+				$this->addMenuEntry( "/menu/controlCenter", "manageAppearancePlugins", "", "", true, false );			
+            $this->addMenuEntry( "/menu/controlCenter/manageAppearancePlugins", "sociable", "?op=sociableConfig", "" );
+		}
+
+		function register()
+		{
+		    $blogSettings = $this->blogInfo->getSettings();
+			$this->pluginEnabled = $blogSettings->getValue( "plugin_sociable_enabled" );
+		}
+
+	    function isEnabled()
+	    {
+	        return $this->pluginEnabled;
+	    }
+	    
+	    function showCSS()
+	    {
+			$str = '';
+	    
+            if ($this->isEnabled())
+            {
+    
+               $rg = $this->blogInfo->getBlogRequestGenerator();
+
+	           $str .=  '<link rel="stylesheet" type="text/css" media="screen" href="' . $rg->blogLink() .'/plugins/sociable/class/sociable/sociable.css" />';
+            
+            }	
+            
+            return $str;
+
+	    }
+	    
+	    
+	    function show($postId)
+	    {
+            global $sociable_builtin_known_sites;
+            include( PLOG_CLASS_PATH."plugins/sociable/class/sociable/sociable.php" );
+
+			$str = '';
+	    
+            if ($this->isEnabled())
+            {
+            
+                // articles object
+                $articles = new Articles;
+    
+    
+                $rg = $this->blogInfo->getBlogRequestGenerator();
+                $post = $articles->getBlogArticle($postId);
+	            $blogSettings = $this->blogInfo->getSettings();
+
+                $blogname = urlencode($this->blogInfo->getBlog());
+                $permalink = urlencode($rg->postPermalink($post));
+                $title = urlencode($post->getTopic());
+                
+                $str .= '<div class="sociable"><span class="sociable_tagline">';
+//                $str .= get_option("sociable_tagline");
+                $str .= '<span>These icons link to social bookmarking sites where readers can share and discover new web pages.</span></span><ul>' . "\n";
+
+		        foreach($sociable_builtin_known_sites as $sitename=>$site)
+		        {
+                    $siteEnabled = $blogSettings->getValue("plugin_sociable_" . $sitename . "_enabled");
+                    $siteEnabled = ($siteEnabled != "");
+                    if( !$siteEnabled )
+                        continue;
+                    
+                    $url = $site['url'];
+                    $url = str_replace('PERMALINK', $permalink, $url);
+                    $url = str_replace('TITLE', $title, $url);
+                    $url = str_replace('BLOGNAME', $blogname, $url);
+ 
+                    $str .= "<a href=\"$url\" title=\"$sitename\">";
+                    $str .= '<img src="'. $rg->blogLink() .'/plugins/sociable/class/sociable/images/' . $site['favicon'] . '" alt="' . $sitename .'" />';
+                    $str .= "</a></li>\n";
+
+                }                
+             	$str .= "</ul></div>\n";
+
+             }
+	    	return $str;
+		}
+		
+		function showAdmin()
+		{
+		      global $sociable_builtin_known_sites;
+        	include( PLOG_CLASS_PATH."plugins/sociable/class/sociable/sociable.php" );
+
+		      $str = '';
+		      
+	           $blogSettings = $this->blogInfo->getSettings();
+               $rg = $this->blogInfo->getBlogRequestGenerator();
+
+
+		      foreach($sociable_builtin_known_sites as $sitename=>$site)
+		      {
+		          $str .= '<div class="field">';
+		          $str .= '<label for="'. $sitename . '">'.$sitename .'</label>';
+                  $str .= '<div class="formHelp">';
+                  $str .= '<img src="'. $rg->blogLink() .'/plugins/sociable/class/sociable/images/' . $site['favicon'] . '" alt="' . $sitename .'" />';
+                  $str .= '<input class="checkbox" type="checkbox" name="'. strtr($sitename, ".", "_") .'" id="'. strtr($sitename, ".", "_") .'"';
+                  
+                  $siteEnabled = $blogSettings->getValue("plugin_sociable_" . $sitename . "_enabled");
+                  $siteEnabled = ($siteEnabled != "");
+                  if ($siteEnabled)
+                  {
+                      $str .= 'checked="checked"';
+                  }
+                  $str .= 'value="1" /> Enable '.  $sitename;
+                  $str .= '  </div>';
+                  $str .= '  </div>';
+		      }
+		      
+		      return $str;
+		}
+	}
+?>
\ No newline at end of file

Added: plugins/trunk/sociable/templates/sociable.template
===================================================================
--- plugins/trunk/sociable/templates/sociable.template	2006-07-21 18:11:54 UTC (rev 3766)
+++ plugins/trunk/sociable/templates/sociable.template	2006-07-22 04:30:05 UTC (rev 3767)
@@ -0,0 +1,26 @@
+{include file="$admintemplatepath/header.template"}
+{include file="$admintemplatepath/navigation.template" showOpt=sociable title=$locale->tr("sociable_plugin")}
+<form name="commentPluginConfig" method="post">
+ <fieldset class="inputField">
+ <legend>{$locale->tr("label_configuration")}</legend>  
+  {include file="$admintemplatepath/successmessage.template"}
+  {include file="$admintemplatepath/errormessage.template"}   
+  <div class="field">
+   <label for="pluginEnabled">{$locale->tr("label_enable")}</label>
+   <div class="formHelp">   
+    <input class="checkbox" type="checkbox" name="pluginEnabled" id="pluginEnabled" {if $pluginEnabled} checked="checked" {/if} value="1" />{$locale->tr("sociable_plugin_enabled")}
+   </div>
+  </div>
+  
+  {$sociable->showAdmin()}
+  
+ </fieldset>  
+
+ <div class="buttons">
+  <input type="hidden" name="op" value="updateSociableConfig" />
+  <input type="reset" name="{$locale->tr("reset")}" />    
+  <input type="submit" name="{$locale->tr("update_settings")}" value="{$locale->tr("update")}" />
+ </div>
+</form>
+{include file="$admintemplatepath/footernavigation.template"}
+{include file="$admintemplatepath/footer.template"}
\ No newline at end of file



More information about the pLog-svn mailing list