Moderator-Forum
1.2
This mod allows you to make a forum for moderators only, without having to give them a own membergroup!
You only have to mention that the intern name of the forum is "moderatorforum"!
If you want an other name, you must change the name in the sources by hand.
You just upload Load.pl, Post.pl and MessageIndex.pl.
All you have to do now is to make a forum called "moderatorforum" and only your moderators (and you of course) can post and read in it!
Version 1.1:
- Security-Bug removed (a guest can no longer see the last post in the forum when he search for it...)
version 1.2 (by [CV]XXL):
- Security-Bug refixed
Questions send to t-master@web.de
t-master
http://www.t-master.de
Sources/Load.pl
sub LoadBoard {
my $threadid = $INFO{'num'} || $INFO{'thread'} || $FORM{'threadid'};
if($currentboard ne '') {
unless( &BoardAccessGet($currentboard) ) { &fatal_error( $txt{'1'} ); }
fopen(FILE, "$vardir/cat.txt");
@categories = ;
fclose(FILE);
foreach $curcat (@categories)
{
$curcat =~ s/[\n\r]//g;
fopen(CAT, "$boardsdir/$curcat.cat");
@catinfo = ;
fclose(CAT);
foreach $curboard (@catinfo)
{
if($curboard ne "$catinfo[0]" && $curboard ne "$catinfo[1]")
{
$curboard =~ s/[\n\r]//g;
fopen(BOARD, "$boardsdir/$curboard.dat");
@boardinfo = ;
fclose(BOARD);
chomp @boardinfo;
if($curboard eq $currentboard){ $boardname = $boardinfo[0];}
foreach(split(/\|/,$boardinfo[2]))
{
fopen(MODERATOR, "$memberdir/$_.dat");
@modprop = ;
fclose(MODERATOR);
$modprop[1] =~ s/[\n\r]//g;
$mods{$_} .= $modprop[1];
if($curboard eq $currentboard){ $moderators{$_} = $modprop[1];
}
}
}
}
}
$boardname = $yyBoardInfo[0];
# Create Hash %moderators with all Moderators of the current board
foreach(split(/\|/,$yyBoardInfo[2])) {
fopen(MODERATOR, "$memberdir/$_.dat");
@modprop = ;
fclose(MODERATOR);
$modprop[1] =~ s/[\n\r]//g;
$moderators{$_} = $modprop[1];
}
$boardname = $yyBoardInfo[0];
Sources/Post.pl
sub Post {
if ($currentboard eq 'moderatorforum' && $settings[7] ne 'Administrator' && !exists $mods{$username}) { &fatal_error( $txt{'1'} ); }
sub Post2 {
if ($currentboard eq 'moderatorforum' && $settings[7] ne 'Administrator' && !exists $mods{$username}) { &fatal_error( $txt{'1'} ); }
Sources/Messageindex.pl
sub MessageIndex {
if ($currentboard eq 'moderatorforum' && $settings[7] ne 'Administrator' && !exists $mods{$username}) { &fatal_error( $txt{'1'} ); }
Sources/Recent.pl
unless( $openmemgr{$curcat} ) { next; }
foreach $curboard (@{$catboards{$curcat}}) {
chomp $curboard;
if($curboard ne 'moderatorforum' || $settings[7] eq 'Administrator' || exists $mods{$username})
{
++$numfound;
}
}
}
}
}
Sources/Search.pl
boardcheck: foreach $curboard (@boards) {
if($curboard ne 'moderatorforum' || $settings[7] eq 'Administrator' || exists $mods{$username})
{
++$numfound;
}
}
}