[pLog-svn] r3187 - plog/trunk/class/dao
mark at devel.lifetype.net
mark at devel.lifetype.net
Tue Apr 4 18:20:59 GMT 2006
Author: mark
Date: 2006-04-04 18:20:59 +0000 (Tue, 04 Apr 2006)
New Revision: 3187
Modified:
plog/trunk/class/dao/articles.class.php
plog/trunk/class/dao/bayesianfilterinfos.class.php
plog/trunk/class/dao/bayesiantokens.class.php
plog/trunk/class/dao/blogs.class.php
Log:
Now the deleteBlogs delete BayesianFilterInfos, BayesianTokens, ArticleNotification too.
So, I already delete everything related to specific blogId as I know. If you find anything I lost. Just add it.
Modified: plog/trunk/class/dao/articles.class.php
===================================================================
--- plog/trunk/class/dao/articles.class.php 2006-04-04 15:29:32 UTC (rev 3186)
+++ plog/trunk/class/dao/articles.class.php 2006-04-04 18:20:59 UTC (rev 3187)
@@ -1042,6 +1042,7 @@
include_once( PLOG_CLASS_PATH.'class/database/db.class.php' );
include_once( PLOG_CLASS_PATH.'class/dao/trackbacks.class.php' );
include_once( PLOG_CLASS_PATH.'class/dao/customfields/customfieldsvalues.class.php' );
+ include_once( PLOG_CLASS_PATH.'class/dao/articlenotifications.class.php' );
$article = $this->getBlogArticle( $artId, $blogId, true, -1, -1, $userId );
if( !$article )
@@ -1069,6 +1070,10 @@
// -- custom fields --
$customFields = new CustomFieldsValues();
$customFields->removeArticleCustomFields( $artId );
+
+ // -- article notifications --
+ $articleNotification = new ArticleNotifications();
+ $articleNotification->deleteNotification( $artId, $blogId, $userId );
// update global article categories
$this->updateGlobalArticleCategoriesLink( $article );
Modified: plog/trunk/class/dao/bayesianfilterinfos.class.php
===================================================================
--- plog/trunk/class/dao/bayesianfilterinfos.class.php 2006-04-04 15:29:32 UTC (rev 3186)
+++ plog/trunk/class/dao/bayesianfilterinfos.class.php 2006-04-04 18:20:59 UTC (rev 3187)
@@ -131,5 +131,20 @@
return true;
}
+
+ /**
+ * -- Add function info here --
+ */
+ function deleteBayesianFilterInfoByBlogId( $blogId )
+ {
+ $query = "DELETE FROM " . $this->getPrefix() . "bayesian_filter_info WHERE blog_id=$blogId";
+
+ $result = $this->Execute($query);
+
+ if(!$result)
+ return false;
+
+ return true;
+ }
}
?>
Modified: plog/trunk/class/dao/bayesiantokens.class.php
===================================================================
--- plog/trunk/class/dao/bayesiantokens.class.php 2006-04-04 15:29:32 UTC (rev 3186)
+++ plog/trunk/class/dao/bayesiantokens.class.php 2006-04-04 18:20:59 UTC (rev 3187)
@@ -322,5 +322,20 @@
return true;
}
+
+ /**
+ * -- Add function info here --
+ */
+ function deleteBayesianTokensByBlogId( $blogId )
+ {
+ $query = "DELETE FROM " . $this->getPrefix() . "bayesian_tokens WHERE blog_id=$blogId";
+
+ $result = $this->Execute($query);
+
+ if(!$result)
+ return false;
+
+ return true;
+ }
}
?>
Modified: plog/trunk/class/dao/blogs.class.php
===================================================================
--- plog/trunk/class/dao/blogs.class.php 2006-04-04 15:29:32 UTC (rev 3186)
+++ plog/trunk/class/dao/blogs.class.php 2006-04-04 18:20:59 UTC (rev 3187)
@@ -273,7 +273,9 @@
require_once( PLOG_CLASS_PATH . 'class/dao/articlecategories.class.php' );
require_once( PLOG_CLASS_PATH . 'class/gallery/dao/galleryresources.class.php' );
require_once( PLOG_CLASS_PATH . 'class/gallery/dao/galleryalbums.class.php' );
-
+ require_once( PLOG_CLASS_PATH . 'class/dao/bayesiantokens.class.php' );
+ require_once( PLOG_CLASS_PATH . 'class/dao/bayesianfilterinfos.class.php' );
+
// first of all, delete the posts
$articles = new Articles();
$articles->deleteBlogPosts( $blogId );
@@ -293,6 +295,12 @@
$resources->deleteUserResources( $blogId );
$albums = new GalleryAlbums();
$albums->deleteUserAlbums( $blogId );
+
+ // next, all bayesian tokens and filter infos
+ $tokens = new BayesianTokens();
+ $tokens->deleteBayesianTokensByBlogId( $blogId );
+ $filterInfos = new BayesianFilterInfos();
+ $filterInfos->deleteBayesianFilterInfoByBlogId( $blogId );
// the permissions for the blog
$perms = new UserPermissions();
More information about the pLog-svn
mailing list