[pLog-svn] r2796 - plog/trunk/class/template/templatesets

Mark Wu markplace at gmail.com
Mon Jan 16 11:05:28 GMT 2006


Hi Oscar:

Need your help on this, I already fix this function, but I have no idea
about the cache....

It seems I only deal with the data in cache on in real db. Weird.

You can follow the steps to reporuce the problem:

1. Add a template through addBlogTemplate (for example fdwan.zip) 
2. Delete the fdwan template through deleteBlogTemplate
3. Okay, now goto BlogSettings, and update the settings.
4. You will see the fdwan apper again ...  

Mark

BTW, when will you available, I think we really need you give us a little
online section about new cache and dao .. :D

> -----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: Monday, January 16, 2006 6:50 PM
> To: plog-svn at devel.lifetype.net
> Subject: [pLog-svn] r2796 - plog/trunk/class/template/templatesets
> 
> Author: mark
> Date: 2006-01-16 10:50:13 +0000 (Mon, 16 Jan 2006) New Revision: 2796
> 
> Modified:
>    plog/trunk/class/template/templatesets/templatesets.class.php
>    plog/trunk/class/template/templatesets/templatesetstorage.class.php
> Log:
> The addBlogTemplate/deletBlogTemplte should work again. But I 
> have no idea how to solve the cache issue. Please follow the 
> steps to reproduce my problem:
> 
> 1. Add a template through addBlogTemplate (for example 
> fdwan.zip) 2. Delete the fdwan template through 
> deleteBlogTemplate 3. Okay, now goto BlogSettings, and update 
> the settings.
> 4. You will see the fdwan apper again ... 
> 
> Weird, it seems I only add it or remove it from cache, not 
> real DB update ...
> 
> Modified: 
> plog/trunk/class/template/templatesets/templatesets.class.php
> ===================================================================
> --- 
> plog/trunk/class/template/templatesets/templatesets.class.php	
> 2006-01-16 08:10:06 UTC (rev 2795)
> +++ 
> plog/trunk/class/template/templatesets/templatesets.class.php	
> 2006-01-16 10:50:13 UTC (rev 2796)
> @@ -184,7 +184,8 @@
>          function isBlogTemplate( $templateName, $blogId )
>          {
>          	$blogs = new Blogs();
> -            $blogSettings = $blogs->getBlogSettings( $blogId );
> +        	$blog = $blogs->getBlogInfo( $blogId );
> +            $blogSettings = $blog->getSettings( $blogId );
>  
>              // get the array with the template names stored 
> in the settings
>              $blogTemplates = $blogSettings->getValue( 
> "blog_templates" );
> 
> Modified: 
> plog/trunk/class/template/templatesets/templatesetstorage.class.php
> ===================================================================
> --- 
> plog/trunk/class/template/templatesets/templatesetstorage.cl
> ass.php	2006-01-16 08:10:06 UTC (rev 2795)
> +++ 
> plog/trunk/class/template/templatesets/templatesetstorage.cl
> ass.php	2006-01-16 10:50:13 UTC (rev 2796)
> @@ -158,13 +158,12 @@
>           */
>          function removeBlogTemplate( $templateName, $blogId )
>          {
> -            die("removeBlogTemplate: FIXME!!!");
> -        
>          	$config =& Config::getConfig();
>  
>              // get the settings of this blog
> -            $blogs = new Blogs();
> -            $blogSettings = $blogs->getBlogSettings( $blogId );
> +        	$blogs = new Blogs();
> +            $blog = $blogs->getBlogInfo( $blogId );
> +            $blogSettings = $blog->getSettings();
>  
>              // looks like the blog doesn't exist, so let's 
> not bother...
>              if( $blogSettings == false || $blogSettings == 
> "" ) @@ -186,7 +185,8 @@
>  
>              // finally, save the settings
>              $blogSettings->setValue( "blog_templates", 
> $newTemplateList );
> -            $blogs->updateBlogSettings( $blogId, $blogSettings );
> +            $blog->setSettings( $blogSettings );
> +            $blogs->updateBlog( $blog );            
>  
>              return true;
>          }
> @@ -281,11 +281,9 @@
>           */
>          function addLocalTemplate( $templateName, $blogId )
>          {
> -            die("addLocaleTemplatemplate: FIXME!!!");
> -        
>          	$blogs = new Blogs();
>              $blog = $blogs->getBlogInfo( $blogId );
> -            $blogSettings = $blog->getBlogSettings();
> +            $blogSettings = $blog->getSettings();
>              if( $blogSettings == "" || $blogSettings == false )
>              	return false;
>  
> @@ -301,7 +299,8 @@
>  
>              array_push( $blogTemplates, $templateName );
>              $blogSettings->setValue( "blog_templates", 
> $blogTemplates );
> -            $blogs->updateBlogSettings( $blogId, $blogSettings );
> +            $blog->setSettings( $blogSettings );
> +            $blogs->updateBlog( $blog );
>  
>              return true;
>          }
> 
> _______________________________________________
> 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