Announcement Boards 1.3c Let's you set a board as an "Announcement Board" where everyone can read posts, but only the Admin and Moderators can post/reply to topics. Boards can be set to announcement mode in the admin center under Forum Controls - Edit Boards. This feature may be enabled/disabled at any time for a board through the admin center. 1.1: Fixed error where all boards below announcement boards were also made into announcement boards. 1.2: (Sniser) Enhanced it so you now can define if [guests / members / admins and moderators of that board] can can start threads or reply (separately, eg. only members can start threads but guests can reply (note that this does NOT override the $enable_guest_posting setting)) Also added a check in sub Post2, so you can't override it by modifying the HTML of a post page you are allowed access to. 1.3 by [CV]XXL: made it working ;) 1.3a made it compatible with file_attachment.mod 1.3b fixed enhancement 1.3c fixed enhancement again DaveB, Sniser, [CV]XXL http://www.davesworldzone.com Sources/Post.pl $notification = ! $enable_notification || $username eq 'Guest' ? '' : <<"EOT"; fopen(FILE, "$boardsdir/$currentboard.dat") || &fatal_error("300 $txt{'106'}: $txt{'23'} $currentboard.dat"); @blah = ; fclose(FILE); chomp($blah[3]); chomp($blah[4]); if ($INFO{'num'} eq '') { if ($blah[3] == 1) { if ($username eq 'Guest') { &fatal_error("Sorry, only members may start threads on this board."); } } elsif ($blah[3] == 2) { if ($settings[7] ne 'Administrator' && $username ne $moderators{$username}) { &fatal_error("Sorry, only admins and moderators may start threads on this board."); } } } else { if ($blah[4] == 1) { if ($username eq 'Guest') { &fatal_error("Sorry, only members may reply on this board."); } } elsif ($blah[4] == 2) { if ($settings[7] ne 'Administrator' && $username ne $moderators{$username}) { &fatal_error("Sorry, only admins and moderators may reply on this board."); } } } if($username eq 'Guest' && $enable_guestposting == 0) { &fatal_error($txt{'165'}); } fopen(FILE, "$boardsdir/$currentboard.dat") || &fatal_error("300 $txt{'106'}: $txt{'23'} $currentboard.dat"); @blah = ; fclose(FILE); chomp($blah[3]); chomp($blah[4]); if ($blah[4] == 1) { if ($username eq 'Guest') { &fatal_error("Sorry, only members may reply on this board."); } } elsif ($blah[4] == 2) { if ($settings[7] ne 'Administrator' && $username ne $moderators{$username}) { &fatal_error("Sorry, only admins and moderators may reply on this board."); } } Sources/ManageBoards.pl $descr="$boardinfo[1]"; ## Announcement Mod ## undef $starttype; $starttype="$boardinfo[3]"; if ($starttype == 0) { $start0checked = ' checked'; $start1checked = ''; $start2checked = ''; } if ($starttype == 1) { $start0checked = ''; $start1checked = ' checked'; $start2checked = ''; } if ($starttype == 2) { $start0checked = ''; $start1checked = ''; $start2checked = ' checked'; } undef $replytype; $replytype="$boardinfo[4]"; if ($replytype == 0) { $reply0checked = ' checked'; $reply1checked = ''; $reply2checked = ''; } if ($replytype == 1) { $reply0checked = ''; $reply1checked = ' checked'; $reply2checked = ''; } if ($replytype == 2) { $reply0checked = ''; $reply1checked = ''; $reply2checked = ' checked'; } ## /End of Announcement Mod ##
Start Threads: Guests Members Admins & Mods
Reply: Guests Members Admins & Mods
       
Start Threads: Guests Members Admins & Mods
Reply: Guests Members Admins & Mods
if($FORM{'moda'} eq "$txt{'17'}") { if (!$FORM{'startset'}) { $FORM{'startset'} == 0; } if (!$FORM{'replyset'}) { $FORM{'replyset'} == 0; } print FILE "$FORM{'moderator'}\n"; print FILE "$FORM{'startset'}\n"; print FILE "$FORM{'replyset'}\n"; $id="$FORM{'id'}"; if (!$FORM{'startset'}) { $FORM{'startset'} == 0; } if (!$FORM{'replyset'}) { $FORM{'replyset'} == 0; } print FILE "$FORM{'moderator'}|\n"; print FILE "$FORM{'startset'}\n"; print FILE "$FORM{'replyset'}\n";