/** * Removes a blog from the database. It also removes all its posts, its posts categories * its links, its links categories, its trackbacks and its comments * * @param blogId the id of the blog we'd like to delete */ function deleteBlog($blogId) { // first of all, delete the posts $articles = new Articles(); $articles->deleteBlogPosts($blogId); // next is to remove the article categories $articleCategories = new ArticleCategories(); $articleCategories->deleteBlogCategories($blogId); // next, all the links and links categories $myLinks = new MyLinks(); $myLinks->deleteBlogMyLinks($blogId); $myLinksCategories = new MyLinksCategories(); $myLinksCategories->deleteBlogMyLinksCategories($blogId); // the permissions for the blog $perms = new UserPermissions(); $perms->revokeBlogPermissions($blogId); // and finally, delete the blog $query = "DELETE FROM " . $this->getPrefix() . "blogs WHERE id = {$blogId}"; $result = $this->Execute($query); return $result; }