Sticky Shimmy Shuffle 1.4a YaBB2
1.4a
This mod allows a moderator, Gmod, or Admin to rearrange the order of stickies of a certain board by clicking an arrow beside the thread name in the direction you want it to go. In this version it, also allows only Gmods or Admins to rearrange the order of the Global Announcements in any board.
Installation
---------------------------
- Mod your the files (MessageIndex.pl, SubList.pl, System.pl, & ModList.pl) and upload in ASCII.
Compatability
----------------
YaBB2 Only
Version History
------------------
ver 1.0 - Initial beta release
ver 1.1 - Added the ability to rearrange the global announcements too.
ver 1.2 - Just a little something just in case an admin want to be a moderator too.
ver 1.3 - Will open global announcements, no mater what the file name is.
ver 1.4 - Added support for virboard in global announcements AND moved arrows to far right of thread name.
ver 1.4a - Updated for Y2 Final Release
astro-pilot
Sources/MessageIndex.pl
elsif ($threadclass eq 'locked' && $mstate =~ /s/i && $mstate !~ /h/i) { $threadclass = 'stickylock'; }
elsif ($mstate =~ /s/i && $mstate !~ /h/i) { $threadclass = 'sticky'; }
elsif ($mstate =~ /a/i && $mstate !~ /h/i) { $threadclass = 'announcement'; }
### Start Sticky Shimmy Shuffle mod
my $stickdir;
if ($iammod || $iamadmin || $iamgmod) {
if ($threadclass eq "sticky" || $threadclass eq "stickylock"){$stickdir = qq~ ↑↓ ~;}
elsif (($threadclass eq "announcement") && ($iamadmin || $iamgmod)){$stickdir = qq~ ↑↓ ~;}}
### End Sticky Shimmy Shuffle Mod
$msublink = qq~$msub~;
$msublink = qq~~;
$msublink = qq~$msub~;
$msublink = qq~~;
Sources/SubList.pl
%director=(
'rearrsticky',"System.pl&Rearrange_Sticky",
Sources/System.pl
$systemplver = 'YaBB 2.0 $Revision: 1.66 $';
### Sticky Shimmy Shuffle mod
sub Rearrange_Sticky {
my($mnum, $msub, $mname, $memail, $mdate, $mreplies, $musername, $micon, $mstate, $n, $i, $upstky, $downstky, $stkynum, $stky, @stickies, $oldboard);
$board = $INFO{'board'};
$stkynum = $INFO{'num'};
$direction = $INFO{'direction'};
$oldboard = $INFO{'oldboard'};
fopen(FILE, "$boardsdir/$board.txt") || &fatal_error("300 $messageindex_txt{'106'}: $messageindex_txt{'23'} $board.txt");
@threads = ;
fclose(FILE);
$n = 0;
foreach (@threads){
($mnum, $msub, $mname, $memail, $mdate, $mreplies, $musername, $micon, $mstate) = split( /\|/, $_ );
if ($mstate =~ /(s|a)/i && $mnum eq $stkynum) {$stky = $n;}
if ($mstate =~ /(s|a)/i) {push (@stickies, $_); $n++;}
if ($mstate =~ /s/i) {$_ = "";}
}
if ($direction eq "down" && $stky != $#stickies) {
$i = $stky;
$i++;
$downstky = $stickies[$stky];
$upstky = $stickies[$i];
$stickies[$stky] = $upstky;
$stickies[$i] = $downstky;}
if ($direction eq "up" && $stky != 0) {
$i = $stky;
$i--;
$downstky = $stickies[$i];
$upstky = $stickies[$stky];
$stickies[$i] = $upstky;
$stickies[$stky] = $downstky;}
if ($oldboard) {@threads = @stickies; $currentboard = $oldboard;}
else {push (@threads, @stickies);}
unless (($direction eq "up" && $stky == 0) || ($direction eq "down" && $stky == $#stickies)){
fopen(FILE, ">$boardsdir/$board.txt") || &fatal_error("300 $messageindex_txt{'106'}: $messageindex_txt{'23'} $board.txt");
foreach(@threads){
chomp($_);
next if /^(\s)*$/;
print FILE "$_\n";}
fclose(FILE);}
$yySetLocation = qq~$scripturl?board=$currentboard;~;
&redirectexit;
}
###End Sticky Shimmy Shuffle mod
Admin/ModList.pl
### END BOARDMOD ANCHOR ###
$sss_mod = "Sticky Shimmy Shuffle beta 1.4a_YaBB2|astro-pilot|This mod allows a moderator, Gmod, or Admin to rearrange the order of stickies of a certain board by clicking an arrow beside the thread name in the direction you want it to go. In this version it, also allows only Gmods or Admins to rearrange the order of the Global Announcements in any board.|1.4a|9/30/05";
push (@installed_mods, "$sss_mod");