[pLog-svn] r6693 - in plugins/branches/lifetype-1.2: . addthis addthis/class addthis/class/action addthis/class/view addthis/locale addthis/templates

Paul Westbrook paul at westbrooks.org
Sat Jul 12 14:58:47 EDT 2008


Hello,
   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.

--Paul

On Sat, Jul 12, 2008 at 8:50 AM, fabian büttner <fabian-buettner at gmx.de>
wrote:

> Does one have to register at addthis.com to be able to use this plugin?
>
> Sorry, but I have to admit this plugin looks a lot better than the
> sociable plugin (have seen it on your blog) :)
>
> Can't wait to get my hands on it :)
>
> On Sat, 2008-07-12 at 06:46 -0400, pwestbro at devel.lifetype.net wrote:
> > Author: pwestbro
> > Date: 2008-07-12 06:46:31 -0400 (Sat, 12 Jul 2008)
> > New Revision: 6693
> >
> > Added:
> >    plugins/branches/lifetype-1.2/addthis/
> >    plugins/branches/lifetype-1.2/addthis/README.txt
> >    plugins/branches/lifetype-1.2/addthis/class/
> >    plugins/branches/lifetype-1.2/addthis/class/action/
> >
>  plugins/branches/lifetype-1.2/addthis/class/action/pluginaddthisconfigaction.class.php
> >
>  plugins/branches/lifetype-1.2/addthis/class/action/pluginaddthisupdateconfigaction.class.php
> >    plugins/branches/lifetype-1.2/addthis/class/view/
> >
>  plugins/branches/lifetype-1.2/addthis/class/view/pluginaddthisconfigview.class.php
> >    plugins/branches/lifetype-1.2/addthis/locale/
> >    plugins/branches/lifetype-1.2/addthis/locale/locale_en_UK.php
> >    plugins/branches/lifetype-1.2/addthis/pluginaddthis.class.php
> >    plugins/branches/lifetype-1.2/addthis/templates/
> >    plugins/branches/lifetype-1.2/addthis/templates/addthis.template
> > Log:
> > Initial checkin of the AddThis plugin.
> >
> > Check out AddThis at http://www.addthis.com
> >
> >
> >
> > Added: plugins/branches/lifetype-1.2/addthis/README.txt
> > ===================================================================
> > --- plugins/branches/lifetype-1.2/addthis/README.txt
>      (rev 0)
> > +++ plugins/branches/lifetype-1.2/addthis/README.txt  2008-07-12 10:46:31
> UTC (rev 6693)
> > @@ -0,0 +1,44 @@
> > +[DESCRIPTION]
> > +The AddThis 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/addthis
> > +2. Next you need to add the following to post.template:
> > +    {assign var="addThisPostId" value=$post->getId()}
> > +    {$addthis->show($addThisPostId)}
> > +
> > +
> > +[EXAMPLE (From the template 'Falling Leaves with plug-ins]
> > +{assign var="postDate" value=$post->getDateObject()}
> > +{assign var="postOwner" value=$post->getUserInfo()}
> > +{assign var="addthisPostId" value=$post->getId()}
> > +
> > +   <DIV class=post>
> > +      <H2 class=storytitle ><A class=aposted
> > +      href="{$url->postPermalink($post)}">{$post->getTopic()}</A></H2>
> > +      <DIV class=date>Published on
> > +      {$locale->formatDate($postDate,"%H:%M, %m/%d,%Y")}</DIV>
> > +      <DIV class=storycontent>
> > +      <P>{$post->getText()}</P>
> > +   </DIV><BR>
> > +   <DIV class=feedback>
> > +      <DIV class=meta>Posted under
> > +         {foreach name=categories from=$post->getCategories()
> > +      item=postcategory}
> > +            <a
> > +
>  href="{$url->categoryLink($postcategory)}">{$postcategory->getName()}</a>
> > +         {if !$smarty.foreach.categories.last}, {/if}
> > +         {/foreach}
> > +
> > +            | <A
> > +
>  href="{$url->postPermalink($post)}#comments">{$locale->tr("comment
> > +            on this")} ({$post->getTotalComments()})</A>
> > +            {$addthis->show($addthisPostId)}
> > +      </DIV>
> > +   </DIV>
> > +   <DIV class=sep></DIV>
> > +   </DIV>
> > +
> > +[END EXAMPLE]
> >
> > Added:
> plugins/branches/lifetype-1.2/addthis/class/action/pluginaddthisconfigaction.class.php
> > ===================================================================
> > ---
> plugins/branches/lifetype-1.2/addthis/class/action/pluginaddthisconfigaction.class.php
>                            (rev 0)
> > +++
> plugins/branches/lifetype-1.2/addthis/class/action/pluginaddthisconfigaction.class.php
>    2008-07-12 10:46:31 UTC (rev 6693)
> > @@ -0,0 +1,47 @@
> > +<?php
> > +
> > +    /*
> > +    Copyright 2006, 2008 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
> > +    */
> > +
> > +
> > +     lt_include(
> PLOG_CLASS_PATH."class/action/admin/adminaction.class.php" );
> > +     lt_include(
> PLOG_CLASS_PATH."plugins/addthis/class/view/pluginaddthisconfigview.class.php"
> );
> > +
> > +     /**
> > +      * shows a form with the current configuration
> > +      */
> > +     class PluginAddThisConfigAction extends AdminAction
> > +     {
> > +
> > +             function PluginAddThisConfigAction( $actionInfo, $request )
> > +             {
> > +                     $this->AdminAction( $actionInfo, $request );
> > +                     error_log("PluginAddThisConfigAction");
> > +             }
> > +
> > +             function perform()
> > +             {
> > +                     error_log("PluginAddThisConfigAction::perform");
> > +                     $this->_view = new PluginAddThisConfigView(
> $this->_blogInfo );
> > +
> > +                     $this->setCommonData();
> > +
> > +                     return true;
> > +             }
> > +     }
> > +?>
> >
> > Added:
> plugins/branches/lifetype-1.2/addthis/class/action/pluginaddthisupdateconfigaction.class.php
> > ===================================================================
> > ---
> plugins/branches/lifetype-1.2/addthis/class/action/pluginaddthisupdateconfigaction.class.php
>                              (rev 0)
> > +++
> plugins/branches/lifetype-1.2/addthis/class/action/pluginaddthisupdateconfigaction.class.php
>      2008-07-12 10:46:31 UTC (rev 6693)
> > @@ -0,0 +1,92 @@
> > +<?php
> > +
> > +    /*
> > +    Copyright 2006, 2008 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
> > +    */
> > +
> > +     lt_include(
> PLOG_CLASS_PATH."class/action/admin/adminaction.class.php" );
> > +     lt_include(
> PLOG_CLASS_PATH."plugins/addthis/class/view/pluginaddthisconfigview.class.php"
> );
> > +
> > +     /**
> > +      * updates the plugin configuration
> > +      */
> > +     class PluginAddThisUpdateConfigAction extends AdminAction
> > +     {
> > +             var $_pluginEnabled;
> > +             var $_username;
> > +
> > +             function PluginAddThisUpdateConfigAction( $actionInfo,
> $request )
> > +             {
> > +                     $this->AdminAction( $actionInfo, $request );
> > +             }
> > +
> > +             function validate()
> > +             {
> > +
> > +                     $this->_pluginEnabled = $this->_request->getValue(
> "pluginEnabled" );
> > +                     $this->_pluginEnabled = ($this->_pluginEnabled !=
> "" );
> > +
> > +                     $this->_username = $this->_request->getValue(
> "username" );
> > +
> > +
> > +                     if( $this->_pluginEnabled == true &&
> $this->_username == "" ) {
> > +                         $this->_view = new PluginAddThisConfigView(
> $this->_blogInfo );
> > +                         $this->_view->setErrorMessage(
> $this->_locale->tr("addthis_missing_username"));
> > +                         $this->setCommonData();
> > +
> > +                         return false;
> > +                     }
> > +
> > +                     return true;
> > +             }
> > +
> > +             function perform()
> > +             {
> > +                     // update the plugin configurations to blog setting
> > +                     $blogSettings = $this->_blogInfo->getSettings();
> > +                     $blogSettings->setValue( "plugin_addthis_enabled",
> $this->_pluginEnabled );
> > +
> > +                     $blogSettings->setValue( "plugin_addthis_username",
> $this->_username );
> > +                     $this->_blogInfo->setSettings( $blogSettings );
> > +
> > +
> > +                     // save the blogs settings
> > +                     $blogs = new Blogs();
> > +                     if( !$blogs->updateBlog( $this->_blogInfo )) {
> > +                         $this->_view = new PluginAddThisConfigView(
> $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 PluginAddThisConfigView(
> $this->_blogInfo );
> > +                     $this->_view->setSuccessMessage(
> $this->_locale->tr("addthis_settings_saved_ok"));
> > +                     $this->setCommonData();
> > +
> > +                     // clear the cache
> > +                     CacheControl::resetBlogCache(
> $this->_blogInfo->getId());
> > +
> > +                     return true;
> > +             }
> > +     }
> > +?>
> >
> > Added:
> plugins/branches/lifetype-1.2/addthis/class/view/pluginaddthisconfigview.class.php
> > ===================================================================
> > ---
> plugins/branches/lifetype-1.2/addthis/class/view/pluginaddthisconfigview.class.php
>                                (rev 0)
> > +++
> plugins/branches/lifetype-1.2/addthis/class/view/pluginaddthisconfigview.class.php
>        2008-07-12 10:46:31 UTC (rev 6693)
> > @@ -0,0 +1,49 @@
> > +<?php
> > +    /*
> > +    Copyright 2006, 2008 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
> > +    */
> > +
> > +
> > +     lt_include(
> PLOG_CLASS_PATH."class/view/admin/adminplugintemplatedview.class.php" );
> > +
> > +     /**
> > +      * implements the main view of the feed reader plugin
> > +      */
> > +     class PluginAddThisConfigView extends AdminPluginTemplatedView
> > +     {
> > +
> > +
> > +             function PluginAddThisConfigView( $blogInfo )
> > +             {
> > +                     $this->AdminPluginTemplatedView( $blogInfo,
> "addthis", "addthis" );
> > +
> > +             }
> > +
> > +             function render()
> > +             {
> > +                     // load some configuration settings
> > +                     $blogSettings = $this->_blogInfo->getSettings();
> > +                     $pluginEnabled = $blogSettings->getValue(
> "plugin_addthis_enabled" );
> > +
> > +                     $username = $blogSettings->getValue(
> "plugin_addthis_username" );
> > +                     // create a view and export the settings to the
> template
> > +                     $this->setValue( "pluginEnabled", $pluginEnabled );
> > +                     $this->setValue( "username", $username );
> > +                     parent::render();
> > +             }
> > +     }
> > +?>
> >
> > Added: plugins/branches/lifetype-1.2/addthis/locale/locale_en_UK.php
> > ===================================================================
> > --- plugins/branches/lifetype-1.2/addthis/locale/locale_en_UK.php
>                     (rev 0)
> > +++ plugins/branches/lifetype-1.2/addthis/locale/locale_en_UK.php
> 2008-07-12 10:46:31 UTC (rev 6693)
> > @@ -0,0 +1,17 @@
> > +<?php
> > +$messages["manageAppearancePlugins"] = "Appearance Management";
> > +$messages["addthis"] = "AddThis";
> > +
> > +$messages["addthis_plugin_enabled"] = "Enable this plugin";
> > +$messages["addthis_username"] = "Username for account on AddThis.  To
> obtain account go to <a href=\"http://www.addthis.com/\<http://www.addthis.com/%5C>
> ">http://www.addthis.com/</a>";
> > +$messages["addthis_plugin"] = "AddThis Plugin";
> > +$messages["detail"] = "Detail";
> > +
> > +$messages["addthis_settings_saved_ok"] = "AddThis settings saved
> successfully!";
> > +$messages["addthis_missing_username"] = "AddThis username needs to be
> specified!";
> > +
> > +
> > +$messages["label_configuration"] = "Configuration";
> > +$messages["label_addthis_username"] = "AddThis username";
> > +$messages["label_enable"] = "Enable";
> > +?>
> >
> > Added: plugins/branches/lifetype-1.2/addthis/pluginaddthis.class.php
> > ===================================================================
> > --- plugins/branches/lifetype-1.2/addthis/pluginaddthis.class.php
>                     (rev 0)
> > +++ plugins/branches/lifetype-1.2/addthis/pluginaddthis.class.php
> 2008-07-12 10:46:31 UTC (rev 6693)
> > @@ -0,0 +1,107 @@
> > +<?php
> > +    /*
> > +    Copyright 2006, 2008 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
> > +    */
> > +
> > +
> > +
> > +     lt_include( PLOG_CLASS_PATH."class/plugin/pluginbase.class.php" );
> > +     lt_include( PLOG_CLASS_PATH."class/plugin/pluginmanager.class.php"
> );
> > +
> > +
> > +     class PluginAddThis extends PluginBase
> > +     {
> > +             var $pluginEnabled;
> > +             var $addThisUsername;
> > +
> > +             function PluginAddThis( $source = "" )
> > +             {
> > +                     $this->PluginBase($source);
> > +
> > +                     $this->id      = "addthis";
> > +                     $this->author  = "Paul Westbrook";
> > +                     $this->desc    = "The AddThis plugin creates an
> AddThis button for each post.  This allows your users to bookmark or share
> your articles";
> > +                     $this->version = "20080712";
> > +
> > +                     $this->locales = Array( "en_UK");
> > +
> > +                     if( $source == "admin" )
> > +                             $this->initAdmin();
> > +             }
> > +
> > +             function initAdmin()
> > +             {
> > +                     $this->registerAdminAction( "addthisConfig",
> "PluginAddThisConfigAction" );
> > +                     $this->registerAdminAction( "updateAddThisConfig",
> "PluginAddThisUpdateConfigAction" );
> > +
> > +                     $menu =& Menu::getMenu();
> > +                     if( !$menu->entryExists(
> "/menu/controlCenter/manageAppearancePlugins" ))
> > +                             $this->addMenuEntry( "/menu/controlCenter",
> "manageAppearancePlugins", "", "", true, false );
> > +
> > +                     $this->addMenuEntry(
> "/menu/controlCenter/manageAppearancePlugins", "addthis",
> "?op=addthisConfig", "" );
> > +             }
> > +
> > +             function register()
> > +             {
> > +                 $blogSettings = $this->blogInfo->getSettings();
> > +                 $this->pluginEnabled = $blogSettings->getValue(
> "plugin_addthis_enabled" );
> > +                 $this->addThisUsername = $blogSettings->getValue(
> "plugin_addthis_username" );
> > +             }
> > +
> > +         function isEnabled()
> > +         {
> > +             return $this->pluginEnabled;
> > +         }
> > +
> > +
> > +         function show($postId)
> > +         {
> > +             $str = '';
> > +
> > +             if ($this->isEnabled())
> > +             {
> > +
> > +                 // articles object
> > +                    $articles = new Articles;
> > +
> > +
> > +                 $rg = $this->blogInfo->getBlogRequestGenerator();
> > +                 $rg->setXHTML( false );
> > +                 $post = $articles->getBlogArticle($postId);
> > +                 $blogSettings = $this->blogInfo->getSettings();
> > +                 $locale =& $this->blogInfo->getLocale();
> > +
> > +                    $blogname = $this->blogInfo->getBlog();
> > +                    $permalink = $rg->postPermalink($post);
> > +                    $title = $post->getTopic();
> > +
> > +
> > +                    $str .= '<!-- ADDTHIS BUTTON BEGIN -->';
> > +                 $str .= '<script type="text/javascript">';
> > +                 $str .= 'addthis_pub             = "' .
> $this->addThisUsername . '";';
> > +                 $str .= 'addthis_brand           = "' . $blogname .
> '";';
> > +                 $str .= '</script>';
> > +                 $str .= '<a href="http://www.addthis.com/bookmark.php"
> onmouseover="return addthis_open(this, \'\', \'' . $permalink . '\', \'' .
> $title . '\')" onmouseout="addthis_close()" onclick="return
> addthis_sendto()"><img src="http://s9.addthis.com/button1-share.gif"
> width="125" height="16" border="0" alt="" /></a>';
> > +                 $str .= '<script type="text/javascript" src="
> http://s7.addthis.com/js/152/addthis_widget.js"></script>';
> > +                 $str .= '<!-- ADDTHIS BUTTON END -->';
> > +
> > +             }
> > +             return $str;
> > +        }
> > +
> > +     }
> > +?>
> >
> > Added: plugins/branches/lifetype-1.2/addthis/templates/addthis.template
> > ===================================================================
> > --- plugins/branches/lifetype-1.2/addthis/templates/addthis.template
>                      (rev 0)
> > +++ plugins/branches/lifetype-1.2/addthis/templates/addthis.template
>  2008-07-12 10:46:31 UTC (rev 6693)
> > @@ -0,0 +1,32 @@
> > +{include file="$admintemplatepath/header.template"}
> > +{include file="$admintemplatepath/navigation.template" showOpt=addthis
> title=$locale->tr("addthis_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("addthis_plugin_enabled")}
> > +   </div>
> > +  </div>
> > +
> > +  <div class="field">
> > +   <label for="username">{$locale->tr("label_addthis_username")}</label>
> > +   <span class="required">*</span>
> > +   <div class="formHelp">{$locale->tr("addthis_username")}
> > +     <input class="text" type="text" name="username" id="username"
> value="{$username}" width="10" />
> > +   </div>
> > +  </div>
> > +
> > + </fieldset>
> > +
> > + <div class="buttons">
> > +  <input type="hidden" name="op" value="updateAddThisConfig" />
> > +  <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"}
> >
> > _______________________________________________
> > pLog-svn mailing list
> > pLog-svn at devel.lifetype.net
> > http://limedaley.com/mailman/listinfo/plog-svn
>
> _______________________________________________
> pLog-svn mailing list
> pLog-svn at devel.lifetype.net
> http://limedaley.com/mailman/listinfo/plog-svn
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://limedaley.com/pipermail/plog-svn/attachments/20080712/912b4c79/attachment-0001.htm>


More information about the pLog-svn mailing list