4 function blogs_create_group($group_id) {
\r
6 // nothing has to happen when a group is created
\r
11 function blogs_delete_group($group_id) {
\r
14 // deleting a group involves deleting all the blog entries and comments for that group
\r
16 // for each entry, delete the comments
\r
17 $sql = "SELECT post_id FROM ".TABLE_PREFIX."blog_posts WHERE owner_type=".BLOGS_GROUP." AND owner_id=$group_id";
\r
18 $result = mysql_query($sql, $db);
\r
20 while ($row = mysql_fetch_assoc($result)) {
\r
21 $sql = "DELETE FROM ".TABLE_PREFIX."blog_posts_comments WHERE post_id=$row[post_id]";
\r
22 mysql_query($sql, $db);
\r
25 $sql = "DELETE FROM ".TABLE_PREFIX."blog_posts WHERE owner_type=".BLOG_GROUP." AND owner_id=$group_id";
\r
26 mysql_query($sql, $db);
\r