move_board_12
1.2
Adds the time-saving ability to move boards from one category to another, saving you the manual labour of moving threads one by one. It comes in very useful when you're re-organising your categories and which boards are in them.
This mod has been written to work with SP1.2. Unsure about other versions.
A drop-down box is added to the editing section for each board. Choose another category to move the board to, click submit, and it is moved to the bottom of the new category.
A screenshot of the new Edit Boards page can be seen at
http://www.badpoo.co.uk/ronnie/images/moveboard_example.gif
v1.2 - fixed a couple of bugs. Thanks to Dummy Proof.
Richard Carr
http://badpoo.co.uk/ronnie/ - ronnie@badpoo.co.uk
Sources/ManageBoards.pl
if ($text ne "") {&fatal_error($text);}
fopen(FILE, ">$boardsdir/$FORM{'id'}.dat", 1);
$FORM{'descr'} =~ s/\n/ /g;
$FORM{'descr'} =~ s/\r//g;
$FORM{'moderator'} =~ s/\s*,\s*/|/g;
print FILE "$FORM{'boardname'}\n";
print FILE "$FORM{'descr'}\n";
print FILE "$FORM{'moderator'}\n";
fclose(FILE);
#####
#start move board mod
#do we want to change this board's category?
if ($FORM{'newcat'} ne $FORM{'cat'})
{
#first change [0] in boardname.ctb to new category name
fopen(FILE, ">$boardsdir/$FORM{'id'}.ctb"); print FILE qq~$FORM{'newcat'}~; fclose(FILE);
#now open the .cat the board was originally in and delete it from there
fopen(FILE, "$boardsdir/$FORM{'cat'}.cat"); @origcatlines = ; chomp @origcatlines; fclose(FILE);
fopen(FILE, ">$boardsdir/$FORM{'cat'}.cat");
foreach $line (@origcatlines)
{
if ($line ne $FORM{'id'}) { print FILE qq~$line\n~; }
}
fclose(FILE);
#now add the board name to the new .cat file
#a \n needs to be added for some .cat files
fopen(FILE, "<$boardsdir/$FORM{'newcat'}.cat"); @newcat_lines = ; fclose(FILE);
if ($newcat_lines[-1] !~ /\n$/) { $newcat_lines[-1] .= "\n"; }
$FORM{'id'} = $FORM{'id'} . "\n";
push(@newcat_lines, $FORM{'id'});
fopen(FILE, ">$boardsdir/$FORM{'newcat'}.cat"); print FILE @newcat_lines; fclose(FILE);
}
#end move board mod
#####
english.lng
$txt{'798'} = "because that user is not in the required member group.";
$txt{'799'} = "is not a member, so that user can't be a moderator.";
$moveboard{'1'} = "Change Category";
$moveboard{'2'} = "Do Not Change";