[pLog-svn] r5256 - plog/branches/lifetype-1.2/class/gallery/dao
Mark Wu
markplace at gmail.com
Mon Apr 2 14:03:54 EDT 2007
Mmm.... We should provide two counter update scripts for users.
1. Resources counter for each album (If it is wrong, it will cause user
can't delete the album even album is empty)
2. Articles counter for each blog (harmless, but annoying)
If no one take this, I will do this.
Mark
> -----Original Message-----
> From: plog-svn-bounces at devel.lifetype.net
> [mailto:plog-svn-bounces at devel.lifetype.net] On Behalf Of
> mark at devel.lifetype.net
> Sent: Tuesday, April 03, 2007 2:01 AM
> To: plog-svn at devel.lifetype.net
> Subject: [pLog-svn] r5256 -
> plog/branches/lifetype-1.2/class/gallery/dao
>
> Author: mark
> Date: 2007-04-02 14:01:03 -0400 (Mon, 02 Apr 2007) New Revision: 5256
>
> Modified:
>
> plog/branches/lifetype-1.2/class/gallery/dao/galleryresources.
> class.php
> Log:
> We shouldn't update the counter If upload failed. Move those
> update counter code to the right place.
>
> Modified:
> plog/branches/lifetype-1.2/class/gallery/dao/galleryresources.
> class.php
> ===================================================================
> ---
> plog/branches/lifetype-1.2/class/gallery/dao/galleryresources.
> class.php 2007-04-02 09:55:16 UTC (rev 5255)
> +++
> plog/branches/lifetype-1.2/class/gallery/dao/galleryresources.
> class.php 2007-04-02 18:01:03 UTC (rev 5256)
> @@ -347,12 +347,6 @@
> $this->Execute( $query );
> }
>
> - lt_include(
> PLOG_CLASS_PATH."class/gallery/dao/galleryalbums.class.php"
> );
> - $albums = new GalleryAlbums();
> - $album = $albums->getAlbum( $albumId );
> - $album->setNumResources(
> $album->getNumResources() + 1 );
> - $albums->updateAlbum( $album );
> -
> // clear our own caches
> $this->_cache->removeData( $resourceId,
> CACHE_RESOURCES );
> $this->_cache->removeData( $ownerId,
> CACHE_RESOURCES_USER ); @@ -476,6 +470,12 @@
> $this->Execute( $query );
> return $resFile;
> }
> +
> + lt_include(
> PLOG_CLASS_PATH."class/gallery/dao/galleryalbums.class.php"
> );
> + $albums = new GalleryAlbums();
> + $album = $albums->getAlbum( $albumId );
> + $album->setNumResources(
> $album->getNumResources() + 1 );
> + $albums->updateAlbum( $album );
>
> // and finally, we can generate the thumbnail
> only if the file is an image, of course :)
> if( $resourceType == GALLERY_RESOURCE_IMAGE ) {
>
> _______________________________________________
> pLog-svn mailing list
> pLog-svn at devel.lifetype.net
> http://limedaley.com/mailman/listinfo/plog-svn
>
More information about the pLog-svn
mailing list