Hello,<br> Yes you do have to register for an account at AddThis. There is a link in the admin panel right above where you enter your username.<br><br>--Paul<br><br><div class="gmail_quote">On Sat, Jul 12, 2008 at 8:50 AM, fabian büttner <<a href="mailto:fabian-buettner@gmx.de">fabian-buettner@gmx.de</a>> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Does one have to register at <a href="http://addthis.com" target="_blank">addthis.com</a> to be able to use this plugin?<br>
<br>
Sorry, but I have to admit this plugin looks a lot better than the<br>
sociable plugin (have seen it on your blog) :)<br>
<br>
Can't wait to get my hands on it :)<br>
<div><div></div><div class="Wj3C7c"><br>
On Sat, 2008-07-12 at 06:46 -0400, <a href="mailto:pwestbro@devel.lifetype.net">pwestbro@devel.lifetype.net</a> wrote:<br>
> Author: pwestbro<br>
> Date: 2008-07-12 06:46:31 -0400 (Sat, 12 Jul 2008)<br>
> New Revision: 6693<br>
><br>
> Added:<br>
> plugins/branches/lifetype-1.2/addthis/<br>
> plugins/branches/lifetype-1.2/addthis/README.txt<br>
> plugins/branches/lifetype-1.2/addthis/class/<br>
> plugins/branches/lifetype-1.2/addthis/class/action/<br>
> plugins/branches/lifetype-1.2/addthis/class/action/pluginaddthisconfigaction.class.php<br>
> plugins/branches/lifetype-1.2/addthis/class/action/pluginaddthisupdateconfigaction.class.php<br>
> plugins/branches/lifetype-1.2/addthis/class/view/<br>
> plugins/branches/lifetype-1.2/addthis/class/view/pluginaddthisconfigview.class.php<br>
> plugins/branches/lifetype-1.2/addthis/locale/<br>
> plugins/branches/lifetype-1.2/addthis/locale/locale_en_UK.php<br>
> plugins/branches/lifetype-1.2/addthis/pluginaddthis.class.php<br>
> plugins/branches/lifetype-1.2/addthis/templates/<br>
> plugins/branches/lifetype-1.2/addthis/templates/addthis.template<br>
> Log:<br>
> Initial checkin of the AddThis plugin.<br>
><br>
> Check out AddThis at <a href="http://www.addthis.com" target="_blank">http://www.addthis.com</a><br>
><br>
><br>
><br>
> Added: plugins/branches/lifetype-1.2/addthis/README.txt<br>
> ===================================================================<br>
> --- plugins/branches/lifetype-1.2/addthis/README.txt (rev 0)<br>
> +++ plugins/branches/lifetype-1.2/addthis/README.txt 2008-07-12 10:46:31 UTC (rev 6693)<br>
> @@ -0,0 +1,44 @@<br>
> +[DESCRIPTION]<br>
> +The AddThis plugin adds links to social bookmarking sites to each of<br>
> +your blog posts.<br>
> +<br>
> +[USAGES]:<br>
> +1. Upload: Upload all the extract files and directories to<br>
> + $LifeType_Install_Dir/plugin/addthis<br>
> +2. Next you need to add the following to post.template:<br>
> + {assign var="addThisPostId" value=$post->getId()}<br>
> + {$addthis->show($addThisPostId)}<br>
> +<br>
> +<br>
> +[EXAMPLE (From the template 'Falling Leaves with plug-ins]<br>
> +{assign var="postDate" value=$post->getDateObject()}<br>
> +{assign var="postOwner" value=$post->getUserInfo()}<br>
> +{assign var="addthisPostId" value=$post->getId()}<br>
> +<br>
> + <DIV class=post><br>
> + <H2 class=storytitle ><A class=aposted<br>
> + href="{$url->postPermalink($post)}">{$post->getTopic()}</A></H2><br>
> + <DIV class=date>Published on<br>
> + {$locale->formatDate($postDate,"%H:%M, %m/%d,%Y")}</DIV><br>
> + <DIV class=storycontent><br>
> + <P>{$post->getText()}</P><br>
> + </DIV><BR><br>
> + <DIV class=feedback><br>
> + <DIV class=meta>Posted under<br>
> + {foreach name=categories from=$post->getCategories()<br>
> + item=postcategory}<br>
> + <a<br>
> + href="{$url->categoryLink($postcategory)}">{$postcategory->getName()}</a><br>
> + {if !$smarty.foreach.categories.last}, {/if}<br>
> + {/foreach}<br>
> +<br>
> + | <A<br>
> + href="{$url->postPermalink($post)}#comments">{$locale->tr("comment<br>
> + on this")} ({$post->getTotalComments()})</A><br>
> + {$addthis->show($addthisPostId)}<br>
> + </DIV><br>
> + </DIV><br>
> + <DIV class=sep></DIV><br>
> + </DIV><br>
> +<br>
> +[END EXAMPLE]<br>
><br>
> Added: plugins/branches/lifetype-1.2/addthis/class/action/pluginaddthisconfigaction.class.php<br>
> ===================================================================<br>
> --- plugins/branches/lifetype-1.2/addthis/class/action/pluginaddthisconfigaction.class.php (rev 0)<br>
> +++ plugins/branches/lifetype-1.2/addthis/class/action/pluginaddthisconfigaction.class.php 2008-07-12 10:46:31 UTC (rev 6693)<br>
> @@ -0,0 +1,47 @@<br>
> +<?php<br>
> +<br>
> + /*<br>
> + Copyright 2006, 2008 Paul Westbrook (<a href="mailto:paul@westbrooks.org">paul@westbrooks.org</a>)<br>
> +<br>
> + This program is free software; you can redistribute it and/or modify<br>
> + it under the terms of the GNU General Public License as published by<br>
> + the Free Software Foundation; either version 2 of the License, or<br>
> + (at your option) any later version.<br>
> +<br>
> + This program is distributed in the hope that it will be useful,<br>
> + but WITHOUT ANY WARRANTY; without even the implied warranty of<br>
> + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the<br>
> + GNU General Public License for more details.<br>
> +<br>
> + You should have received a copy of the GNU General Public License<br>
> + along with this program; if not, write to the Free Software<br>
> + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA<br>
> + */<br>
> +<br>
> +<br>
> + lt_include( PLOG_CLASS_PATH."class/action/admin/adminaction.class.php" );<br>
> + lt_include( PLOG_CLASS_PATH."plugins/addthis/class/view/pluginaddthisconfigview.class.php" );<br>
> +<br>
> + /**<br>
> + * shows a form with the current configuration<br>
> + */<br>
> + class PluginAddThisConfigAction extends AdminAction<br>
> + {<br>
> +<br>
> + function PluginAddThisConfigAction( $actionInfo, $request )<br>
> + {<br>
> + $this->AdminAction( $actionInfo, $request );<br>
> + error_log("PluginAddThisConfigAction");<br>
> + }<br>
> +<br>
> + function perform()<br>
> + {<br>
> + error_log("PluginAddThisConfigAction::perform");<br>
> + $this->_view = new PluginAddThisConfigView( $this->_blogInfo );<br>
> +<br>
> + $this->setCommonData();<br>
> +<br>
> + return true;<br>
> + }<br>
> + }<br>
> +?><br>
><br>
> Added: plugins/branches/lifetype-1.2/addthis/class/action/pluginaddthisupdateconfigaction.class.php<br>
> ===================================================================<br>
> --- plugins/branches/lifetype-1.2/addthis/class/action/pluginaddthisupdateconfigaction.class.php (rev 0)<br>
> +++ plugins/branches/lifetype-1.2/addthis/class/action/pluginaddthisupdateconfigaction.class.php 2008-07-12 10:46:31 UTC (rev 6693)<br>
> @@ -0,0 +1,92 @@<br>
> +<?php<br>
> +<br>
> + /*<br>
> + Copyright 2006, 2008 Paul Westbrook (<a href="mailto:paul@westbrooks.org">paul@westbrooks.org</a>)<br>
> +<br>
> + This program is free software; you can redistribute it and/or modify<br>
> + it under the terms of the GNU General Public License as published by<br>
> + the Free Software Foundation; either version 2 of the License, or<br>
> + (at your option) any later version.<br>
> +<br>
> + This program is distributed in the hope that it will be useful,<br>
> + but WITHOUT ANY WARRANTY; without even the implied warranty of<br>
> + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the<br>
> + GNU General Public License for more details.<br>
> +<br>
> + You should have received a copy of the GNU General Public License<br>
> + along with this program; if not, write to the Free Software<br>
> + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA<br>
> + */<br>
> +<br>
> + lt_include( PLOG_CLASS_PATH."class/action/admin/adminaction.class.php" );<br>
> + lt_include( PLOG_CLASS_PATH."plugins/addthis/class/view/pluginaddthisconfigview.class.php" );<br>
> +<br>
> + /**<br>
> + * updates the plugin configuration<br>
> + */<br>
> + class PluginAddThisUpdateConfigAction extends AdminAction<br>
> + {<br>
> + var $_pluginEnabled;<br>
> + var $_username;<br>
> +<br>
> + function PluginAddThisUpdateConfigAction( $actionInfo, $request )<br>
> + {<br>
> + $this->AdminAction( $actionInfo, $request );<br>
> + }<br>
> +<br>
> + function validate()<br>
> + {<br>
> +<br>
> + $this->_pluginEnabled = $this->_request->getValue( "pluginEnabled" );<br>
> + $this->_pluginEnabled = ($this->_pluginEnabled != "" );<br>
> +<br>
> + $this->_username = $this->_request->getValue( "username" );<br>
> +<br>
> +<br>
> + if( $this->_pluginEnabled == true && $this->_username == "" ) {<br>
> + $this->_view = new PluginAddThisConfigView( $this->_blogInfo );<br>
> + $this->_view->setErrorMessage( $this->_locale->tr("addthis_missing_username"));<br>
> + $this->setCommonData();<br>
> +<br>
> + return false;<br>
> + }<br>
> +<br>
> + return true;<br>
> + }<br>
> +<br>
> + function perform()<br>
> + {<br>
> + // update the plugin configurations to blog setting<br>
> + $blogSettings = $this->_blogInfo->getSettings();<br>
> + $blogSettings->setValue( "plugin_addthis_enabled", $this->_pluginEnabled );<br>
> +<br>
> + $blogSettings->setValue( "plugin_addthis_username", $this->_username );<br>
> + $this->_blogInfo->setSettings( $blogSettings );<br>
> +<br>
> +<br>
> + // save the blogs settings<br>
> + $blogs = new Blogs();<br>
> + if( !$blogs->updateBlog( $this->_blogInfo )) {<br>
> + $this->_view = new PluginAddThisConfigView( $this->_blogInfo );<br>
> + $this->_view->setErrorMessage( $this->_locale->tr("error_updating_settings"));<br>
> + $this->setCommonData();<br>
> +<br>
> + return false;<br>
> + }<br>
> +<br>
> + // if everything went ok...<br>
> + $this->_blogInfo->setSettings( $blogSettings );<br>
> + $this->_session->setValue( "blogInfo", $this->_blogInfo );<br>
> + $this->saveSession();<br>
> +<br>
> + $this->_view = new PluginAddThisConfigView( $this->_blogInfo );<br>
> + $this->_view->setSuccessMessage( $this->_locale->tr("addthis_settings_saved_ok"));<br>
> + $this->setCommonData();<br>
> +<br>
> + // clear the cache<br>
> + CacheControl::resetBlogCache( $this->_blogInfo->getId());<br>
> +<br>
> + return true;<br>
> + }<br>
> + }<br>
> +?><br>
><br>
> Added: plugins/branches/lifetype-1.2/addthis/class/view/pluginaddthisconfigview.class.php<br>
> ===================================================================<br>
> --- plugins/branches/lifetype-1.2/addthis/class/view/pluginaddthisconfigview.class.php (rev 0)<br>
> +++ plugins/branches/lifetype-1.2/addthis/class/view/pluginaddthisconfigview.class.php 2008-07-12 10:46:31 UTC (rev 6693)<br>
> @@ -0,0 +1,49 @@<br>
> +<?php<br>
> + /*<br>
> + Copyright 2006, 2008 Paul Westbrook (<a href="mailto:paul@westbrooks.org">paul@westbrooks.org</a>)<br>
> +<br>
> + This program is free software; you can redistribute it and/or modify<br>
> + it under the terms of the GNU General Public License as published by<br>
> + the Free Software Foundation; either version 2 of the License, or<br>
> + (at your option) any later version.<br>
> +<br>
> + This program is distributed in the hope that it will be useful,<br>
> + but WITHOUT ANY WARRANTY; without even the implied warranty of<br>
> + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the<br>
> + GNU General Public License for more details.<br>
> +<br>
> + You should have received a copy of the GNU General Public License<br>
> + along with this program; if not, write to the Free Software<br>
> + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA<br>
> + */<br>
> +<br>
> +<br>
> + lt_include( PLOG_CLASS_PATH."class/view/admin/adminplugintemplatedview.class.php" );<br>
> +<br>
> + /**<br>
> + * implements the main view of the feed reader plugin<br>
> + */<br>
> + class PluginAddThisConfigView extends AdminPluginTemplatedView<br>
> + {<br>
> +<br>
> +<br>
> + function PluginAddThisConfigView( $blogInfo )<br>
> + {<br>
> + $this->AdminPluginTemplatedView( $blogInfo, "addthis", "addthis" );<br>
> +<br>
> + }<br>
> +<br>
> + function render()<br>
> + {<br>
> + // load some configuration settings<br>
> + $blogSettings = $this->_blogInfo->getSettings();<br>
> + $pluginEnabled = $blogSettings->getValue( "plugin_addthis_enabled" );<br>
> +<br>
> + $username = $blogSettings->getValue( "plugin_addthis_username" );<br>
> + // create a view and export the settings to the template<br>
> + $this->setValue( "pluginEnabled", $pluginEnabled );<br>
> + $this->setValue( "username", $username );<br>
> + parent::render();<br>
> + }<br>
> + }<br>
> +?><br>
><br>
> Added: plugins/branches/lifetype-1.2/addthis/locale/locale_en_UK.php<br>
> ===================================================================<br>
> --- plugins/branches/lifetype-1.2/addthis/locale/locale_en_UK.php (rev 0)<br>
> +++ plugins/branches/lifetype-1.2/addthis/locale/locale_en_UK.php 2008-07-12 10:46:31 UTC (rev 6693)<br>
> @@ -0,0 +1,17 @@<br>
> +<?php<br>
> +$messages["manageAppearancePlugins"] = "Appearance Management";<br>
> +$messages["addthis"] = "AddThis";<br>
> +<br>
> +$messages["addthis_plugin_enabled"] = "Enable this plugin";<br>
> +$messages["addthis_username"] = "Username for account on AddThis. To obtain account go to <a href=\"<a href="http://www.addthis.com/%5C" target="_blank">http://www.addthis.com/\</a>"><a href="http://www.addthis.com/" target="_blank">http://www.addthis.com/</a></a>";<br>
> +$messages["addthis_plugin"] = "AddThis Plugin";<br>
> +$messages["detail"] = "Detail";<br>
> +<br>
> +$messages["addthis_settings_saved_ok"] = "AddThis settings saved successfully!";<br>
> +$messages["addthis_missing_username"] = "AddThis username needs to be specified!";<br>
> +<br>
> +<br>
> +$messages["label_configuration"] = "Configuration";<br>
> +$messages["label_addthis_username"] = "AddThis username";<br>
> +$messages["label_enable"] = "Enable";<br>
> +?><br>
><br>
> Added: plugins/branches/lifetype-1.2/addthis/pluginaddthis.class.php<br>
> ===================================================================<br>
> --- plugins/branches/lifetype-1.2/addthis/pluginaddthis.class.php (rev 0)<br>
> +++ plugins/branches/lifetype-1.2/addthis/pluginaddthis.class.php 2008-07-12 10:46:31 UTC (rev 6693)<br>
> @@ -0,0 +1,107 @@<br>
> +<?php<br>
> + /*<br>
> + Copyright 2006, 2008 Paul Westbrook (<a href="mailto:paul@westbrooks.org">paul@westbrooks.org</a>)<br>
> +<br>
> + This program is free software; you can redistribute it and/or modify<br>
> + it under the terms of the GNU General Public License as published by<br>
> + the Free Software Foundation; either version 2 of the License, or<br>
> + (at your option) any later version.<br>
> +<br>
> + This program is distributed in the hope that it will be useful,<br>
> + but WITHOUT ANY WARRANTY; without even the implied warranty of<br>
> + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the<br>
> + GNU General Public License for more details.<br>
> +<br>
> + You should have received a copy of the GNU General Public License<br>
> + along with this program; if not, write to the Free Software<br>
> + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA<br>
> + */<br>
> +<br>
> +<br>
> +<br>
> + lt_include( PLOG_CLASS_PATH."class/plugin/pluginbase.class.php" );<br>
> + lt_include( PLOG_CLASS_PATH."class/plugin/pluginmanager.class.php" );<br>
> +<br>
> +<br>
> + class PluginAddThis extends PluginBase<br>
> + {<br>
> + var $pluginEnabled;<br>
> + var $addThisUsername;<br>
> +<br>
> + function PluginAddThis( $source = "" )<br>
> + {<br>
> + $this->PluginBase($source);<br>
> +<br>
> + $this->id = "addthis";<br>
> + $this->author = "Paul Westbrook";<br>
> + $this->desc = "The AddThis plugin creates an AddThis button for each post. This allows your users to bookmark or share your articles";<br>
> + $this->version = "20080712";<br>
> +<br>
> + $this->locales = Array( "en_UK");<br>
> +<br>
> + if( $source == "admin" )<br>
> + $this->initAdmin();<br>
> + }<br>
> +<br>
> + function initAdmin()<br>
> + {<br>
> + $this->registerAdminAction( "addthisConfig", "PluginAddThisConfigAction" );<br>
> + $this->registerAdminAction( "updateAddThisConfig", "PluginAddThisUpdateConfigAction" );<br>
> +<br>
> + $menu =& Menu::getMenu();<br>
> + if( !$menu->entryExists( "/menu/controlCenter/manageAppearancePlugins" ))<br>
> + $this->addMenuEntry( "/menu/controlCenter", "manageAppearancePlugins", "", "", true, false );<br>
> +<br>
> + $this->addMenuEntry( "/menu/controlCenter/manageAppearancePlugins", "addthis", "?op=addthisConfig", "" );<br>
> + }<br>
> +<br>
> + function register()<br>
> + {<br>
> + $blogSettings = $this->blogInfo->getSettings();<br>
> + $this->pluginEnabled = $blogSettings->getValue( "plugin_addthis_enabled" );<br>
> + $this->addThisUsername = $blogSettings->getValue( "plugin_addthis_username" );<br>
> + }<br>
> +<br>
> + function isEnabled()<br>
> + {<br>
> + return $this->pluginEnabled;<br>
> + }<br>
> +<br>
> +<br>
> + function show($postId)<br>
> + {<br>
> + $str = '';<br>
> +<br>
> + if ($this->isEnabled())<br>
> + {<br>
> +<br>
> + // articles object<br>
> + $articles = new Articles;<br>
> +<br>
> +<br>
> + $rg = $this->blogInfo->getBlogRequestGenerator();<br>
> + $rg->setXHTML( false );<br>
> + $post = $articles->getBlogArticle($postId);<br>
> + $blogSettings = $this->blogInfo->getSettings();<br>
> + $locale =& $this->blogInfo->getLocale();<br>
> +<br>
> + $blogname = $this->blogInfo->getBlog();<br>
> + $permalink = $rg->postPermalink($post);<br>
> + $title = $post->getTopic();<br>
> +<br>
> +<br>
> + $str .= '<!-- ADDTHIS BUTTON BEGIN -->';<br>
> + $str .= '<script type="text/javascript">';<br>
> + $str .= 'addthis_pub = "' . $this->addThisUsername . '";';<br>
> + $str .= 'addthis_brand = "' . $blogname . '";';<br>
> + $str .= '</script>';<br>
> + $str .= '<a href="<a href="http://www.addthis.com/bookmark.php" target="_blank">http://www.addthis.com/bookmark.php</a>" onmouseover="return addthis_open(this, \'\', \'' . $permalink . '\', \'' . $title . '\')" onmouseout="addthis_close()" onclick="return addthis_sendto()"><img src="<a href="http://s9.addthis.com/button1-share.gif" target="_blank">http://s9.addthis.com/button1-share.gif</a>" width="125" height="16" border="0" alt="" /></a>';<br>
> + $str .= '<script type="text/javascript" src="<a href="http://s7.addthis.com/js/152/addthis_widget.js" target="_blank">http://s7.addthis.com/js/152/addthis_widget.js</a>"></script>';<br>
> + $str .= '<!-- ADDTHIS BUTTON END -->';<br>
> +<br>
> + }<br>
> + return $str;<br>
> + }<br>
> +<br>
> + }<br>
> +?><br>
><br>
> Added: plugins/branches/lifetype-1.2/addthis/templates/addthis.template<br>
> ===================================================================<br>
> --- plugins/branches/lifetype-1.2/addthis/templates/addthis.template (rev 0)<br>
> +++ plugins/branches/lifetype-1.2/addthis/templates/addthis.template 2008-07-12 10:46:31 UTC (rev 6693)<br>
> @@ -0,0 +1,32 @@<br>
> +{include file="$admintemplatepath/header.template"}<br>
> +{include file="$admintemplatepath/navigation.template" showOpt=addthis title=$locale->tr("addthis_plugin")}<br>
> +<form name="commentPluginConfig" method="post"><br>
> + <fieldset class="inputField"><br>
> + <legend>{$locale->tr("label_configuration")}</legend><br>
> + {include file="$admintemplatepath/successmessage.template"}<br>
> + {include file="$admintemplatepath/errormessage.template"}<br>
> + <div class="field"><br>
> + <label for="pluginEnabled">{$locale->tr("label_enable")}</label><br>
> + <div class="formHelp"><br>
> + <input class="checkbox" type="checkbox" name="pluginEnabled" id="pluginEnabled" {if $pluginEnabled} checked="checked" {/if} value="1" />{$locale->tr("addthis_plugin_enabled")}<br>
> + </div><br>
> + </div><br>
> +<br>
> + <div class="field"><br>
> + <label for="username">{$locale->tr("label_addthis_username")}</label><br>
> + <span class="required">*</span><br>
> + <div class="formHelp">{$locale->tr("addthis_username")}<br>
> + <input class="text" type="text" name="username" id="username" value="{$username}" width="10" /><br>
> + </div><br>
> + </div><br>
> +<br>
> + </fieldset><br>
> +<br>
> + <div class="buttons"><br>
> + <input type="hidden" name="op" value="updateAddThisConfig" /><br>
> + <input type="reset" name="{$locale->tr("reset")}" /><br>
> + <input type="submit" name="{$locale->tr("update_settings")}" value="{$locale->tr("update")}" /><br>
> + </div><br>
> +</form><br>
> +{include file="$admintemplatepath/footernavigation.template"}<br>
> +{include file="$admintemplatepath/footer.template"}<br>
><br>
> _______________________________________________<br>
> pLog-svn mailing list<br>
> <a href="mailto:pLog-svn@devel.lifetype.net">pLog-svn@devel.lifetype.net</a><br>
> <a href="http://limedaley.com/mailman/listinfo/plog-svn" target="_blank">http://limedaley.com/mailman/listinfo/plog-svn</a><br>
<br>
_______________________________________________<br>
pLog-svn mailing list<br>
<a href="mailto:pLog-svn@devel.lifetype.net">pLog-svn@devel.lifetype.net</a><br>
<a href="http://limedaley.com/mailman/listinfo/plog-svn" target="_blank">http://limedaley.com/mailman/listinfo/plog-svn</a><br>
</div></div></blockquote></div><br>