[pLog-svn] r6704 - plugins/branches/lifetype-1.2/addthis

pwestbro at devel.lifetype.net pwestbro at devel.lifetype.net
Thu Jul 17 20:31:17 EDT 2008


Author: pwestbro
Date: 2008-07-17 20:31:17 -0400 (Thu, 17 Jul 2008)
New Revision: 6704

Modified:
   plugins/branches/lifetype-1.2/addthis/pluginaddthis.class.php
Log:
Fixed problem with viewing previews of posts before submitting


Modified: plugins/branches/lifetype-1.2/addthis/pluginaddthis.class.php
===================================================================
--- plugins/branches/lifetype-1.2/addthis/pluginaddthis.class.php	2008-07-17 12:53:26 UTC (rev 6703)
+++ plugins/branches/lifetype-1.2/addthis/pluginaddthis.class.php	2008-07-18 00:31:17 UTC (rev 6704)
@@ -35,7 +35,7 @@
 			$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 = "20080715";
+			$this->version = "20080717";
 
 			$this->locales = Array( "en_UK");
 
@@ -82,23 +82,27 @@
 		    $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();
+		    if ($post) 
+		    {
+			$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 -->';
 
+                    	$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;
 	   }



More information about the pLog-svn mailing list