# HG changeset patch
# User Dan
# Date 1195014794 18000
# Node ID 6d9655e02026f1a3934804235dd59834d83d8db8
# Parent 850e1b1209a9fcf6ac1967eecb6f970c1e7c397b
Removed all dragger debugging info and started on the form for forum/category deletion
diff -r 850e1b1209a9 -r 6d9655e02026 decir/admincp/admin_forums.php
--- a/decir/admincp/admin_forums.php Tue Nov 13 22:30:19 2007 -0500
+++ b/decir/admincp/admin_forums.php Tue Nov 13 23:33:14 2007 -0500
@@ -116,6 +116,95 @@
$form->category_list = $cats;
echo $form->html();
break;
+ case 'delete':
+ case 'delete_finish':
+ if ( !isset($parms['fid']) || ( isset($parms['fid']) && !is_int($parms['fid']) ) )
+ {
+ echo '
Invalid forum ID passed to editor.
';
+ break;
+ }
+
+ // $fid is safe (validated as an integer).
+ $fid =& $parms['fid'];
+ $q = $db->sql_query('SELECT forum_id, forum_name, forum_type FROM ' . table_prefix . 'decir_forums WHERE forum_id = ' . $fid . ';');
+ if ( !$q )
+ $db->_die('Decir admin_forums.php selecting forum data for deletion');
+
+ $row = $db->fetchrow();
+ $db->free_result();
+
+ if ( $row['forum_type'] == FORUM_FORUM )
+ {
+ // Provide the option of moving the posts in this forum to another forum
+ $q = $db->sql_query('SELECT forum_id, forum_name FROM ' . table_prefix . "decir_forums WHERE forum_id != {$row['forum_id']} AND forum_type = " . FORUM_FORUM . ';');
+ if ( !$q )
+ $db->_die('Decir admin_forums.php selecting list of possible forums to move topics to');
+ $opt_move = '';
+ if ( $db->numrows() > 0 )
+ {
+ $opt_move .= '
+
";
+ }
+ }
+ else if ( $row['forum_type'] == FORUM_CATEGORY )
+ {
+ // Provide the option of moving the posts in this forum to another forum
+ $q = $db->sql_query('SELECT forum_id, forum_name FROM ' . table_prefix . "decir_forums WHERE forum_id != {$row['forum_id']} AND forum_type = " . FORUM_CATEGORY . ';');
+ if ( !$q )
+ $db->_die('Decir admin_forums.php selecting list of possible categories to move forums to');
+ $opt_move = '';
+ if ( $db->numrows() > 0 )
+ {
+ $opt_move .= '
You are about to obliterate the '. $forcat .' "' . htmlspecialchars($row['forum_name']) . '".
+ You can either preserve its contents or delete them. Beware that if you are deleting a
+ ' . $forcat . ' with a large number of posts in it, this process may take some time.