| ############################################################################### |
| ############################################################################### |
| # ManageCats.pl # |
| # ManageCats.pm # |
| |
| # $Date: 01.05.16 $ # |
| ############################################################################### |
| ############################################################################### |
| # YaBB: Yet another Bulletin Board # |
| # YaBB: Yet another Bulletin Board # |
| # Open-Source Community Software for Webmasters # |
| # Open-Source Community Software for Webmasters # |
| # Version: YaBB 2.5.2 # |
| # Version: YaBB 2.6.12 # |
| # Packaged: October 21, 2012 # |
| # Packaged: January 5, 2016 # |
| # Distributed by: http://www.yabbforum.com # |
| # Distributed by: http://www.yabbforum.com # |
| # =========================================================================== # |
| # =========================================================================== # |
| # Copyright (c) 2000-2012 YaBB (www.yabbforum.com) - All Rights Reserved. # |
| # Copyright (c) 2000-2016 YaBB (www.yabbforum.com) - All Rights Reserved. # |
| # Software by: The YaBB Development Team # |
| # Software by: The YaBB Development Team # |
| # with assistance from the YaBB community. # |
| # with assistance from the YaBB community. # |
| ############################################################################### |
| ############################################################################### |
| |
| use CGI::Carp qw(fatalsToBrowser); |
| |
| our $VERSION = '2.6.12'; |
| |
| |
| $managecatsplver = 'YaBB 2.5.2 $Revision: 1.0 $'; |
| $managecatspmver = 'YaBB 2.6.12 $Revision: 1710 $'; |
| if ($action eq 'detailedversion') { return 1; } |
| if ( $action eq 'detailedversion' ) { return 1; } |
| |
| |
| sub DoCats { |
| sub DoCats { |
| &is_admin_or_gmod; |
| is_admin_or_gmod(); |
| my $i = 0; |
| my $i = 0; |
| while ($_ = each(%FORM)) { |
| while ( $_ = each %FORM ) { |
| if($FORM{$_} && /^yitem_(.+)$/) { |
| if ( $FORM{$_} && /^yitem_(.+)$/xsm ) { |
| $editcats[$i] = $1; |
| $editcats[$i] = $1; |
| $i++; |
| $i++; |
| } |
| } |
| } |
| } |
| |
| |
| if ($FORM{'baction'} eq "edit") { &AddCats(@editcats); } |
| if ( $FORM{'baction'} eq 'edit' ) { AddCats(@editcats); } |
| elsif ($FORM{'baction'} eq "delme") { |
| elsif ( $FORM{'baction'} eq 'delme' ) { |
| if (!$mloaded) { require "$boardsdir/forum.master"; } |
| get_forum_master(); |
| foreach $catid (@editcats) { |
| foreach my $catid (@editcats) { |
| ##Check if category has any boards, and if it does remove them. |
| ##Check if category has any boards, and if it does remove them. |
| if ($cat{$catid} ne "") { require "$admindir/ManageBoards.pl"; &DeleteBoards(split(/,/, $cat{$catid})); } |
| if ( $cat{$catid} ne q{} ) { |
| |
| require Admin::ManageBoards; |
| delete $cat{"$catid"}; |
| DeleteBoards( split /,/xsm, $cat{$catid} ); |
| delete $catinfo{"$catid"}; |
| } |
| |
| |
| my $x = 0; |
| delete $cat{"$catid"}; |
| foreach $categoryid (@categoryorder) { |
| delete $catinfo{"$catid"}; |
| if ($catid eq $categoryid) { splice(@categoryorder, $x, 1); last; } |
| |
| $x++; |
| my $x = 0; |
| } |
| foreach my $categoryid (@categoryorder) { |
| |
| if ( $catid eq $categoryid ) { |
| $yymain .= qq~$admin_txt{'830'} <i>$catid</i> $admin_txt{'831'}<br />~; |
| splice @categoryorder, $x, 1; |
| } |
| last; |
| &Write_ForumMaster; |
| } |
| } |
| $x++; |
| $yytitle = "$admin_txt{'3'}"; |
| } |
| $action_area = "managecats"; |
| |
| &AdminTemplate; |
| $yymain .= |
| |
| qq~$admin_txt{'830'} <i>$catid</i> $admin_txt{'831'}<br />~; |
| |
| } |
| |
| Write_ForumMaster(); |
| |
| } |
| |
| $yytitle = "$admin_txt{'3'}"; |
| |
| $action_area = 'managecats'; |
| |
| AdminTemplate(); |
| |
| return; |
| } |
| } |
| |
| |
| sub AddCats { |
| sub AddCats { |
| &is_admin_or_gmod; |
| my @editcats = @_; |
| |
| is_admin_or_gmod(); |
| |
| |
| my @editcats = @_; |
| if ( $INFO{'action'} eq 'catscreen' ) { $FORM{'amount'} = @editcats; } |
| if ($INFO{"action"} eq "catscreen") { $FORM{"amount"} = @editcats; } |
| get_forum_master(); |
| |
| |
| unless ($mloaded == 1) { require "$boardsdir/forum.master"; } |
| $yymain .= qq~ |
| |
| <form action="$adminurl?action=addcat2" method="post" enctype="multipart/form-data" accept-charset="$yymycharset"> |
| $yymain .= qq~ |
| <div class="bordercolor rightboxdiv"> |
| <form action="$adminurl?action=addcat2" method="post"> |
| <table class="border-space pad-cell" style="margin-bottom: .5em;"> |
| <div class="bordercolor" style="padding: 0px; width: 99%; margin-left: 0px; margin-right: auto;"> |
| <tr> |
| <table border="0" align="center" cellspacing="1" cellpadding="4" width="100%"> |
| <td class="titlebg"> |
| <tr> |
| $admin_img{'cat_img'} |
| <td class="titlebg" colspan="5" align="left"> |
| <b>$admin_txt{'3'}</b> |
| <img src="$imagesdir/cat.gif" alt="" border="0" /> |
| </td> |
| <b>$admin_txt{'3'}</b> |
| </tr><tr> |
| </td> |
| <td class="windowbg2"> |
| </tr><tr> |
| <div class="pad-more">$admin_txt{'43'}</div> |
| <td class="windowbg2" colspan="5" align="left"><br />$admin_txt{'43'}<br /><br /></td> |
| </td> |
| </tr> |
| </tr> |
| </table> |
| </table> |
| </div> |
| </div> |
| <br /> |
| ~; |
| <div class="bordercolor" style="padding: 0px; width: 99%; margin-left: 0px; margin-right: auto;"> |
| require Admin::ManageBoards; |
| <table border="0" align="center" cellspacing="1" cellpadding="4" width="100%">~; |
| |
| |
| # Start Looping through and repeating the board adding wherever needed |
| require "$admindir/ManageBoards.pl"; |
| for my $i ( 0 .. ( $FORM{'amount'} - 1 ) ) { |
| # Start Looping through and repeating the board adding wherever needed |
| if ( ( !$editcats[$i] && $INFO{'action'} eq 'catscreen' ) |
| for ($i = 0; $i < $FORM{'amount'}; $i++) { |
| || ( $editcats[$i] eq q{} && $INFO{'action'} eq 'catscreen' ) ) |
| if ((!$editcats[$i] && $INFO{"action"} eq "catscreen") || ($editcats[$i] eq "" && $INFO{"action"} eq "catscreen")) { next; } |
| { |
| if ($INFO{"action"} eq "catscreen") { |
| next; |
| $id = $editcats[$i]; |
| } |
| foreach $catid (@categoryorder) { |
| if ( $INFO{'action'} eq 'catscreen' ) { |
| unless ($id eq $catid) { next; } |
| $id = $editcats[$i]; |
| @bdlist = split(/,/, $cat{$catid}); |
| foreach my $catid (@categoryorder) { |
| ($curcatname, $catperms, $catallowcol, $catimage) = split(/\|/, $catinfo{"$catid"}); |
| if ( $id ne $catid ) { next; } |
| &ToChars($curcatname); |
| @bdlist = split /,/xsm, $cat{$catid}; |
| $cattext = $curcatname; |
| ( $curcatname, $catperms, $catallowcol, $catimage, $catrss ) = |
| if ($catallowcol eq '' || $catallowcol eq '1') { $allowChecked = 'checked="checked"'; } |
| split /\|/xsm, $catinfo{"$catid"}; |
| else { $allowChecked = ''; } |
| ToChars($curcatname); |
| } |
| $cattext = $curcatname; |
| } else { |
| if ( $catallowcol eq q{} || $catallowcol eq '1' ) { |
| $cattext = "$admin_txt{'44'} $i:"; |
| $allowChecked = 'checked="checked"'; |
| } |
| } |
| $catperms = &DrawPerms($catperms, 0); |
| else { $allowChecked = q{}; } |
| $yymain .= qq~ |
| ### RSS on Board Index Start ### |
| <tr> |
| if ( $catrss == 1 ) { $catrssch = ' checked="checked"'; } |
| <td class="catbg" colspan="4" align="left"> <b>$cattext</b></td> |
| else { $catrssch = q{}; } |
| </tr><tr> |
| ### RSS on Board Index End ### |
| <td class="windowbg" colspan="2"> </td> |
| } |
| <td class="windowbg" align="center"><label for="catperms$i"><b>$admin_txt{'45'}</b></label></td> |
| } |
| <td class="windowbg" align="center"><label for="allowcol$i"><b>$exptxt{'6'}</b></label></td> |
| else { |
| </tr><tr>~; |
| my $cat_num = $i + 1; |
| if ($INFO{"action"} eq 'catscreen') { |
| $cattext = "$admin_txt{'44'} $cat_num:"; |
| $yymain .= qq~ |
| } |
| <td class="windowbg" align="left" valign="middle"><label for="theid$i"><b>$admin_txt{'61a'}</b></label></td> |
| my $catimage_value = q{}; |
| <td class="windowbg2" valign="middle"><br /><input type="hidden" name="theid$i" id="theid$i" value="$id" />$id<br /><br />~; |
| if ( $catimage ) { |
| } else { |
| $catimage_value = qq~<div class="small bold">$admin_txt{'current_img'}: <a href="$yyhtml_root/Templates/Forum/default/$catimage" target="_blank">$catimage</a><br /><input type="checkbox" name="del_catimage$i" id="del_catimage$i" value="1" /> <label for="del_catimage$i">$admin_txt{'64b5'}</label></div>~; |
| $yymain .= qq~ |
| } |
| <td class="windowbg" align="left" valign="middle"><label for="theid$i"><b>$admin_txt{'61a'}</b><br />$admin_txt{'61b'}</label></td> |
| $catperms = DrawPerms( $catperms, 0 ); |
| <td class="windowbg2" valign="middle"><br /><input type="text" name="theid$i" id="theid$i" value="$id" /><br /><br />~; |
| $yymain .= qq~ |
| } |
| <div class="bordercolor rightboxdiv"> |
| $yymain .= qq~ |
| <table class="border-space pad-cell" style="margin-bottom: .5em;"> |
| </td> |
| <tr> |
| <td class="windowbg2" align="center" rowspan="3"><select multiple="multiple" name="catperms$i" id="catperms$i" size="5">$catperms</select><br /><label for="catperms$i"><span class="small">$admin_txt{'14'}</span></label></td> |
| <td class="titlebg" colspan="4"><b>$cattext</b></td> |
| <td class="windowbg2" align="center" rowspan="3"><input type="checkbox" $allowChecked name="allowcol$i" id="allowcol$i" /></td> |
| </tr><tr> |
| </tr><tr> |
| <td class="windowbg" colspan="2"> </td> |
| <td class="windowbg" align="left" valign="middle"><label for="name$i"><b>$admin_txt{'68'}:</b></label></td> |
| <td class="windowbg center"><label for="catperms$i"><b>$admin_txt{'45'}</b></label></td> |
| <td class="windowbg2"><br /><input type="text" name="name$i" id="name$i" value="$curcatname" size="40" /><br /><br /></td> |
| <td class="windowbg center"><label for="allowcol$i"><b>$exptxt{'6'}</b></label></td> |
| </tr><tr> |
| </tr><tr>~; |
| <td class="windowbg" align="left" valign="middle"><label for="catimage$i"><b>$admin_txt{'64b2'}:</b></label></td> |
| if ( $INFO{'action'} eq 'catscreen' ) { |
| <td class="windowbg2"><br /><input type="text" name="catimage$i" id="catimage$i" value="$catimage" size="40" />~ . ($catimage ? qq~<br /><br /><img src="$catimage" alt="" border="0" />~ : '') . qq~<br /><br /></td> |
| $yymain .= qq~ |
| </tr>~; |
| <td class="windowbg"><b>$admin_txt{'61a'}</b></td> |
| } |
| <td class="windowbg2"> |
| $yymain .= qq~<tr> |
| <div class="pad-more"><input type="hidden" name="theid$i" id="theid$i" value="$id" />$id~; |
| <td class="catbg" colspan="4" align="center"> |
| } |
| <input type="hidden" name="amount" value="$FORM{"amount"}" /> |
| else { |
| <input type="hidden" name="screenornot" value="$INFO{'action'}" /> |
| $yymain .= qq~ |
| <input type="submit" value="$admin_txt{'10'}" class="button" /></td> |
| <td class="windowbg"><label for="theid$i"><b>$admin_txt{'61a'}</b><br />$admin_txt{'61b'}</label></td> |
| </tr> |
| <td class="windowbg2"> |
| </table> |
| <div class="pad-more"><input type="text" name="theid$i" id="theid$i" value="$id" />~; |
| |
| } |
| |
| $yymain .= qq~ |
| |
| </div> |
| |
| </td> |
| |
| <td class="windowbg2 center" rowspan="4"><select multiple="multiple" name="catperms$i" id="catperms$i" size="5">$catperms</select><br /><label for="catperms$i"><span class="small">$admin_txt{'14'}</span></label></td> |
| |
| <td class="windowbg2 center" rowspan="4"><input type="checkbox" $allowChecked name="allowcol$i" id="allowcol$i" /></td> |
| |
| </tr><tr> |
| |
| <td class="windowbg"><label for="name$i"><b>$admin_txt{'68'}:</b></label></td> |
| |
| <td class="windowbg2"> |
| |
| <div class="pad-more"><input type="text" name="name$i" id="name$i" value="$curcatname" size="40" /></div> |
| |
| </td> |
| |
| </tr><tr> |
| |
| <td class="windowbg"><label for="catimage$i"><b>$admin_txt{'64b2'}:</b><br /><span class="small">$admin_txt{'64b3'}</span></label></td> |
| |
| <td class="windowbg2"> |
| |
| <div class="pad-more"> |
| |
| <input type="file" name="catimage$i" id="catimage$i" size="35" /> |
| |
| <input type="hidden" name="cur_catimage$i" value="$catimage" /> <span class="cursor small bold" title="$admin_txt{'remove_file'}" onclick="document.getElementById('catimage$i').value='';">X</span>~ . ($catimage ? qq~<br /><img src="$imagesdir/$catimage" alt="" />~ : q{}) . qq~$catimage_value |
| |
| </div> |
| |
| </td> |
| |
| </tr><tr> |
| |
| <td class="windowbg"><label for="catrss$i"><b>$admin_txt{'brdrss1'}:</b></label></td> |
| |
| <td class="windowbg2"> |
| |
| <div class="pad-more"><input type="checkbox" name="catrss$i" id="catrss$i"$catrssch /> <label for="catrss$i"><span class="small">$admin_txt{'brdrss2'}</span></label></div> |
| |
| </td> |
| |
| </tr> |
| |
| </table> |
| |
| </div>~; |
| |
| } |
| |
| $yymain .= qq~<div class="bordercolor rightboxdiv"> |
| |
| <table class="border-space pad-cell"> |
| |
| <tr> |
| |
| <th class="titlebg">$admin_img{'prefimg'} $admin_txt{'10'}</th> |
| |
| </tr><tr> |
| |
| <td class="catbg center"> |
| |
| <input type="hidden" name="amount" value="$FORM{"amount"}" /> |
| |
| <input type="hidden" name="screenornot" value="$INFO{'action'}" /> |
| |
| <input type="submit" value="$admin_txt{'10'}" class="button" /> |
| |
| </td> |
| |
| </tr> |
| |
| </table> |
| </div> |
| </div> |
| </form>~; |
| </form>~; |
| |
| |
| $yytitle = "$admin_txt{'3'}"; |
| $yytitle = "$admin_txt{'3'}"; |
| $action_area = "managecats"; |
| $action_area = 'managecats'; |
| &AdminTemplate; |
| AdminTemplate(); |
| |
| return; |
| } |
| } |
| |
| |
| sub AddCats2 { |
| sub AddCats2 { |
| &is_admin_or_gmod; |
| is_admin_or_gmod(); |
| unless ($mloaded == 1) { require "$boardsdir/forum.master"; } |
| get_forum_master(); |
| |
| |
| for ($i = 0; $i < $FORM{'amount'}; $i++) { |
| |
| if ($FORM{"catimage$i"} ne "") { |
| |
| &admin_fatal_error("invalid_character",$FORM{"catimage$i"}) if $FORM{"catimage$i"} =~ /[^0-9a-zA-Z_\.#\%\-:\+\?\$&~,\@\/]/; |
| |
| &admin_fatal_error("",$admintxt{'44'}) if $FORM{"catimage$i"} !~ /\.(gif|png|jpe?g)$/; |
| |
| } |
| |
| if ($FORM{"theid$i"} eq "") { next; } |
| |
| $id = $FORM{"theid$i"}; |
| |
| &admin_fatal_error("invalid_character","$admin_txt{'44'} $admin_txt{'241'}") if ($id !~ /^[0-9A-Za-z#%+-\.@^_]+$/); |
| |
| if ($FORM{'screenornot'} ne "catscreen") { |
| |
| if ($catinfo{"$id"}) { &admin_fatal_error("cat_defined"); } |
| |
| else { $cat{"$id"} = ""; } |
| |
| push(@categoryorder, $id); |
| |
| } |
| |
| if (!$FORM{"name$i"}) { $FORM{"name$i"} = $id; } |
| |
| |
| |
| $cname = $FORM{"name$i"}; |
| |
| &FromChars($cname); |
| |
| &ToHTML($cname); |
| |
| |
| |
| if ($FORM{"allowcol$i"} eq 'on') { $FORM{"allowcol$i"} = 1; } |
| |
| else { $FORM{"allowcol$i"} = 0; } |
| |
| $catinfo{"$id"} = qq~$cname|$FORM{"catperms$i"}|$FORM{"allowcol$i"}|$FORM{"catimage$i"}~; |
| |
| |
| |
| $yymain .= qq~$admin_txt{'830'} <i>$id</i> $admin_txt{'48'}<br />~; |
| |
| } |
| |
| &Write_ForumMaster; |
| |
| |
| |
| $action_area = "managecats"; |
| for my $i ( 0 .. ( $FORM{'amount'} - 1 ) ) { |
| &AdminTemplate; |
| if ( $FORM{"catimage$i"} ne q{} ) { |
| |
| $FORM{"catimage$i"} = UploadFile("catimage$i", 'Templates/Forum/default', 'png jpg jpeg gif', '250', '0'); |
| |
| if ( $FORM{"cur_catimage$i"} ne q{} ) { |
| |
| unlink "$htmldir/Templates/Forum/default/$FORM{\"cur_catimage$i\"}"; |
| |
| } |
| |
| } |
| |
| else { |
| |
| $FORM{"catimage$i"} = $FORM{"cur_catimage$i"}; |
| |
| } |
| |
| |
| |
| if ( $FORM{"cur_catimage$i"} ne q{} && $FORM{"del_catimage$i"} ) { |
| |
| unlink "$htmldir/Templates/Forum/default/$FORM{\"cur_catimage$i\"}"; |
| |
| $FORM{"catimage$i"} = q{}; |
| |
| } |
| |
| if ( $FORM{"theid$i"} eq q{} ) { next; } |
| |
| $id = $FORM{"theid$i"}; |
| |
| if ( $id !~ /^[0-9A-Za-z#%+-\.@^_]+$/xsm ) { |
| |
| fatal_error( 'invalid_character', |
| |
| "$admin_txt{'44'} $admin_txt{'241'}" ); |
| |
| } |
| |
| if ( $FORM{'screenornot'} ne 'catscreen' ) { |
| |
| if ( $catinfo{"$id"} ) { fatal_error('cat_defined'); } |
| |
| else { $cat{"$id"} = q{}; } |
| |
| push @categoryorder, $id; |
| |
| } |
| |
| if ( !$FORM{"name$i"} ) { $FORM{"name$i"} = $id; } |
| |
| |
| |
| $cname = $FORM{"name$i"}; |
| |
| FromChars($cname); |
| |
| ToHTML($cname); |
| |
| |
| |
| if ( $FORM{"allowcol$i"} eq 'on' ) { $FORM{"allowcol$i"} = 1; } |
| |
| else { $FORM{"allowcol$i"} = 0; } |
| |
| |
| |
| if ( $FORM{"catrss$i"} eq 'on' ) { $FORM{"catrss$i"} = 1; } |
| |
| else { $FORM{"catrss$i"} = 0; } |
| |
| |
| |
| $catinfo{"$id"} = qq~$cname|$FORM{"catperms$i"}|$FORM{"allowcol$i"}|$FORM{"catimage$i"}|$FORM{"catrss$i"}~; |
| |
| |
| |
| $yymain .= qq~$admin_txt{'830'} <i>$id</i> $admin_txt{'48'}<br />~; |
| |
| } |
| |
| Write_ForumMaster(); |
| |
| |
| |
| $action_area = 'managecats'; |
| |
| AdminTemplate(); |
| |
| return; |
| } |
| } |
| |
| |
| sub ReorderCats { |
| sub ReorderCats { |
| &is_admin_or_gmod; |
| is_admin_or_gmod(); |
| unless ($mloaded == 1) { require "$boardsdir/forum.master"; } |
| get_forum_master(); |
| if (@categoryorder > 1) { |
| if ( @categoryorder > 1 ) { |
| $catcnt = @categoryorder; |
| $catcnt = @categoryorder; |
| $catnum = $catcnt; |
| $catnum = $catcnt; |
| if ($catcnt < 4) { $catcnt = 4; } |
| if ( $catcnt < 4 ) { $catcnt = 4; } |
| $categorylist = qq~<select name="selectcats" id="selectcats" size="$catcnt" style="width: 190px;">~; |
| $categorylist = |
| foreach $category (@categoryorder) { |
| qq~<select name="selectcats" id="selectcats" size="$catcnt" style="width: 190px;">~; |
| chomp $category; |
| foreach my $category (@categoryorder) { |
| ($categoryname, undef) = split(/\|/, $catinfo{$category}, 2); |
| chomp $category; |
| &ToChars($categoryname); |
| ( $categoryname, undef ) = split /\|/xsm, $catinfo{$category}, 2; |
| if ($category eq $INFO{"thecat"}) { |
| ToChars($categoryname); |
| $categorylist .= qq~<option value="$category" selected="selected">$categoryname</option>~; |
| if ( $category eq $INFO{'thecat'} ) { |
| } else { |
| $categorylist .= |
| $categorylist .= qq~<option value="$category">$categoryname</option>~; |
| qq~<option value="$category" selected="selected">$categoryname</option>~; |
| } |
| } |
| } |
| else { |
| $categorylist .= qq~</select>~; |
| $categorylist .= |
| } |
| qq~<option value="$category">$categoryname</option>~; |
| $yymain .= qq~ |
| } |
| |
| } |
| |
| $categorylist .= q~</select>~; |
| |
| } |
| |
| $yymain .= qq~ |
| <br /><br /> |
| <br /><br /> |
| <form action="$adminurl?action=reordercats2" method="post"> |
| <form action="$adminurl?action=reordercats2" method="post" accept-charset="$yymycharset"> |
| <table border="0" width="525" cellspacing="1" cellpadding="4" class="bordercolor" align="center"> |
| <table class="bordercolor border-space pad-cell" style="width:525px"> |
| <tr> |
| <tr> |
| <td class="titlebg"><img src="$imagesdir/board.gif" style="vertical-align: middle;" /> <b>$admin_txt{'829'}</b></td> |
| <td class="titlebg">$admin_img{'board'} <b>$admin_txt{'829'}</b></td> |
| </tr> |
| </tr><tr> |
| <tr> |
| <td class="windowbg">~; |
| <td class="windowbg" valign="middle" align="left">~; |
| |
| |
| if ( $catnum > 1 ) { |
| if ($catnum > 1) { |
| $yymain .= qq~ |
| $yymain .= qq~ |
| <div style="float: left; width: 280px; text-align: left; margin-bottom: 4px;" class="small"><label for="selectcats">$admin_txt{'738'}</label></div> |
| <div style="float: left; width: 280px; text-align: left; margin-bottom: 4px;" class="small"><label for="selectcats">$admin_txt{'738'}</label></div> |
| <div style="float: left; width: 230px; text-align: center; margin-bottom: 4px;">$categorylist</div> |
| <div style="float: left; width: 230px; text-align: center; margin-bottom: 4px;">$categorylist</div> |
| <div style="float: left; width: 280px; text-align: left; margin-bottom: 4px;" class="small">$admin_txt{'738a'}</div> |
| <div style="float: left; width: 280px; text-align: left; margin-bottom: 4px;" class="small">$admin_txt{'738a'}</div> |
| <div style="float: left; width: 230px; text-align: center; margin-bottom: 4px;"> |
| <div style="float: left; width: 230px; text-align: center; margin-bottom: 4px;"> |
| <input type="submit" value="$admin_txt{'739a'}" name="moveup" style="font-size: 11px; width: 95px;" class="button" /> |
| <input type="submit" value="$admin_txt{'739a'}" name="moveup" style="font-size: 11px; width: 95px;" class="button" /> |
| <input type="submit" value="$admin_txt{'739b'}" name="movedown" style="font-size: 11px; width: 95px;" class="button" /> |
| <input type="submit" value="$admin_txt{'739b'}" name="movedown" style="font-size: 11px; width: 95px;" class="button" /> |
| </div>~; |
| </div>~; |
| } |
| } else { |
| else { |
| $yymain .= qq~ |
| $yymain .= qq~ |
| <div class="small" style="text-align: center; margin-bottom: 4px;">$admin_txt{'738b'}</div>~; |
| <div class="small" style="text-align: center; margin-bottom: 4px;">$admin_txt{'738b'}</div>~; |
| } |
| } |
| $yymain .= qq~ |
| $yymain .= q~ |
| </td> |
| </td> |
| </tr> |
| </tr> |
| </table> |
| </table> |
| </form> |
| </form> |
| ~; |
| ~; |
| $yytitle = "$admin_txt{'829'}"; |
| $yytitle = "$admin_txt{'829'}"; |
| $action_area = "managecats"; |
| $action_area = 'managecats'; |
| &AdminTemplate; |
| AdminTemplate(); |
| |
| return; |
| } |
| } |
| |
| |
| sub ReorderCats2 { |
| sub ReorderCats2 { |
| &is_admin_or_gmod; |
| is_admin_or_gmod(); |
| my $moveitem = $FORM{'selectcats'}; |
| my $moveitem = $FORM{'selectcats'}; |
| unless ($mloaded == 1) { require "$boardsdir/forum.master"; } |
| get_forum_master(); |
| if ($moveitem) { |
| if ($moveitem) { |
| if ($FORM{'moveup'}) { |
| if ( $FORM{'moveup'} ) { |
| for ($i = 0; $i < @categoryorder; $i++) { |
| for my $i ( 0 .. ( @categoryorder - 1 ) ) { |
| if ($categoryorder[$i] eq $moveitem && $i > 0) { |
| if ( $categoryorder[$i] eq $moveitem && $i > 0 ) { |
| $j = $i - 1; |
| $j = $i - 1; |
| $categoryorder[$i] = $categoryorder[$j]; |
| $categoryorder[$i] = $categoryorder[$j]; |
| $categoryorder[$j] = $moveitem; |
| $categoryorder[$j] = $moveitem; |
| last; |
| last; |
| } |
| } |
| } |
| } |
| } elsif ($FORM{'movedown'}) { |
| } |
| for ($i = 0; $i < @categoryorder; $i++) { |
| elsif ( $FORM{'movedown'} ) { |
| if ($categoryorder[$i] eq $moveitem && $i < $#categoryorder) { |
| for my $i ( 0 .. ( @categoryorder - 1 ) ) { |
| $j = $i + 1; |
| if ( $categoryorder[$i] eq $moveitem && $i < $#categoryorder ) { |
| $categoryorder[$i] = $categoryorder[$j]; |
| $j = $i + 1; |
| $categoryorder[$j] = $moveitem; |
| $categoryorder[$i] = $categoryorder[$j]; |
| last; |
| $categoryorder[$j] = $moveitem; |
| } |
| last; |
| } |
| } |
| } |
| } |
| &Write_ForumMaster; |
| } |
| } |
| Write_ForumMaster(); |
| $yySetLocation = qq~$adminurl?action=reordercats;thecat=$moveitem~; |
| } |
| &redirectexit; |
| $yySetLocation = qq~$adminurl?action=reordercats;thecat=$moveitem~; |
| |
| redirectexit(); |
| |
| return; |
| } |
| } |
| |
| |
| 1; |
| 1; |
| |
| |