Sociable plugin for LifeType 1.1 error

Sociable plugin for LifeType 1.1 error

Postby mivaho on Thu Sep 07, 2006 4:37 pm

Hi,

First thnx for bringing us 1.1. Just at the time I got our summary template ready for the last beta. :)

Tried to install the sociable plugin in the beta but it didn't work.

Now with the 1.1 release I downloaded the 1.1 plugin pack and there is a 1.1 sociable plugin. Uploaded it to the site but when I go to the plugins in the admin ares I get:

Fatal error: Undefined class name 'menu' in PATH_TO_ROOT_DIR/plugins/sociable/pluginsociable.class.php on line 54


Same error I got with the Beta. Am I missing someting.

I'm running with custom urls, don't know if it is relevant bur thought I'd mention it. :)

Kind regards,
Michel
mivaho
 
Posts: 32
Joined: Tue Jun 06, 2006 4:57 am

Postby phunkphorce on Fri Sep 08, 2006 1:37 am

This is not an issue with the 1.1 release but an issue with the plugin. While we update the zip file in sourceforge.net, please edit the file pluginsociable.class.php and add the following line at the top:

Code: Select all
include_once( PLOG_CLASS_PATH."class/template/menu/menu.class.php" );
phunkphorce
Lifetype Expert
 
Posts: 9028
Joined: Mon Aug 25, 2003 6:34 am
Location: Suomessa

Postby mivaho on Fri Sep 08, 2006 4:03 am

Thnx,

Willl do, I 'm putting the final things in place before we go live with the blog.

Cheers,
Michel
mivaho
 
Posts: 32
Joined: Tue Jun 06, 2006 4:57 am

Postby Nomad on Sun Sep 10, 2006 12:37 pm

hmm - I'm having a problem with this same plugin

I followed the readme file directions (bit confusing so they are)

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
Code: Select all
 {$sociable->showCSS()}


3. Add the following to post.template:
Code: Select all
 $sociable->show($postId)



[EXAMPLE]:
Add the following code in post.template :
Code: Select all
Code:
{assign var="postId" value=$post->getId()}
{$sociable->show($)}




ok I added the head stuff to show the sociable css
Next edited the example code as using the first code example i.e.
Code: Select all
 {$sociable->show($)}
I got a smarty error. I then edited that out and used the complete example shown under [EXAMPLE] but with the other piece of code
Code: Select all
 $sociable->show($postId)
and that displays this with in the template which I assume is wrong. The plug-in has been enabled.

you can see the result at my demo blog here
http://www.blogireland.ie/128/128/page/2

Any ideas please?

I've also gone through all the plug ins and the readme texts as far as I can see just don't have enough info in most cases and some don't even have a readme.txt

It would be handy if the guy's who are writing the plug ins would realise that not everyone is fully competant with php or html for that matter and some really do need to be led by the hand so to speak.
I'm competant enough on most stuff and can battle through to get what I need but a lot of folk aren't that clever.

It's the one area where I feel lifetype is letting itself down a bit with an otherwise excellent product. Please then guy's when you do write plug-ins make your readme.txts clear and easy to follow ...

now, of to the wiki for me to figure out how this bugger works...

edit: Nothing in the wiki on it :(
Blog Ireland - now with video posting
Normally most write something meaningful here so many to choose from yet most oft ignored.
Nomad
Lifetype Expert
 
Posts: 645
Joined: Sat Feb 05, 2005 8:40 pm
Location: Eire

Postby mivaho on Sun Sep 10, 2006 1:53 pm

Hi Nomad,

I had the same problem took me some puzzling but I found the solution.

Header template is correct don't change that.

The other code should be:

Code: Select all
{assign var="postId" value=$post->getId()}
{$sociable->show($postId)}


The first line I've put in the top part and that looks like this:

Code: Select all
{assign var="postDate" value=$post->getDateObject()}
{assign var="postOwner" value=$post->getUserInfo()}
{assign var="postId" value=$post->getId()}


And the second part "{$sociable->show($postId)}" I put just after the final <a href>. My post.template looks like this:

Code: Select all
{assign var="postDate" value=$post->getDateObject()}
{assign var="postOwner" value=$post->getUserInfo()}
{assign var="postId" value=$post->getId()}
<div class="blogbody">

<div class="post_outline">
<div class="post_title"><a href="{$url->postPermalink($post)}">{$post->getTopic()}</a></div>
<div class="post_content_space">
<div class="posted">
   {$postOwner->getUsername()} | {$locale->formatDate($postDate,"%d %b, %Y")}, {$locale->formatDate($postDate,"%H:%M")} |
   {foreach name=categories from=$post->getCategories() item=postCategory}
      <a href="{$url->categoryLink($postCategory)}">{$postCategory->getName()}</a>{if !$smarty.foreach.categories.last}, {/if}
   {/foreach} | ({$post->getNumReads()} Reads)
</div>
<div class="post_content">
 {$post->getText()}
</div>
<blockquote class="mt">Trackback URL: {$url->getTrackbackUrl()}?id={$post->getId()}</blockquote>
<div class="posted">
   <a href="{$url->postPermalink($post)}">{$locale->tr("permalink")}</a> | <a href="{$url->postPermalink($post)}">{$locale->tr("comments")}({$post->getTotalComments()})</a> |
    <a href="{$url->postTrackbackStatsLink($post)}">{$locale->tr("trackbacks")}({$post->getNumTrackbacks()})</a>
<div class="post_sociable">
{$sociable->show($postId)}
</div>
</div>
</div>
<div class="post_bottom"></div>
</div>
</div>
<br/>


Don't mind my extra div classes I use those for formatting.

Hope this helps you.

The only problem I have now is that it takes 2 updates in the backend fot the icons to show. :)

Greets,
Michel
mivaho
 
Posts: 32
Joined: Tue Jun 06, 2006 4:57 am

Postby jondaley on Sun Sep 10, 2006 7:28 pm

If you have updated readme.txt, I can upload it.

Yes, the plugin authors should be more careful, but it is hard sometimes to write all the documentation in ways that other people can understand.

Sometimes the wiki has more instructions than just the readme, though I think usually it is a copy.
jondaley
Lifetype Expert
 
Posts: 6169
Joined: Thu May 20, 2004 6:19 pm
Location: Pittsburgh, PA, USA
LifeType Version: 1.2.11 devel branch

Postby Nomad on Mon Sep 11, 2006 6:21 am

thnx mihavo :)

ok jondaley - the reademe file should be something like this say,



[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
Code: Select all
   {$sociable->showCSS()}


3. Next you need to add the following to post.template:
Code: Select all
    {assign var="postId" value=$post->getId()}
    {$sociable->show($postId)}


[EXAMPLE (From the template 'Falling Leaves with plug-ins]
Code: Select all
{assign var="postDate" value=$post->getDateObject()}
{assign var="postOwner" value=$post->getUserInfo()}
{assign var="postId" value=$post->getId()}<!-- here is the assign var part of the sociable code -->
 
   <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>
{$sociable->show($postId)}<!-- here is teh other piece of the sociable code -->
      </DIV>
   </DIV>
   <DIV class=sep></DIV>
   </DIV>

[END EXAMPLE]



(Obviously I've had to us ethe code tags here to disable the code but in the readme file these wouldn't be needed. couldn't find where to just upload a copy :( )

Don't mind going through them all and passing on teh updated files as and when I've done them or in one complete package maybe? I'll be using most of the plug-ins so it's not really any extar work for me.

next one is 'Submissions' - again the same problem the readme file isn't really clear enough....
Blog Ireland - now with video posting
Normally most write something meaningful here so many to choose from yet most oft ignored.
Nomad
Lifetype Expert
 
Posts: 645
Joined: Sat Feb 05, 2005 8:40 pm
Location: Eire

Postby jondaley on Mon Sep 11, 2006 8:41 am

uploaded to subversion rev 3955 - will be output to sourceforge at some point.
jondaley
Lifetype Expert
 
Posts: 6169
Joined: Thu May 20, 2004 6:19 pm
Location: Pittsburgh, PA, USA
LifeType Version: 1.2.11 devel branch

Postby Brumec on Fri Sep 15, 2006 1:38 pm

I use older version of pLog (lifetype), I believe it's 1.0.3, yet I've managed to install this (a bit buggy) plugin.
I do not use slug, which complicates thing when creating links to social bokkmarking sites.
For example:
I have a post here:
http://www.brumec.org/index.php?op=View ... 6&blogId=1

Now the generated link should be something like:
http://del.icio.us/post?url=http://www. ... Some+title

Insted, the & charachter is replaced by &amp;

I believe this part of plugin code generates the links:
Code: Select all
                    $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="/plugins/sociable/class/sociable/images/' . $site['favicon'] . '" alt="' . $sitename .'" />';
                    $str .= "</a></li>\n";

Can someone please tell me how to change the code, so that the plugin will generate the links the right way?
Thank you.
Brumec
 
Posts: 6
Joined: Fri Sep 15, 2006 1:31 pm

Postby phunkphorce on Fri Sep 15, 2006 2:51 pm

We've identified the problem and there is a fix already available.

I have not updated the .zip package in SF.net so please download the following file:

http://www.lifetype.net/svn/plog/plugin ... .class.php

Save is as pluginsociable.class.php, place it in plugins/sociable/ and please try again.
Last edited by phunkphorce on Sat Sep 16, 2006 11:09 am, edited 1 time in total.
phunkphorce
Lifetype Expert
 
Posts: 9028
Joined: Mon Aug 25, 2003 6:34 am
Location: Suomessa

Postby Brumec on Fri Sep 15, 2006 3:13 pm

Thank you, works like a charm.
Of course, you need to change the url to lifetype if you want to get the file.
A bit nostalgic, are we? :)
Brumec
 
Posts: 6
Joined: Fri Sep 15, 2006 1:31 pm

Postby phunkphorce on Sat Sep 16, 2006 11:10 am

Brumec wrote:Thank you, works like a charm.
Of course, you need to change the url to lifetype if you want to get the file.


Great, thanks for reporting and for confirming that it works!

A bit nostalgic, are we? :)


Nah :) The problem is that I still keep a static mapping to plogworld.net in my local /etc/hosts, so both domains still resolve to the same IP in my local machine... :)
phunkphorce
Lifetype Expert
 
Posts: 9028
Joined: Mon Aug 25, 2003 6:34 am
Location: Suomessa

Postby -J- on Thu Dec 14, 2006 6:19 pm

Hey, it looks like a great plugin!

is it working with lifetype 1.1.3?

(I've got this message:
syntax error: unrecognized tag: $sociable->show($) (Smarty_Compiler.class.php, line 439) in /home/expatbloe/www/class/template/smarty/Smarty.class.php on line 1095)
-J-
 
Posts: 116
Joined: Sun Apr 03, 2005 4:02 pm


Return to Plugin Development Team

cron