[pLog-svn] r3930 - in plog/trunk: class/gallery/dao templates/admin templates/standard

oscar at devel.lifetype.net oscar at devel.lifetype.net
Sun Sep 3 18:29:20 GMT 2006


Author: oscar
Date: 2006-09-03 18:29:19 +0000 (Sun, 03 Sep 2006)
New Revision: 3930

Modified:
   plog/trunk/class/gallery/dao/galleryresource.class.php
   plog/trunk/templates/admin/usersettings.template
   plog/trunk/templates/standard/footer.template
Log:
this should fix issue 1016 (http://bugs.lifetype.net/view.php?id=1016) -- user picture not being displayed properly in all blogs owned by the user. This fix required a few new methods in GalleryResource so that we can get the link to the resource independently from the $url object available in the current template context. I'll commit fixes to all the templates that use this feature shortly.


Modified: plog/trunk/class/gallery/dao/galleryresource.class.php
===================================================================
--- plog/trunk/class/gallery/dao/galleryresource.class.php	2006-09-03 17:17:10 UTC (rev 3929)
+++ plog/trunk/class/gallery/dao/galleryresource.class.php	2006-09-03 18:29:19 UTC (rev 3930)
@@ -565,5 +565,56 @@
         {
         	return( $this->_resourceType == GALLERY_RESOURCE_ZIP );
         }
+
+		/**
+		 * returns the link to the resource page
+		 */
+		function getResourceLink()
+		{
+			$blog = $this->getBlogInfo();
+			$url = $blog->getBlogRequestGenerator();
+			return( $url->resourceLink( $this ));			
+		}
+
+		/**
+		 * returns the download link for this resource
+		 */
+		function getLink()
+		{
+			$blog = $this->getBlogInfo();
+			$url = $blog->getBlogRequestGenerator();
+			return( $url->resourceDownloadLink( $this ));
+		}
+		
+		/**
+		 * returns the preview link (thumbnail) for this resource if it's an image, or an empty string otherwise
+		 */
+		function getPreviewLink()
+		{
+			$link = "";
+			if( $this->isImage()) {			
+				$blog = $this->getBlogInfo();
+				$url = $blog->getBlogRequestGenerator();
+				$link = $url->resourcePreviewLink( $this );
+			}
+			
+			return( $link );
+		}
+		
+		/**
+		 * returns the medium preview link (thumbnail) for this resource if it's an image, 
+		 * or an empty string otherwise
+		 */
+		function getMediumPreviewLink()
+		{
+			$link = "";
+			if( $this->isImage()) {			
+				$blog = $this->getBlogInfo();
+				$url = $blog->getBlogRequestGenerator();
+				$link = $url->resourceMediumSizePreviewLink( $this );
+			}
+			
+			return( $link );			
+		}		
     }
-?>
+?>
\ No newline at end of file

Modified: plog/trunk/templates/admin/usersettings.template
===================================================================
--- plog/trunk/templates/admin/usersettings.template	2006-09-03 17:17:10 UTC (rev 3929)
+++ plog/trunk/templates/admin/usersettings.template	2006-09-03 18:29:19 UTC (rev 3930)
@@ -52,7 +52,7 @@
        {if $user->hasPicture()} 
 	     {assign var=userPicture value=$user->getPicture()}
 	     {assign var=imgInfo value=$userPicture->getMetadataReader()}
-	     <img alt="Picture" src="{$url->resourcePreviewLink($userPicture)}" id="userPicture"  style="display:block;margin-left:auto;margin-right:auto" />
+	     <img alt="Picture" src="{$userPicture->getPreviewLink()}" id="userPicture"  style="display:block;margin-left:auto;margin-right:auto" />
        {else}
 	     <img alt="Picture" src="imgs/no-user-picture.jpg" id="userPicture" style="display:block;margin-left:auto;margin-right:auto"/>	
        {/if}

Modified: plog/trunk/templates/standard/footer.template
===================================================================
--- plog/trunk/templates/standard/footer.template	2006-09-03 17:17:10 UTC (rev 3929)
+++ plog/trunk/templates/standard/footer.template	2006-09-03 18:29:19 UTC (rev 3930)
@@ -11,7 +11,7 @@
   	<h2>{$locale->tr("about_myself")}</h2>
   	<div id="AboutMyself">
   	{assign var=picture value=$blogOwner->getPicture()}
-  	<img id="UserPicture" src="{$url->resourcePreviewLink($picture)}" alt="{$blogOwner->getUsername()}" />
+  	<img id="UserPicture" src="{$picture->getPreviewLink()}" alt="{$blogOwner->getUsername()}" />
   	<p>{$AboutMyself}</p>
   	<div class="clearer">&nbsp;</div>
   	</div>



More information about the pLog-svn mailing list