[geeklog-cvs] geeklog-1.3/public_html/admin topic.php,1.48,1.49

dhaun at iowaoutdoors.org dhaun at iowaoutdoors.org
Fri Dec 10 04:32:11 EST 2004


Update of /var/cvs/geeklog-1.3/public_html/admin
In directory www:/tmp/cvs-serv28128/public_html/admin

Modified Files:
	topic.php 
Log Message:
Delete comments and story images when deleting stories from a deleted topic (bug #339)


Index: topic.php
===================================================================
RCS file: /var/cvs/geeklog-1.3/public_html/admin/topic.php,v
retrieving revision 1.48
retrieving revision 1.49
diff -C2 -d -r1.48 -r1.49
*** topic.php	29 Sep 2004 17:43:43 -0000	1.48
--- topic.php	10 Dec 2004 09:32:09 -0000	1.49
***************
*** 377,380 ****
--- 377,389 ----
      DB_query ("UPDATE {$_TABLES['syndication']} SET topic = '::all', is_enabled = 0 WHERE topic = '$tid'");
  
+     // delete comments and images associated with stories in this topic
+     $result = DB_query ("SELECT sid FROM {$_TABLES['stories']} WHERE tid = '$tid'");
+     $numStories = DB_numRows ($result);
+     for ($i = 0; $i < $numStories; $i++) {
+         $A = DB_fetchArray ($result);
+         STORY_deleteImages ($A['sid']);
+         DB_query("DELETE FROM {$_TABLES['comments']} WHERE sid = '{$A['sid']}' AND type = 'article'");
+     }
+ 
      // delete these
      DB_delete ($_TABLES['stories'], 'tid', $tid);




More information about the geeklog-cvs mailing list