[pLog-svn] r4570 - plog/branches/lifetype-1.1.5/class/dao

Oscar Renalias oscar at renalias.net
Thu Jan 25 09:16:00 GMT 2007


That's right, we could use this field to re-display the date of the  
last update in the blog. It is now being updated every time an  
article is added or updated so it should be pretty valid.

Revision 4573 reimplements this but keep in mind two things:

- you also need revision 4570
- this value will not be valid right away, and in fact right now  
last_upate_date has the same value as create_date. It will only be  
updated as soon as users start working on their blogs.

Oscar

On 25 Jan 2007, at 10:23, BalearWeb wrote:

> Hello,
>
> Is this related to http://bugs.lifetype.net/view.php?id=1061 ?
> Is the 'last_update' field in the lt_blogs still keeping track of when
> was the last time the blog settings were updated, or now it reports  
> the
> date of the last article?
>
> Thank you
>
> Elena
>
> oscar at devel.lifetype.net wrote:
>> Author: oscar
>> Date: 2007-01-24 20:29:32 +0000 (Wed, 24 Jan 2007)
>> New Revision: 4570
>>
>> Modified:
>>    plog/branches/lifetype-1.1.5/class/dao/articles.class.php
>> Log:
>> Somehow we forgot to update the last_update_date fields in the  
>> lt_blogs table
>>
>> Modified: plog/branches/lifetype-1.1.5/class/dao/articles.class.php
>> ===================================================================
>> --- plog/branches/lifetype-1.1.5/class/dao/articles.class.php	 
>> 2007-01-24 17:25:17 UTC (rev 4569)
>> +++ plog/branches/lifetype-1.1.5/class/dao/articles.class.php	 
>> 2007-01-24 20:29:32 UTC (rev 4570)
>> @@ -811,9 +811,11 @@
>>                           // update the blog counters
>>              if( $newArticle->getStatus() ==  
>> POST_STATUS_PUBLISHED ) {
>> +				include_once( PLOG_CLASS_PATH."class/data/ 
>> timestamp.class.php" );	
>>  	            $blogs = new Blogs();
>>      	        $blogInfo = $newArticle->getBlogInfo();
>>          	    $blogInfo->setTotalPosts( $blogInfo->getTotalPosts()  
>> + 1 );
>> +				$blogInfo->setUpdateDate( Timestamp::getNowTimestamp());
>>              	$blogs->updateBlog( $blogInfo );
>>              }
>>  @@ -969,15 +971,19 @@
>>  			}
>>   			// update the blog counter
>> -			if( $oldArticle->getStatus() == POST_STATUS_PUBLISHED &&  
>> $article->getStatus() != POST_STATUS_PUBLISHED ) {            +			 
>> if( $oldArticle->getStatus() == POST_STATUS_PUBLISHED && $article- 
>> >getStatus() != POST_STATUS_PUBLISHED ) {
>> +				include_once( PLOG_CLASS_PATH."class/data/ 
>> timestamp.class.php" );				
>>  		    	$blogs = new Blogs();
>>  	    	    $blogInfo = $article->getBlogInfo();
>>  	        	$blogInfo->setTotalPosts( $blogInfo->getTotalPosts() -  
>> 1 );
>> +				$blogInfo->setUpdateDate( Timestamp::getNowTimestamp());
>>  	            $blogs->updateBlog( $blogInfo );
>>  	        } elseif ( $oldArticle->getStatus() !=  
>> POST_STATUS_PUBLISHED && $article->getStatus() ==  
>> POST_STATUS_PUBLISHED ) {
>> +				include_once( PLOG_CLASS_PATH."class/data/ 
>> timestamp.class.php" );		
>>  		    	$blogs = new Blogs();
>>  	    	    $blogInfo = $article->getBlogInfo();
>>  	        	$blogInfo->setTotalPosts( $blogInfo->getTotalPosts() +  
>> 1 );
>> +				$blogInfo->setUpdateDate( Timestamp::getNowTimestamp());	
>>  	            $blogs->updateBlog( $blogInfo );
>>  	    	}
>>
> _______________________________________________
> pLog-svn mailing list
> pLog-svn at devel.lifetype.net
> http://devel.lifetype.net/mailman/listinfo/plog-svn
>



More information about the pLog-svn mailing list