code:
<?php

if (!defined("IN_MOD")) {

    die("Nah, I won't serve that file to you.");

}

$mitsuba->admin->reqPermission("post.antibump");

if ((!empty($_GET['b'])) && (!empty($_GET['t'])) && ($mitsuba->common->isBoard($_GET['b'])) && (is_numeric($_GET['t']))) {

    $mitsuba->admin->canBoard($_GET['b']);

    $result = $conn->query("SELECT * FROM posts WHERE id=".$_GET['t']." AND resto=0 AND board='".$_GET['b']."'");

    if ($result->num_rows == 1) {

        $pdata = $result->fetch_assoc();

        if ($pdata['sage'] == 1) {

            $conn->query("UPDATE posts SET sage=0 WHERE id=".$_GET['t']." AND board='".$_GET['b']."'");

            $mitsuba->caching->generatePost($_GET['b'], $_GET['t']);

        ?>

    <?php $mitsuba->admin->ui->startSection($lang['mod/ab_off']); ?>

    <meta http-equiv="refresh" content="1;URL='?/board&b=<?php echo $_GET['b']."&t=".$_GET['t']; ?>'" />

    <?php $mitsuba->admin->ui->endSection(); ?>

        <?php

        } else {

            $conn->query("UPDATE posts SET sage=1 WHERE id=".$_GET['t']." AND board='".$_GET['b']."'");

            $mitsuba->caching->generatePost($_GET['b'], $_GET['t']);

                ?>

            <?php $mitsuba->admin->ui->startSection($lang['mod/ab_on']); ?>

            <meta http-equiv="refresh" content="1;URL='?/board&b=<?php echo $_GET['b']."&t=".$_GET['t']; ?>'" />

            <?php $mitsuba->admin->ui->endSection(); ?>

        <?php

        }

    } else {

    ?>

    <?php $mitsuba->admin->ui->startSection($lang['mod/thread_not_found']); ?>

    <?php $mitsuba->admin->ui->endSection(); ?>

    <?php

    }

} else {

}

?>


code:
<?php

if (!defined("IN_MOD")) {

    die("Nah, I won't serve that file to you.");

}

if(isset($_SESSION['logged'])) {
    $mitsuba->admin->reqPermission("post.viewip");

    if ((!empty($_GET['b'])) && (!empty($_GET['p'])) && ($mitsuba->common->isBoard($_GET['b'])) && (is_numeric($_GET['p'])) && $mitsuba->admin->canBoard($_GET['b'])) {

        $result = $conn->query("SELECT * FROM posts WHERE id=".$_GET['p']." AND board='".$_GET['b']."'");

        if ($result->num_rows == 1) {

            $row = $result->fetch_assoc();
            header('Content-Type: application/json');
            if($mitsuba->admin->canBoard("%")) {
                echo json_encode(array('ip' => $row['ip'], 'sage' => $row['sage']));
            }else{
                global $securetrip_salt;
                echo json_encode(array('ip' => mb_strimwidth(crypt($row['ip'], $securetrip_salt), 0, 10), 'sage' => $row['sage']));
            }
        } else {
            header('Content-Type: application/json');
            echo json_encode(array('error' => 404));

        }

    } else {
        header('Content-Type: application/json');
        echo json_encode(array('error' => 404));

    }
}else {
    //user doesn't have the 'logged' php session. destroy session.
    session_destroy();
    die();
}
?>

license: mit


code:
<?php

if (!defined("IN_MOD")) {

    die("Nah, I won't serve that file to you.");

}

$mitsuba->admin->reqPermission("post.edit");

if ((!empty($_GET['b'])) && (!empty($_GET['p'])) && ($mitsuba->common->isBoard($_GET['b'])) && (is_numeric($_GET['p'])) && $mitsuba->admin->canBoard($_GET['b'])) {

    $result = $conn->query("SELECT * FROM posts WHERE id=".$_GET['p']." AND board='".$_GET['b']."'");

    if ($result->num_rows == 1) {

        $row = $result->fetch_assoc();
        header('Content-Type: application/json');
        echo json_encode(array('comment' => htmlspecialchars($row['comment']), 'raw' => $row['raw'], 'id' => $row['id']));

    } else {
        header('Content-Type: application/json');
        echo json_encode(array('error' => 404));

    }

} else {
    header('Content-Type: application/json');
    echo json_encode(array('error' => 404));

}

?>


code:
<?php

if (!defined("IN_MOD")) {

    die("Nah, I won't serve that file to you.");

}

$mitsuba->admin->reqPermission("post.edit");

if ((!empty($_GET['b'])) && (!empty($_GET['p'])) && ($mitsuba->common->isBoard($_GET['b'])) && (is_numeric($_GET['p'])) && $mitsuba->admin->canBoard($_GET['b'])) {

    $result = $conn->query("SELECT * FROM posts WHERE id=".$_GET['p']." AND board='".$_GET['b']."'");

    if ($result->num_rows == 1) {

        $row = $result->fetch_assoc();

        $raw = 0;

        if ((isset($_POST['raw'])) && ($_POST['raw'] == 1)) {

            $raw = 1;

        }

        $conn->query("UPDATE posts SET comment='".$mitsuba->common->preprocessComment($_POST['comment'])."', raw=".$raw." WHERE id=".$_GET['p']." AND board='".$_GET['b']."'");

        $resto = $row['resto'];

        if ($row['resto'] == 0) {

            $mitsuba->caching->generateView($_GET['b'], $row['id']);

            $mitsuba->caching->generateCatalog($_GET['b']);

            if ($config['caching_mode']==1) {

                $mitsuba->caching->forceGetThread($_GET['b'], $row['id']);

            }

            if ($config['enable_api']==1) {

                $mitsuba->caching->serializeThread($_GET['b'], $row['id']);

            }

            $resto = $row['id'];

        } else {

            $mitsuba->caching->generateView($_GET['b'], $row['resto']);

            if ($config['caching_mode']==1) {

                $mitsuba->caching->forceGetThread($_GET['b'], $row['resto']);

            }

            if ($config['enable_api']==1) {

                $mitsuba->caching->serializeThread($_GET['b'], $row['resto']);

            }

        }

        if ($config['enable_api']==1) {

            $mitsuba->caching->serializeBoard($_GET['b']);

        }

        $mitsuba->caching->generateView($_GET['b']);

    }

} else {

    echo json_encode(array('error' => 404));

}

?>


code:
<?php

if (!defined("IN_MOD")) {

    die("Nah, I won't serve that file to you.");

}

$mitsuba->admin->reqPermission("appeals.clear.all");

    ?>

<?php $mitsuba->admin->ui->startSection($lang['mod/want_clear_appeals']); ?>

<?php echo $lang['mod/no_big']; ?> <?php echo $lang['mod/yes_big']; ?><?php $mitsuba->admin->ui->endSection(); ?>


code:
<?php

if (!defined("IN_MOD")) {

    die("Nah, I won't serve that file to you.");

}

$mitsuba->admin->reqPermission("appeals.view");

if (!empty($_GET['m'])) {

    if ($_GET['m'] == "clear") {

        $mitsuba->admin->reqPermission("appeals.clear.single");

        if ((!empty($_GET['id'])) && (is_numeric($_GET['id']))) {

            $conn->query("DELETE FROM appeals WHERE id=".$_GET['id']);

        }

    }

    if ($_GET['m'] == "clear_all_yes") {

        $mitsuba->admin->reqPermission("appeals.clear.all");

        $conn->query("TRUNCATE TABLE appeals;");

    }

}

    ?>

<?php $mitsuba->admin->ui->startSection($lang['mod/appeals']); ?>

<?php echo $lang['mod/clear_all']; ?>

<?php echo $lang['mod/ip']; ?>

<?php echo $lang['mod/ban_reason']; ?>

<?php echo $lang['mod/staff_note']; ?>

<?php echo $lang['mod/days_left']; ?>

<?php echo $lang['mod/e_mail']; ?>

<?php echo $lang['mod/appeal_text']; ?>

<?php echo $lang['mod/actions']; ?>

<?php

$appeals = $conn->query("SELECT * FROM appeals;");

while ($row = $appeals->fetch_assoc())

{

    if ($row['rangeban'] == 0) {

        $bandata = $conn->query("SELECT * FROM bans WHERE id=".$row['ban_id']);

    } else {

        $bandata = $conn->query("SELECT * FROM rangebans WHERE id=".$row['ban_id']);

    }

    if ($bandata->num_rows == 1) {

        $ban = $bandata->fetch_assoc();

        echo "
";

        if ($row['rangeban'] == 0) {

            echo "".$ban['ip']."	";

        } else {

            echo "".$ban['start_ip']." - ".$ban['end_ip']." ( ".$row['ip']." )	";

        }

        echo "".$ban['reason']."	";

        echo "".$ban['note']."	";

        if ($row['expires'] != 0) {

            echo "".date("d/m/Y @ H:i", $row['expires'])."	";

        } else {

            echo "never	";

        }

        echo "".$row['email']."	";

        echo "".$row['msg']."	";

        echo " [ C / U ]	";

        echo "
";

    } else {

        $conn->query("DELETE FROM appeals WHERE id=".$row['id']);

    }

}

?>

<?php $mitsuba->admin->ui->endSection(); ?>


code:
<?php

if (!defined("IN_MOD")) {

    die("Nah, I won't serve that file to you.");

}

$mitsuba->admin->reqPermission("requests.view");

    ?>

<?php $mitsuba->admin->ui->startSection($lang['mod/ban_requests']); ?>

<?php echo $lang['mod/ip']; ?>

<?php echo $lang['mod/reason']; ?>

<?php echo $lang['mod/staff_note']; ?>

<?php echo $lang['mod/created']; ?>

<?php echo $lang['mod/actions']; ?>

<?php

$result = $conn->query("SELECT * FROM ban_requests ORDER BY created DESC");

while ($row = $result->fetch_assoc())

{

    $post_r = $conn->query("SELECT * FROM posts WHERE id=".$row['post']." AND board='".$row['board']."'");

    if ($post_r->num_rows == 0) {

        $conn->query("DELETE FROM reports WHERE id=".$row['id']);

        continue;

    }

    $post = $post_r->fetch_assoc();

    echo "
";

    echo "".$row['ip']."	";

    echo "".$row['reason']."	";

    echo "".$row['note']."	";

    echo "".date("d/m/Y @ H:i", $row['created'])."	";

    $resto = $post['resto'];

    if ($resto == 0) { $resto = $post['id'];
    }

    echo "[ C / B / P ]	";

    echo "
";

}

?>

<?php $mitsuba->admin->ui->endSection(); ?>


code:
<?php

if (!defined("IN_MOD")) {

    die("Nah, I won't serve that file to you.");

}

$mitsuba->admin->reqPermission("requests.view");

if ((isset($_GET['del'])) && ($_GET['del']==1)) {

    $mitsuba->admin->reqPermission("requests.delete");

    if ((!empty($_GET['b'])) && (is_numeric($_GET['b']))) {

        $conn->query("DELETE FROM ban_requests WHERE id=".$_GET['b']);

    }

}

    ?>

<?php $mitsuba->admin->ui->startSection($lang['mod/ban_requests']); ?>

<?php echo $lang['mod/ip']; ?>

<?php echo $lang['mod/reason']; ?>

<?php echo $lang['mod/staff_note']; ?>

<?php echo $lang['mod/created']; ?>

<?php echo $lang['mod/actions']; ?>

<?php

$result = $conn->query("SELECT * FROM ban_requests ORDER BY created DESC LIMIT 0, 15;");

while ($row = $result->fetch_assoc())

{

    echo "
";

    echo "".$row['ip']."	";

    echo "".$row['reason']."	";

    echo "".$row['note']."	";

    echo "".date("d/m/Y @ H:i", $row['created'])."	";

    $post_r = $conn->query("SELECT * FROM posts WHERE id=".$row['post']." AND board='".$row['board']."'");

    if ($post_r->num_rows == 1) {

        $post = $post_r->fetch_assoc();

        $resto = $post['resto'];

        if ($resto == 0) { $resto = $post['id'];
        }

        echo "[ C / B / P ]	";

    } else {

        echo "[ C / B ]	";

    }

    echo "
";

}

?>

<?php printf($lang['mod/showing_requests'], 15); ?> <?php echo $lang['mod/show_all']; ?>

<?php $mitsuba->admin->ui->endSection(); ?>


code:
<?php
if (!defined("IN_MOD")) {
    die("Nah, I won't serve that file to you.");
}
$mitsuba->admin->reqPermission("bans.add.request");
$canBan = $mitsuba->admin->checkPermission("bans.add");
if (empty($_GET['r'])) {
    if (empty($_POST['ip'])) {

        $IPAddress = "";
        $post = "";
        $board = "";
        $postinfo = "";

        if ((!empty($_GET['p'])) && (!empty($_GET['b'])) && (is_numeric($_GET['p'])) && ($mitsuba->common->isBoard($_GET['b']))) {
            $board = $conn->real_escape_string($_GET['b']);
            $post = $_GET['p'];
            $postdata = $conn->query("SELECT * FROM posts WHERE id=".$post." AND board='".$board."'");
            if ($postdata->num_rows == 1) {
                $postinfo = $postdata->fetch_assoc();
                $IPAddress = $postinfo['ip'];
            } else {
                $post = "";
                $board = "";
            }
        }

        $title = "";

        if ($canBan) {
            $title = $lang['mod/add_ban'];
        } else {
            $title = $lang['mod/add_ban_request'];
        }
        $mitsuba->admin->ui->startSection($title);

        ?>
   <form action="?/bans/add" method="POST">
    <?php $mitsuba->admin->ui->getToken($path); ?>
    <?php if($mitsuba->admin->canBoard("%")) {?>
    <?php echo $lang['mod/ip']; ?>: <input type="text" name="ip" value="<?php echo $IPAddress; ?>"/>

    <?php }else{

}
   global $securetrip_salt;
    ?>
   <input type="hidden" name="board" value="<?php echo $board ?>">
<input type="hidden" name="post" value="<?php echo $post ?>">
<?php echo $lang['mod/ip']; ?>: <?php echo mb_strimwidth(crypt($IPAddress, $securetrip_salt), 0, 10); ?>

<?php echo $lang['mod/reason']; ?>: <input type="text" name="reason" />

<?php echo $lang['mod/staff_note']; ?>: <input type="text" name="note" />

<?php
if ($canBan) {
?>
    <?php echo $lang['mod/expires_eg']; ?>: <input type="text" name="expires" />

    <?php echo $lang['mod/appeal_in']; ?>: <input type="text" name="appeal" value="1s" />

    <?php $mitsuba->admin->ui->getBoardList(); ?>

<?php
}
if (!empty($postinfo)) {
?>
    <input type="hidden" name="post" value="<?php echo $post; ?>" />
    <input type="hidden" name="board" value="<?php echo $board; ?>" />
    <?php
    if ($canBan) {
        if ((!empty($_GET['d'])) && ($_GET['d'] == 1)) {
        ?>
      <input type="hidden" name="delete" value="1" /><?php echo $lang['mod/will_delete']; ?>
        <?php
        }else{

        ?>
        <?php echo $lang['mod/append_text']; ?>: <input type="text" name="append_text" value='(USER WAS BANNED FOR THIS POST)' style="width: 400px;"/><input type="checkbox" name="append" value="1" checked=1/><?php echo $lang['mod/yes']; ?>

        <?php
        }
    }
}
?>

<input type="submit" value="<?php echo $lang['mod/submit']; ?>" />
</form>
<?php $mitsuba->admin->ui->endSection(); ?>
    <?php
    } else {
        $mitsuba->admin->ui->checkToken($_POST['token']);

        if (!filter_var($_POST['ip'], FILTER_VALIDATE_IP)) {

        ?>

        <?php $mitsuba->admin->ui->startSection($lang['mod/ip_syntax_wrong']); ?>

      <?php echo $lang['mod/back']; ?><?php $mitsuba->admin->ui->endSection(); ?>

    <?php

    exit;
        }

        $post = "";
        $board = "";
        $postinfo = "";

        if ((!empty($_POST['post'])) && (!empty($_POST['board'])) && (is_numeric($_POST['post'])) && ($mitsuba->common->isBoard($_POST['board']))) {
            $board = $conn->real_escape_string($_POST['board']);
            $post = $_POST['post'];
            //(USER WAS BANNED FOR THIS POST)
            $postdata = $conn->query("SELECT * FROM posts WHERE id=".$post." AND board='".$board."'");
            if ($postdata->num_rows == 0) {
                $post = "";
                $board = "";
            }
        }

        $boards = "";
        if($mitsuba->admin->canBoard("%")) {
            if ((!empty($_POST['all'])) && ($_POST['all']==1)) {
                $boards = "%";
            } else {
                if (!empty($_POST['boards'])) {
                    $boards = implode(',', $_POST['boards']);
                } else {
                    $boards = "%";
                }
            }
        }

        //if ($boards != "%") { $boards = substr($boards, 0, strlen($boards) - 1); }
        $result = 0;
        $what = 1;

        if (!$canBan) {
            $append = 0;
            if ((!empty($_POST['delete'])) && ($_POST['delete']=="1")) {
                $append = 2;
            } else {
                if ((!empty($post)) && (!empty($_POST['append'])) && ($_POST['append'] == 1)) {
                    $append = 1;
                }
            }
            $result = $mitsuba->admin->bans->addBanRequest($_POST['ip'], $_POST['reason'], $_POST['note'], $board, $post, $append);
            $what = 2;
        } else {
            if($mitsuba->admin->canBoard("%")) {
                $result = $mitsuba->admin->bans->addBan($_POST['ip'], $_POST['reason'], $_POST['note'], $_POST['expires'], $boards, $_POST['appeal']);
            }else{
                // Get the IP address from $_POST['post'] and $_POST['board']...
                $gIPAddr = $conn->query("SELECT * FROM posts WHERE id=".$_POST['post']." AND board='".$_POST['board']."'");
                if($gIPAddr->num_rows == 1) {
                    $gIPPostInfo = $gIPAddr->fetch_assoc();
                    $PostIPAddr = $gIPPostInfo['ip'];
                }else{

                }
                // ... And run the addBan function.
                $result = $mitsuba->admin->bans->addBan($PostIPAddr, $_POST['reason'], $_POST['note'], $_POST['expires'], $boards, $_POST['appeal']);
            }
            if ($result != -2) {
                if ((!empty($_POST['delete'])) && ($_POST['delete']=="1")) {
                    $mitsuba->posting->deletePost($board, $post, "", 0, $mitsuba->admin->checkPermission("post.delete.single"));
                } else {
                    if ((!empty($post)) && (!empty($_POST['append'])) && ($_POST['append'] == 1)) {
                        //echo "append: $board, $post, {$_POST['append_text']}";
                        $mitsuba->admin->appendToPost($board, $post, $_POST['append_text']);
                    }
                }
            }
        }
        if (($what == 1) && ($result == 1)) {
        ?>
        <?php $mitsuba->admin->ui->startSection($lang['mod/user_banned']); ?>
      <?php echo $lang['mod/back']; ?><?php $mitsuba->admin->ui->endSection(); ?>
                <?php
        } elseif (($what == 2) && ($result == 1)) {
        ?>
        <?php $mitsuba->admin->ui->startSection($lang['mod/request_sent']); ?>
      <?php echo $lang['mod/back']; ?><?php $mitsuba->admin->ui->endSection(); ?>
                <?php
        } else {
        ?>
        <?php $mitsuba->admin->ui->startSection($lang['mod/filled_wrong']); ?>
      <?php echo $lang['mod/back']; ?><?php $mitsuba->admin->ui->endSection(); ?>
                <?php
        }
    }
} else {
    if (is_numeric($_GET['r'])) {
        $req = $conn->query("SELECT * FROM ban_requests WHERE id=".$_GET['r']);
        if ($req->num_rows == 1) {
            $request = $req->fetch_assoc();
            $board = $request['board'];
            $post = $request['post'];
            //(USER WAS BANNED FOR THIS POST)
            $postdata = $conn->query("SELECT * FROM posts WHERE id=".$post." AND board='".$board."'");
            if ($postdata->num_rows == 1) {
                $postinfo = $postdata->fetch_assoc();
                $IPAddress = $postinfo['ip'];
            } else {
                $post = "";
                $board = "";
            }
            $title = "";
            if ($canBan) {
                $title = $lang['mod/add_ban'];
            } else {
                $title = $lang['mod/add_ban_request'];
            }
            $mitsuba->admin->ui->startSection($title);
        ?>
    <form action="?/bans/add" method="POST">
    <?php $mitsuba->admin->ui->getToken($path); ?>
    <?php echo $lang['mod/ip']; ?>: <input type="text" name="ip" value="<?php echo $IPAddress; ?>"/>

    <?php echo $lang['mod/reason']; ?>: <input type="text" name="reason" value="<?php echo $request['reason']; ?>"/>

    <?php echo $lang['mod/staff_note']; ?>: <input type="text" name="note" value="<?php echo $request['note']; ?>"/>

    <?php echo $lang['mod/expires_eg']; ?>: <input type="text" name="expires" />

    <?php $mitsuba->admin->ui->getBoardList(); ?>

    <?php
    if (!empty($postinfo)) {
    ?>
    <input type="hidden" name="post" value="<?php echo $post; ?>" />
   <input type="hidden" name="board" value="<?php echo $board; ?>" />
    <?php
    if ((!empty($_GET['d'])) && ($_GET['d'] == 1)) {
    ?>
    <input type="hidden" name="delete" value="1" /><?php echo $lang['mod/will_delete']; ?>
    <?php
    } else {
        ?>
        <?php echo $lang['mod/append_text']; ?>: <input type="text" name="append_text" value='(USER WAS BANNED FOR THIS POST)' style="width: 400px;"/><input type="checkbox" name="append" value="1" checked=1/><?php echo $lang['mod/yes']; ?>

    <?php
    }
    }
    ?>

    <input type="submit" value="<?php echo $lang['mod/submit']; ?>" />
   </form>
    <?php $mitsuba->admin->ui->endSection(); ?>
    <?php
        }
    }
}
?>


code:
<?php

if (!defined("IN_MOD")) {

    die("Nah, I won't serve that file to you.");

}

$mitsuba->admin->reqPermission("bans.view");

$delete = $mitsuba->admin->checkPermission("bans.delete");

$logs = $mitsuba->admin->checkPermission("logs.view");

?>

<?php $mitsuba->admin->ui->startSection(''); ?>

<?php echo $lang['mod/all_bans']?>

                  <?php printf($lang['mod/showing_bans'], 15); ?>
                  | <?php echo $lang['mod/show_all']; ?>
                  | <?php printf($lang['mod/show_recent'], 100); ?>

                  <?php echo $lang['mod/ip']; ?>
                  <?php echo $lang['mod/reason']; ?>
                  <?php echo $lang['mod/staff_note']; ?>
                  <?php echo $lang['mod/created']; ?>
                  <?php echo $lang['mod/expires']; ?>
                  <?php echo $lang['mod/boards']; ?>
                  <?php echo $lang['mod/seen']; ?>
                  <?php echo $lang['mod/delete']; ?>
                    <?php
                    if ($logs) { echo "".$lang['mod/staff_member']."	";
                    }
                ?>

                <?php
                    $_data = $conn->query("SELECT short FROM boards");
                    $_boards = array();
                while ($row = $_data->fetch_assoc()) { $_boards[] = $row['short'];
                }
                if ($logs) {
                    $result = $conn->query("SELECT bans.*, users.username FROM bans LEFT JOIN users ON bans.mod_id=users.id ORDER BY created DESC;");
                } else {
                    $result = $conn->query("SELECT * FROM bans ORDER BY created;");
                }
                while ($row = $result->fetch_assoc()){
                    global $securetrip_salt;
                    echo "
";
                    if($mitsuba->admin->canBoard("%")) {
                        echo "".$row['ip']."	";
                    }else{
                        echo "".crypt($row['ip'], $securetrip_salt)."	";
                    }
                    echo "".$row['reason']."	";
                    echo "".$row['note']."	";
                    echo "".date("d/m/Y @ H:i", $row['created'])."	";
                    if ($row['expires'] != 0) {
                        echo "".date("d/m/Y @ H:i", $row['expires'])."	";
                    } else {
                        echo "never	";
                    }
                    if ($row['boards']=="%") {
                        echo "All boards	";
                    } else {
                        $banBoards = explode(',', $row['boards']);
                        if (0.6 * sizeof($_boards) < sizeof($banBoards)) {
                            echo "All boards excluding: ".implode(', ', array_diff($_boards, $banBoards))."	";
                        } else {
                            echo "".implode(', ', $banBoards)."	";
                        }
                    }
                    if ($row['seen']==1) {
                        echo "YES	";
                    } else {
                        echo "NO	";
                    }
                    if ($delete) {
                        echo "".$lang['mod/delete']."	";
                    } else {
                        echo "	";
                    }
                    if ($logs) {
                        echo "".$row['username']."	";
                    }
                    echo "
";
                }
?>

    <?php $mitsuba->admin->ui->endSection(); ?>


code:
<?php

if (!defined("IN_MOD")) {

    die("Nah, I won't serve that file to you.");

}

$mitsuba->admin->reqPermission("bans.view");

$delete = $mitsuba->admin->checkPermission("bans.delete");

$logs = $mitsuba->admin->checkPermission("logs.view");

if ((isset($_GET['del'])) && ($_GET['del']==1)) {

    $mitsuba->admin->reqPermission("bans.delete");

    if ((!empty($_GET['b'])) && (is_numeric($_GET['b']))) {

        $conn->query("DELETE FROM bans WHERE id=".$_GET['b']);

    }

}

    ?>

    <?php $mitsuba->admin->ui->startSection(''); ?>

<?php echo $lang['mod/bans']?>

                <?php printf($lang['mod/showing_bans'], 15); ?>
                  | <?php echo $lang['mod/show_all']; ?>
                  | <?php printf($lang['mod/show_recent'], 100); ?>

                  <?php echo $lang['mod/ip']; ?>
                  <?php echo $lang['mod/reason']; ?>
                  <?php echo $lang['mod/staff_note']; ?>
                  <?php echo $lang['mod/created']; ?>
                  <?php echo $lang['mod/expires']; ?>
                  <?php echo $lang['mod/boards']; ?>
                  <?php echo $lang['mod/seen']; ?>
                  <?php echo $lang['mod/delete']; ?>
                    <?php
                    if ($logs) { echo "".$lang['mod/staff_member']."	";
                    }
                ?>

                <?php
                    $_data = $conn->query("SELECT short FROM boards");
                    $_boards = array();
                while ($row = $_data->fetch_assoc()) { $_boards[] = $row['short'];
                }
                if ($logs) {
                    $result = $conn->query("SELECT bans.*, users.username FROM bans LEFT JOIN users ON bans.mod_id=users.id ORDER BY created DESC LIMIT 0, 15;");
                } else {
                    $result = $conn->query("SELECT * FROM bans ORDER BY created DESC LIMIT 0, 15;");
                }
                while ($row = $result->fetch_assoc()){
                    echo "
";
                    if($mitsuba->admin->canBoard("%")) {
                        echo "".$row['ip']."	";
                    }else{
                        echo "".crypt($row['ip'], $securetrip_salt)."	";
                    }
                    echo "".$row['reason']."	";
                    echo "".$row['note']."	";
                    echo "".date("d/m/Y @ H:i", $row['created'])."	";
                    if ($row['expires'] != 0) {
                        echo "".date("d/m/Y @ H:i", $row['expires'])."	";
                    } else {
                        echo "never	";
                    }
                    if ($row['boards']=="%") {
                        echo "All boards	";
                    } else {
                        $banBoards = explode(',', $row['boards']);
                        if (0.6 * sizeof($_boards) < sizeof($banBoards)) {
                            echo "All boards excluding: ".implode(', ', array_diff($_boards, $banBoards))."	";
                        } else {
                            echo "".implode(', ', $banBoards)."	";
                        }
                    }
                    if ($row['seen']==1) {
                        echo "YES	";
                    } else {
                        echo "NO	";
                    }
                    if ($delete) {
                        echo "".$lang['mod/delete']."	";
                    } else {
                        echo "	";
                    }
                    if ($logs) {
                        echo "".$row['username']."	";
                    }
                    echo "
";
                }
?>

    <?php $mitsuba->admin->ui->endSection(); ?>


code:
<?php

if (!defined("IN_MOD")) {

    die("Nah, I won't serve that file to you.");

}

$mitsuba->admin->reqPermission("bans.view");

$delete = $mitsuba->admin->checkPermission("bans.delete");

$logs = $mitsuba->admin->checkPermission("logs.view");

if ((!empty($_GET['c'])) && (is_numeric($_GET['c']))) {

    $mitsuba->admin->ui->startSection('');

    ?>

<?php echo sprintf($lang['mod/recent_bans'], $_GET['c'])?>

                  <?php printf($lang['mod/showing_bans'], 15); ?>
                  | <?php echo $lang['mod/show_all']; ?>
                  | <?php printf($lang['mod/show_recent'], $_GET['c']); ?>

                  <?php echo $lang['mod/ip']; ?>
                  <?php echo $lang['mod/reason']; ?>
                  <?php echo $lang['mod/staff_note']; ?>
                  <?php echo $lang['mod/created']; ?>
                  <?php echo $lang['mod/expires']; ?>
                  <?php echo $lang['mod/boards']; ?>
                  <?php echo $lang['mod/seen']; ?>
                  <?php echo $lang['mod/delete']; ?>
                    <?php
                    if ($logs) { echo "".$lang['mod/staff_member']."	";
                    }
                ?>

                <?php
                    $_data = $conn->query("SELECT short FROM boards");
                    $_boards = array();
                while ($row = $_data->fetch_assoc()) { $_boards[] = $row['short'];
                }
                if ($logs) {
                    $result = $conn->query("SELECT bans.*, users.username FROM bans LEFT JOIN users ON bans.mod_id=users.id ORDER BY created DESC LIMIT 0, ".$_GET['c'].";");
                } else {
                    $result = $conn->query("SELECT * FROM bans ORDER BY created LIMIT 0, ".$_GET['c'].";");
                }
                while ($row = $result->fetch_assoc()){
                    echo "
";
                    if($mitsuba->admin->canBoard("%")) {
                        echo "".$row['ip']."	";
                    }else{
                        echo "".crypt($row['ip'], $securetrip_salt)."	";
                    }
                    echo "".$row['reason']."	";
                    echo "".$row['note']."	";
                    echo "".date("d/m/Y @ H:i", $row['created'])."	";
                    if ($row['expires'] != 0) {
                        echo "".date("d/m/Y @ H:i", $row['expires'])."	";
                    } else {
                        echo "never	";
                    }
                    if ($row['boards']=="%") {
                        echo "All boards	";
                    } else {
                        $banBoards = explode(',', $row['boards']);
                        if (0.6 * sizeof($_boards) < sizeof($banBoards)) {
                            echo "All boards excluding: ".implode(', ', array_diff($_boards, $banBoards))."	";
                        } else {
                            echo "".implode(', ', $banBoards)."	";
                        }
                    }
                    if ($row['seen']==1) {
                        echo "YES	";
                    } else {
                        echo "NO	";
                    }
                    if ($delete) {
                        echo "".$lang['mod/delete']."	";
                    } else {
                        echo "	";
                    }
                    if ($logs) {
                        echo "".$row['username']."	";
                    }
                    echo "
";
                }
?>

    <?php $mitsuba->admin->ui->endSection(); ?>

    <?php

}else{
    echo "
YOU DIDN'T DEFINE HOW MANY BANS YOU WANT TO SEE!
";
}

?>


code:
<?php

if (!defined("IN_MOD")) {

    die("Nah, I won't serve that file to you.");

}

$mitsuba->admin->reqPermission("bbcodes.edit");

if (!empty($_GET['n'])) {

    $result = $conn->query("SELECT * FROM bbcodes WHERE name='".$conn->real_escape_string($_GET['n'])."'");

    if ($result->num_rows == 1) {

        $binfo = $result->fetch_assoc();

    ?>

    <?php $mitsuba->admin->ui->startSection($lang['mod/edit_bbcode']); ?>

  <form action="?/bbcodes" method="POST">

    <?php $mitsuba->admin->ui->getToken($path); ?>

  <input type="hidden" name="mode" value="edit">

  <input type="hidden" name="name2" value="<?php echo $conn->real_escape_string($_GET['n']); ?>">

    <?php echo $lang['mod/bbcode']; ?>: <input type="text" name="name" value="<?php echo $binfo['name']; ?>"/>

    <?php echo $lang['mod/html_code']; ?>:<textarea cols=40 rows=9 name="code"><?php echo $binfo['code']; ?>"</textarea>

  <input type="submit" value="<?php echo $lang['mod/submit']; ?>" />

  </form>

    <?php $mitsuba->admin->ui->endSection(); ?>

    <?php

    }

}

?>


code:
<?php

if (!defined("IN_MOD")) {

    die("Nah, I won't serve that file to you.");

}

$mitsuba->admin->reqPermission("bbcodes.view");

        $name = "";

        $code = "";

if ((!empty($_POST['mode'])) && ($_POST['mode'] == "add")) {

    $mitsuba->admin->reqPermission("bbcodes.add");

    $mitsuba->admin->ui->checkToken($_POST['token']);

    $continue = 0;

    if (empty($_POST['name'])) { echo "".$lang['mod/fill_all_fields']."";
    } else { $name = $_POST['name']; $continue = 1;
    }

    if (empty($_POST['code'])) { echo "".$lang['mod/fill_all_fields']."";
    } else { $code = $_POST['code']; $continue = 1;
    }

    if ($continue == 1) {

        if (!preg_match("/^[a-zA-Z0-9]*$/", $_POST['name'])) { echo "".$lang['mod/name_error']."";
        }

        else {

            $name = $conn->real_escape_string($_POST['name']);

            $code = $conn->real_escape_string($_POST['code']);

            $conn->query("INSERT INTO bbcodes (name, code) VALUES ('".$name."', '".$code."');");

            $name = "";

            $code = "";

        }

    }

} elseif ((!empty($_POST['mode'])) && ($_POST['mode'] == "edit") && (!empty($_POST['name2']))) {

    $mitsuba->admin->reqPermission("bbcodes.edit");

    $mitsuba->admin->ui->checkToken($_POST['token']);

    $continue = 0;

    if (empty($_POST['name'])) { echo "".$lang['mod/fill_all_fields']."";
    } else { $name = $_POST['name']; $continue = 1;
    }

    if (empty($_POST['code'])) { echo "".$lang['mod/fill_all_fields']."";
    } else { $code = $_POST['code']; $continue = 1;
    }

    if ($continue == 1) {

        if (!preg_match("/^[a-zA-Z0-9]*$/", $_POST['name'])) { echo "".$lang['mod/name_error']."";
        }

        else {

            $name = $conn->real_escape_string($_POST['name']);

            $name2 = $conn->real_escape_string($_POST['name2']);

            $code = $conn->real_escape_string($_POST['code']);

            $conn->query("UPDATE bbcodes SET name='".$name."', code='".$code."' WHERE name='".$name2."';");

        }

    }

    $name = "";

    $code = "";

}

if ((!empty($_GET['d'])) && ($_GET['d'] == 1) && (!empty($_GET['n']))) {

    $mitsuba->admin->reqPermission("bbcodes.delete");

    $n = $conn->real_escape_string($_GET['n']);

    $conn->query("DELETE FROM bbcodes WHERE name='".$n."'");

}

    ?>

<?php echo $lang['mod/rebuild_notice']; ?>

<?php $mitsuba->admin->ui->startSection($lang['mod/manage_bbcodes']); ?>

<?php echo $lang['mod/bbcode']; ?>

<?php echo $lang['mod/html_code']; ?>

<?php echo $lang['mod/actions']; ?>

<?php

$result = $conn->query("SELECT * FROM bbcodes ORDER BY name ASC");

while ($row = $result->fetch_assoc())

{

    echo "
";

    echo "".$row['name']."	";

    echo "".htmlspecialchars($row['code'])."	";

    echo "".$lang['mod/edit']." ".$lang['mod/delete']."	";

    echo "
";

}

?>

<?php $mitsuba->admin->ui->endSection(); ?>

<?php $mitsuba->admin->ui->startSection($lang['mod/add_bbcode']); ?>

<form action="?/bbcodes" method="POST">

<?php $mitsuba->admin->ui->getToken($path); ?>

<input type="hidden" name="mode" value="add">

<?php echo $lang['mod/bbcode']; ?>: <input type="text" name="name" value="<?php echo $name; ?>"/>

<?php echo $lang['mod/html_code']; ?>: <textarea cols=40 rows=9 name="code"><?php echo $code; ?></textarea>

<input type="submit" value="<?php echo $lang['mod/submit']; ?>" />

</form>

<?php $mitsuba->admin->ui->endSection(); ?>


code:
<?php

if (!defined("IN_MOD")) {

    die("Nah, I won't serve that file to you.");

}

if ((!empty($_GET['b'])) && ($mitsuba->common->isBoard($_GET['b']))) {
    $mitsuba->admin->canBoard($_GET['b']);
    $board = $mitsuba->common->getBoardData($_GET['b']);
    $mode = "page";
    $page = 0;
    if ((!empty($_GET['p'])) && (is_numeric($_GET['p'])) && ($_GET['p'] >= 0) && ($_GET['p'] <= 15)) {
        $page = $_GET['p'];
        echo $mitsuba->caching->generateView($_GET['b'], $page, 1, 0, $_SESSION['group']);
    } elseif ((!empty($_GET['t'])) && (is_numeric($_GET['t']))) {
        $mode = "thread";
        $page = $_GET['t'];
        echo $mitsuba->caching->generateView($_GET['b'], $page, 1, 1, $_SESSION['group']);
    } else {
        echo $mitsuba->caching->generateView($_GET['b'], 0, 1, 0, $_SESSION['group']);
    }
}else{
    echo "
BOARD DOES NOT EXIST!
";
}

?>


code:
<?php

if (!defined("IN_MOD")) {

    die("Nah, I won't serve that file to you.");

}

$mitsuba->admin->reqPermission("boards.add");

$mitsuba->admin->ui->checkToken($_POST['token']);

if ((!empty($_POST['short'])) && (!empty($_POST['name']))) {

    $spoilers = 0;

    $nodup = 0;

    $noname = 0;

    $ids = 0;

    $embeds = 0;

    $nofile = 0;

    $catalog = 0;

    $limit = 0;

    $bbcode = 0;

    $hidden = 0;

    $unlisted = 0;

    $captcha = 0;

    $filesize = 12582912;

    $time_to_delete = 120;

    $time_between_posts = 20;

    $time_between_threads = 60;

    $maxchars = 2000;

    $pages = 15;

    $anonymous = "Anonymous";

    $extensions = "png,jpg,gif";

    $boards = "";

    $allow_replies = 0;

    $file_replies = 0;

    $links = "";

    $files = 15;

    if ((empty($_POST['limit'])) || (!is_numeric($_POST['limit']))) {

        $limit = 0;

    }

    if ((!empty($_POST['spoilers'])) && ($_POST['spoilers'] == 1)) {

        $spoilers = 1;

    }

    if ((!empty($_POST['noname'])) && ($_POST['noname'] == 1)) {

        $noname = 1;

    }

    if ((!empty($_POST['ids'])) && ($_POST['ids'] == 1)) {

        $ids = 1;

    }

    if ((!empty($_POST['embeds'])) && ($_POST['embeds'] == 1)) {

        $embeds = 1;

    }

    if ((!empty($_POST['bbcode'])) && ($_POST['bbcode'] == 1)) {

        $bbcode = 1;

    }

    if ((!empty($_POST['hidden'])) && ($_POST['hidden'] == 1)) {

        $hidden = 1;

    }

    if ((!empty($_POST['unlisted'])) && ($_POST['unlisted'] == 1)) {

        $unlisted = 1;

    }

    if ((!empty($_POST['nodup'])) && ($_POST['nodup'] == 1)) {

        $nodup = 1;

    }

    if ((!empty($_POST['nofile'])) && ($_POST['nofile'] == 1)) {

        $nofile = 1;

    }

    if ((!empty($_POST['catalog'])) && ($_POST['catalog'] == 1)) {

        $catalog = 1;

    }

    if ((!empty($_POST['captcha'])) && ($_POST['captcha'] == 1)) {

        $captcha = 1;

    }

    if ((!empty($_POST['replies'])) && ($_POST['replies'] == 1)) {

        $allow_replies = 1;

    }

    if ((!empty($_POST['file_replies'])) && ($_POST['file_replies'] == 1)) {

        $file_replies = 1;

    }

    if ((!empty($_POST['filesize'])) && (is_numeric($_POST['filesize']))) {

        $filesize = $_POST['filesize'];

    }

    if ((!empty($_POST['time_to_delete'])) && (is_numeric($_POST['time_to_delete']))) {

        $time_to_delete = $_POST['time_to_delete'];

    }

    if ((!empty($_POST['time_between_posts'])) && (is_numeric($_POST['time_between_posts']))) {

        $time_between_posts = $_POST['time_between_posts'];

    }

    if ((!empty($_POST['time_between_threads'])) && (is_numeric($_POST['time_between_threads']))) {

        $time_between_threads = $_POST['time_between_threads'];

    }

    if ((!empty($_POST['maxchars'])) && (is_numeric($_POST['maxchars']))) {

        $maxchars = $_POST['maxchars'];

    }

    if ((!empty($_POST['pages'])) && (is_numeric($_POST['pages']))) {

        $pages = $_POST['pages'];

    }

    if ((!empty($_POST['files'])) && (is_numeric($_POST['files']))) {

        $pages = $_POST['files'];

    }

    if (!empty($_POST['anonymous'])) {

        $anonymous = $_POST['anonymous'];

    }

    switch ($_POST['type'])

    {

    case "imageboard":

        $files = 0;

        $allow_replies = 1;

        $file_replies = 1;

        $links = "";

        $extensions = $mitsuba->admin->ui->parseList('ext', 'ext_all');

        break;

    case "textboard":

        $spoilers = 0;

        $nodup = 0;

        $filesize = 0;

        $files = 0;

        $embeds = 0;

        $nofile = 0;

        $catalog = 0;

        $allow_replies = 1;

        $file_replies = 1;

        $extensions = "";

        $links = "";

        break;

    case "fileboard":

        $pages = 0;

        $embeds = 0;

        $nofile = 0;

        $catalog = 0;

        $links = "";

        $extensions = $mitsuba->admin->ui->parseList('ext', 'ext_all');

        break;

    case "linkboard":

        $filesize = 0;

        $pages = 0;

        $files = 0;

        $embeds = 0;

        $nofile = 0;

        $catalog = 0;

        $file_replies = 1;

        $extensions = "";

        $links = $mitsuba->admin->ui->parseList('links', 'l_all');

        break;

    case "overboard":

        $noname = 0;

        $ids = 0;

        $time_between_posts = 0;

        $time_between_threads = 0;

        $time_to_delete = 0;

        $anonymous = "";

        $limit = 0;

        $filesize = 0;

        $files = 0;

        $bbcode = 0;

        $hidden = 0;

        $unlisted = 0;

        $captcha = 0;

        $spoilers = 0;

        $nodup = 0;

        $embeds = 0;

        $nofile = 0;

        $catalog = 0;

        $allow_replies = 0;

        $file_replies = 0;

        $extensions = "";

        $links = "";

        $boards = $mitsuba->admin->ui->parseList('boards', 'all');

        break;

    case "archive":

        die("Archive not supported yet");

                    break;

    default:

        die("Wrong type ;___;");

                    break;

    }

    if ($mitsuba->admin->boards->addBoard($_POST['short'], $_POST['type'], $_POST['name'], $_POST['des'], $_POST['msg'], $limit, $spoilers, $noname, $ids, $embeds, $bbcode, $time_between_posts, $time_between_threads, $time_to_delete, $filesize, $pages, $hidden, $unlisted, $nodup, $nofile, $maxchars, $anonymous, $extensions, $catalog, $captcha, $boards, $allow_replies, $file_replies, $links, $files) > 0) {
        $mitsuba->admin->logAction(sprintf($lang['log/added_board'], $conn->real_escape_string($_POST['short'])));

        ?>

    <?php $mitsuba->admin->ui->startSection($lang['mod/board_created']); ?>

 <?php echo $lang['mod/back']; ?><?php $mitsuba->admin->ui->endSection(); ?>

                <?php

    } else {

    ?>

    <?php $mitsuba->admin->ui->startSection($lang['mod/board_exists_mysql_error']); ?>

 <?php echo $lang['mod/back']; ?><?php $mitsuba->admin->ui->endSection(); ?>

    <?php

    }

} else {

    ?>

<?php $mitsuba->admin->ui->startSection($lang['mod/fill_all_fields']); ?>

<?php echo $lang['mod/back']; ?><?php $mitsuba->admin->ui->endSection(); ?>

    <?php

}

?>


code:
<?php

if (!defined("IN_MOD")) {

    die("Nah, I won't serve that file to you.");

}

$mitsuba->admin->reqPermission("boards.delete");

if (!empty($_GET['board'])) {

    ?>

<?php $mitsuba->admin->ui->startSection(sprintf($lang['mod/want_delete_board'], $_GET['board'])); ?>

<?php echo $lang['mod/no_big']; ?> <form action="?/boards/delete_yes&board=<?php echo $_GET['board']; ?>" method="POST"><?php $mitsuba->admin->ui->getToken($path); ?><input type='submit' value='<?php echo $lang['mod/yes_big']; ?>' /></form><?php $mitsuba->admin->ui->endSection(); ?>

                <?php

} else {

    ?>

<?php $mitsuba->admin->ui->startSection($lang['mod/board_not_found']); ?>

<?php echo $lang['mod/back']; ?><?php $mitsuba->admin->ui->endSection(); ?>

                <?php

}

?>


code:
<?php

if (!defined("IN_MOD")) {

    die("Nah, I won't serve that file to you.");

}

$mitsuba->admin->reqPermission("boards.delete");

//$mitsuba->admin->ui->checkToken();

if (!empty($_GET['board'])) {

    $board = $conn->real_escape_string($_GET['board']);

    if ($mitsuba->common->isBoard($board)) {

        $mitsuba->admin->boards->deleteBoard($board);

        $mitsuba->admin->logAction(sprintf($lang['log/deleted_board'], $board));

        ?>

    <?php $mitsuba->admin->ui->startSection($lang['mod/board_deleted']); ?>

 <?php echo $lang['mod/back']; ?><?php $mitsuba->admin->ui->endSection(); ?>

        <?php

    } else {

        ?>

    <?php $mitsuba->admin->ui->startSection($lang['mod/board_not_found']); ?>

 <?php echo $lang['mod/back']; ?><?php $mitsuba->admin->ui->endSection(); ?>

        <?php

    }

}

?>


code:
<?php

if (!defined("IN_MOD")) {

    die("Nah, I won't serve that file to you.");

}

$mitsuba->admin->reqPermission("boards.update");

if ($mitsuba->common->isBoard($_GET['board'])) {

    $data = $mitsuba->common->getBoardData($_GET['board']);
    ?>

<?php $mitsuba->admin->ui->startSection(sprintf($lang['mod/edit_board'], $_GET['board'])); ?>

<form action="?/boards/update&board=<?php echo $_GET['board']; ?>" method="POST">

<?php $mitsuba->admin->ui->getToken($path); ?>

<?php echo $lang['mod/board_type'].":"; ?>

<?php

switch ($data['type'])

{

case "imageboard":

    echo "".$lang['mod/imageboard']."
";

    break;

case "textboard":

    echo "".$lang['mod/textboard']."
";

    break;

case "overboard":

    echo "".$lang['mod/overboard']."
";

    break;

case "fileboard":

    echo "".$lang['mod/fileboard']."
";

    break;

case "linkboard":

    echo "".$lang['mod/linkboard']."
";

    break;

case "archive":

    echo "".$lang['mod/archive']."
";

    break;

default:

    echo "".$lang['mod/fool']."
";

    break;

}

?>

<?php if (($data['type'] == "imageboard") || ($data['type'] == "textboard") || ($data['type'] == "fileboard") || ($data['type'] == "linkboard")) { ?>
    <?php echo $lang['mod/board_directory']; ?>: <input disabled type="text" name="short" maxlength=10 value="<?php echo $data['short']; ?>" />

    <?php echo $lang['mod/board_name']; ?>: <input type="text" name="name" maxlength=100 value="<?php echo $data['name']; ?>" />

    <?php echo $lang['mod/board_short']; ?>: <input type="text" name="des" maxlength=100 value="<?php echo $data['des']; ?>" />

    <?php echo $lang['mod/board_msg']; ?>:
<textarea cols=70 rows=7 name="msg"><?php echo $data['message']; ?></textarea>

    <?php echo $lang['mod/board_limit']; ?>: <input type="text" name="limit" maxlength=9 value="<?php echo $data['bumplimit']; ?>" />

    <?php echo $lang['mod/board_time_between_posts']; ?>: <input type="text" name="time_between_posts" maxlength=20 value="<?php echo $data['time_between_posts']; ?>" />

    <?php echo $lang['mod/board_time_between_threads']; ?>: <input type="text" name="time_between_threads" maxlength=20 value="<?php echo $data['time_between_threads']; ?>" />

    <?php echo $lang['mod/board_time_to_delete']; ?>: <input type="text" name="time_to_delete" maxlength=20 value="<?php echo $data['time_to_delete']; ?>" />

    <?php echo $lang['mod/board_maxchars']; ?>: <input type="text" name="maxchars" maxlength=8 value="<?php echo $data['maxchars']; ?>" />

    <?php echo $lang['mod/board_default_name']; ?>: <input type="text" name="anonymous" maxlength=60 value="<?php echo $data['anonymous']; ?>" />

<?php } ?>

<?php if (($data['type'] == "imageboard") || ($data['type'] == "fileboard")) { ?>
    <?php echo $lang['mod/board_filesize']; ?>: <input type="text" name="filesize" maxlength=20 value="<?php echo $data['filesize']; ?>" />

<?php } ?>

<?php if (($data['type'] == "imageboard") || ($data['type'] == "textboard") || ($data['type'] == "overboard")) { ?>
    <?php echo $lang['mod/board_pages']; ?>: <input type="text" name="pages" maxlength=4 value="<?php echo $data['pages']; ?>" />

<?php } ?>

<?php if ($data['type'] == "fileboard") { ?>
    <?php echo $lang['mod/board_files']; ?>: <input type="text" name="files" maxlength=4 value="<?php echo $data['files']; ?>" />

<?php } ?>

<?php echo $lang['mod/board_options']; ?>:

<?php if (($data['type'] == "imageboard") || ($data['type'] == "textboard") || ($data['type'] == "fileboard") || ($data['type'] == "linkboard")) { ?>

    <input type="checkbox" name="noname" value="1" <?php if ($data['noname'] == 1) { echo "checked ";
} ?> /><?php echo $lang['mod/board_no_name']; ?>

    <input type="checkbox" name="ids" value="1" <?php if ($data['ids'] == 1) { echo "checked ";
} ?> /><?php echo $lang['mod/board_ids']; ?>

    <input type="checkbox" name="bbcode" value="1" <?php if ($data['bbcode'] == 1) { echo "checked ";
} ?> /><?php echo $lang['mod/board_bbcode']; ?>

    <input type="checkbox" name="hidden" value="1" <?php if ($data['hidden'] == 1) { echo "checked ";
} ?> /><?php echo $lang['mod/board_hidden']; ?>

    <input type="checkbox" name="unlisted" value="1" <?php if ($data['unlisted'] == 1) { echo "checked ";
} ?> /><?php echo $lang['mod/board_unlisted']; ?>

    <input type="checkbox" name="captcha" value="1" <?php if ($data['captcha'] == 1) { echo "checked ";
} ?> /><?php echo $lang['mod/board_captcha']; ?>

<?php } ?>

<?php if (($data['type'] == "imageboard") || ($data['type'] == "fileboard") || ($data['type'] == "linkboard")) { ?>
    <input type="checkbox" name="spoilers" value="1" <?php if ($data['spoilers'] == 1) { echo "checked ";
} ?> /><?php echo $lang['mod/board_spoilers']; ?>

    <input type="checkbox" name="nodup" value="1" <?php if ($data['nodup'] == 1) { echo "checked ";
} ?> /><?php echo $lang['mod/board_nodup']; ?>
<?php } ?>

<?php if ($data['type'] == "imageboard") { ?>
    <input type="checkbox" name="embeds" value="1" <?php if ($data['embeds'] == 1) { echo "checked ";
} ?> /><?php echo $lang['mod/board_embeds']; ?>

    <input type="checkbox" name="nofile" value="1" <?php if ($data['nofile'] == 1) { echo "checked ";
} ?> /><?php echo $lang['mod/board_nofile']; ?>

    <input type="checkbox" name="catalog" value="1" <?php if ($data['catalog'] == 1) { echo "checked ";
} ?> /><?php echo $lang['mod/board_catalog']; ?>

<?php } ?>

<?php if (($data['type'] == "fileboard") || ($data['type'] == "linkboard")) { ?>
    <input type="checkbox" name="replies" value="1" <?php if ($data['allow_replies'] == 1) { echo "checked ";
} ?> /><?php echo $lang['mod/board_allow_replies']; ?>

<?php } ?>

<?php if ($data['type'] == "fileboard") { ?>
    <input type="checkbox" name="file_replies" value="1" <?php if ($data['file_replies'] == 1) { echo "checked ";
} ?> /><?php echo $lang['mod/board_allow_file_replies']; ?>

<?php } ?>

<?php if (($data['type'] == "imageboard") || ($data['type'] == "fileboard")) { ?>
    <?php $mitsuba->admin->ui->getExtensionList($data['extensions']); ?>
<?php } ?>

<?php if ($data['type'] == "linkboard") { ?>
    <?php $mitsuba->admin->ui->getLinkList($data['links']); ?>
<?php } ?>

<?php if ($data['type'] == "overboard") { ?>
    <?php $mitsuba->admin->ui->getBoardList($data['overboard_boards']); ?>
<?php } ?>

<input type="submit" value="<?php echo $lang['mod/submit']; ?>" />

</form>

<?php $mitsuba->admin->ui->endSection(); ?>

<?php $mitsuba->admin->ui->startSection(sprintf($lang['mod/move_board'], $_GET['board'])); ?>

<form action="?/boards/move&board=<?php echo $_GET['board']; ?>" method="POST">

<?php $mitsuba->admin->ui->getToken($path); ?>

<?php echo $lang['mod/board_new_dir']; ?>: <input type="text" name="new" maxlength=10 />

<input type="submit" value="<?php echo $lang['mod/submit']; ?>" />

</form>

<?php $mitsuba->admin->ui->endSection(); ?>

<?php

} else {

    ?>

<?php $mitsuba->admin->ui->startSection($lang['mod/board_not_found']); ?>

<?php echo $lang['mod/back']; ?>

<?php $mitsuba->admin->ui->endSection(); ?>

                <?php

}

?>


code:
<?php

if (!defined("IN_MOD")) {

    die("Nah, I won't serve that file to you.");

}

$mitsuba->admin->reqPermission("boards.view");

?>
<?php if($mitsuba->admin->canBoard("%")) { ?>
<?php $mitsuba->admin->ui->startSection($lang['mod/create_new_board']); ?>

<form action="?/boards/add" method="POST">

<?php $mitsuba->admin->ui->getToken($path); ?>

<?php echo $lang['mod/board_directory']; ?>: <input type="text" name="short" maxlength=10 />

<?php echo $lang['mod/board_name']; ?>: <input type="text" name="name" maxlength=100 />

<?php echo $lang['mod/board_short']; ?>: <input type="text" name="des" maxlength=100 />

<?php echo $lang['mod/board_msg']; ?>:
<textarea cols=70 rows=7 name="msg"></textarea>

<?php echo $lang['mod/board_type']; ?>: <select name="type">

<option value="imageboard"><?php echo $lang['mod/imageboard']; ?></option>

<option value="textboard"><?php echo $lang['mod/textboard']; ?></option>

<option value="overboard"><?php echo $lang['mod/overboard']; ?></option>

<option value="fileboard"><?php echo $lang['mod/fileboard']; ?></option>

<option value="linkboard"><?php echo $lang['mod/linkboard']; ?></option>

<option value="archive"><?php echo $lang['mod/archive']; ?></option>

</select>

<?php echo $lang['mod/board_limit']; ?>: <input type="text" name="limit" maxlength=9 value="0" />

<?php echo $lang['mod/board_time_between_posts']; ?>: <input type="text" name="time_between_posts" maxlength=20 value="20" />

<?php echo $lang['mod/board_time_between_threads']; ?>: <input type="text" name="time_between_threads" maxlength=20 value="60" />

<?php echo $lang['mod/board_time_to_delete']; ?>: <input type="text" name="time_to_delete" maxlength=20 value="120" />

<?php echo $lang['mod/board_maxchars']; ?>: <input type="text" name="maxchars" maxlength=8 value="2000" />

<?php echo $lang['mod/board_default_name']; ?>: <input type="text" name="anonymous" maxlength=60 value="<?php echo $lang['img/anonymous']; ?>" />

<?php echo $lang['mod/board_filesize']; ?>: <input type="text" name="filesize" maxlength=20 value="2097152" />

<?php echo $lang['mod/board_pages']; ?>: <input type="text" name="pages" maxlength=4 value="15" />

<?php echo $lang['mod/board_files']; ?>: <input type="text" name="files" maxlength=4 value="15" />

<?php echo $lang['mod/board_options']; ?>:

<input type="checkbox" name="noname" value="1" /><?php echo $lang['mod/board_no_name']; ?>

<input type="checkbox" name="ids" value="1" /><?php echo $lang['mod/board_ids']; ?>

<input type="checkbox" name="bbcode" value="1" checked/><?php echo $lang['mod/board_bbcode']; ?>

<input type="checkbox" name="hidden" value="1"/><?php echo $lang['mod/board_hidden']; ?>

<input type="checkbox" name="unlisted" value="1"/><?php echo $lang['mod/board_unlisted']; ?>

<input type="checkbox" name="captcha" value="1"/><?php echo $lang['mod/board_captcha']; ?>

<input type="checkbox" name="spoilers" value="1" /><?php echo $lang['mod/board_spoilers']; ?>

<input type="checkbox" name="nodup" value="1"/><?php echo $lang['mod/board_nodup']; ?>

<input type="checkbox" name="embeds" value="1" /><?php echo $lang['mod/board_embeds']; ?>

<input type="checkbox" name="nofile" value="1"/><?php echo $lang['mod/board_nofile']; ?>

<input type="checkbox" name="catalog" value="1"/><?php echo $lang['mod/board_catalog']; ?>

<input type="checkbox" name="replies" value="1" checked/><?php echo $lang['mod/board_allow_replies']; ?>

<input type="checkbox" name="file_replies" value="1"/><?php echo $lang['mod/board_allow_file_replies']; ?>

<?php $mitsuba->admin->ui->getExtensionList(); ?>

<?php $mitsuba->admin->ui->getLinkList(); ?>

<?php $mitsuba->admin->ui->getBoardList(); ?>

<input type="submit" value="<?php echo $lang['mod/submit']; ?>" />

</form>

<?php $mitsuba->admin->ui->endSection(); ?>
<?php } ?>

<?php $mitsuba->admin->ui->startSection($lang['mod/manage_boards']); ?>

<?php echo $lang['mod/all_boards']; ?>:

<?php echo $lang['mod/all_boards']; ?>:

                                    <?php echo $lang['mod/directory']; ?>
                                    <?php echo $lang['mod/name']; ?>
                                    <?php echo $lang['mod/description']; ?>
                                    <?php echo $lang['mod/board_type']; ?>
                                    <?php echo $lang['mod/bump_limit']; ?>
                                    <?php echo $lang['mod/message']; ?>
                                    <?php echo $lang['mod/special']; ?>
                                    <?php echo $lang['mod/edit']; ?>
                                    <?php echo $lang['mod/delete']; ?>
                                    <?php echo $lang['mod/rebuild_cache']; ?>

                  183
                  John Doe
                  11-7-2014
                  Approved
                  Bacon ipsum dolor sit amet salami venison chicken flank fatback doner.

                  219
                  Alexander Pierce
                  11-7-2014
                  Pending
                  Bacon ipsum dolor sit amet salami venison chicken flank fatback doner.

                  657
                  Bob Doe
                  11-7-2014
                  Approved
                  Bacon ipsum dolor sit amet salami venison chicken flank fatback doner.

                  175
                  Mike Doe
                  11-7-2014
                  Denied
                  Bacon ipsum dolor sit amet salami venison chicken flank fatback doner.

<?php echo $lang['mod/directory']; ?>

<?php echo $lang['mod/name']; ?>

<?php echo $lang['mod/description']; ?>

<?php echo $lang['mod/board_type']; ?>

<?php echo $lang['mod/bump_limit']; ?>

<?php echo $lang['mod/message']; ?>

<?php echo $lang['mod/special']; ?>

<?php echo $lang['mod/edit']; ?>

<?php echo $lang['mod/delete']; ?>

<?php echo $lang['mod/rebuild_cache']; ?>

<?php

$result = $conn->query("SELECT * FROM boards ORDER BY short ASC;");

while ($row = $result->fetch_assoc())

{
    if(!$mitsuba->admin->canBoard("%")) {
        if($row['short'] != $_SESSION['boards']) {continue;
        }
    }
    echo '
';

    echo "/".$row['short']."/	";

    echo "".$row['name']."	";

    echo "".$row['des']."	";

    switch ($row['type'])

    {

    case "imageboard":

        echo "".$lang['mod/imageboard']."	";

        break;

    case "textboard":

        echo "".$lang['mod/textboard']."	";

        break;

    case "overboard":

        echo "".$lang['mod/overboard']."	";

        break;

    case "fileboard":

        echo "".$lang['mod/fileboard']."	";

        break;

    case "linkboard":

        echo "".$lang['mod/linkboard']."	";

        break;

    case "archive":

        echo "".$lang['mod/archive']."	";

        break;

    default:

        echo "".$lang['mod/fool']."	";

        break;

    }

    echo "".$row['bumplimit']."	";

    if (!empty($row['message'])) {

        echo "".$lang['mod/yes']."	";

    } else {

        echo "".$lang['mod/no']."	";

    }

    echo "";

    if ($row['spoilers']==1) { echo "".$lang['mod/spoilers']."
";
    }

    if ($row['noname']==1) { echo "".$lang['mod/noname']."
";
    }

    if ($row['ids']==1) { echo "".$lang['mod/ids']."
";
    }

    if ($row['embeds']==1) { echo "".$lang['mod/embeds']."
";
    }

    if ($row['bbcode']==1) { echo "".$lang['mod/board_bbcode']."
";
    }

    if ($row['hidden']==1) { echo "".$lang['mod/board_hidden']."
";
    }

    if ($row['nodup']==1) { echo "".$lang['mod/board_nodup']."
";
    }

    if ($row['catalog']==1) { echo "".$lang['mod/board_catalog']."
";
    }

    if ($row['captcha']==1) { echo "".$lang['mod/board_captcha']."
";
    }

    if ($row['nofile']==1) { echo "".$lang['mod/board_nofile']."
";
    }

    echo "	";

    echo "".$lang['mod/edit']."	";

    echo "".$lang['mod/delete']."	";

    echo "".$lang['mod/rebuild_cache']."	";

    echo '
';

}

?>

<?php $mitsuba->admin->ui->endSection(); ?>


code:
<?php

if (!defined("IN_MOD")) {

    die("Nah, I won't serve that file to you.");

}

$mitsuba->admin->reqPermission("boards.move");

if ($mitsuba->common->isBoard($_GET['board'])) {

    if (!empty($_POST['new'])) {

        $result = $mitsuba->admin->boards->moveBoard($_GET['board'], $_POST['new']);

        $mitsuba->admin->logAction(sprintf($lang['log/moved_board'], $conn->real_escape_string($_GET['board']), $conn->real_escape_string($_POST['new'])));

        if($result == 1) {

        ?>

    <?php $mitsuba->admin->ui->startSection($lang['mod/board_moved']); ?>

    <?php echo $lang['mod/back']; ?><?php $mitsuba->admin->ui->endSection(); ?>

                <?php

        } elseif ($result == 0) {

                ?>

            <?php $mitsuba->admin->ui->startSection($lang['mod/board_not_found']); ?>

            <?php echo $lang['mod/back']; ?><?php $mitsuba->admin->ui->endSection(); ?>

                <?php

        } elseif ($result == -1) {

                ?>

            <?php $mitsuba->admin->ui->startSection(sprintf($lang['mod/board_exists'], $_POST['new'])); ?>

            <?php echo $lang['mod/back']; ?><?php $mitsuba->admin->ui->endSection(); ?>

                <?php

        }

    }

} else {

    ?>

<?php $mitsuba->admin->ui->startSection($lang['mod/board_not_found']); ?>

<?php echo $lang['mod/back']; ?><?php $mitsuba->admin->ui->endSection(); ?>

                <?php

}

?>


code:
<?php
if (!defined("IN_MOD")) {
    die("Nah, I won't serve that file to you.");
}
    $mitsuba->admin->reqPermission("boards.rebuild");
if($mitsuba->admin->canBoard($_GET['board'])) {
    if ((!empty($_GET['board'])) && ($mitsuba->common->isBoard($_GET['board']))) {
        $mitsuba->caching->rebuildBoardCache($_GET['board']);
        $mitsuba->admin->logAction(sprintf($lang['log/rebuilt_board'], $conn->real_escape_string($_GET['board'])));
    ?>

    <?php $mitsuba->admin->ui->startSection($lang['mod/board_cache_rebuilded']); ?>
<?php echo $lang['mod/back']; ?><?php $mitsuba->admin->ui->endSection(); ?>
                <?php
    } else {
    ?>
    <?php $mitsuba->admin->ui->startSection($lang['mod/board_not_found']); ?>
  <?php echo $lang['mod/back']; ?><?php $mitsuba->admin->ui->endSection(); ?>
                <?php
    }
}else{
    echo "
You can't rebuild /${_GET['board']}/!
";
    echo "${lang['mod/back']}";
}

?>


code:
<?php

if (!defined("IN_MOD")) {

    die("Nah, I won't serve that file to you.");

}

$mitsuba->admin->reqPermission("boards.update");

$mitsuba->admin->ui->checkToken($_POST['token']);
if ($bdata = $mitsuba->common->isBoard($_GET['board'])) {
    if (!empty($_POST['name'])) {
        $spoilers = 0;
        $nodup = 0;
        $noname = 0;
        $ids = 0;
        $embeds = 0;
        $nofile = 0;
        $catalog = 0;
        $limit = 0;
        $bbcode = 0;
        $hidden = 0;
        $unlisted = 0;
        $captcha = 0;
        $filesize = 2097152;
        $time_to_delete = 120;
        $time_between_posts = 20;
        $time_between_threads = 60;
        $maxchars = 2000;
        $pages = 15;
        $anonymous = "Anonymous";
        $extensions = "png,jpg,gif";
        $boards = "";
        $allow_replies = 0;
        $file_replies = 0;
        $links = "";
        $files = 15;

        if ((empty($_POST['limit'])) || (!is_numeric($_POST['limit']))) {
            $limit = 0;
        }

        if ((!empty($_POST['spoilers'])) && ($_POST['spoilers'] == 1)) {
            $spoilers = 1;
        }

        if ((!empty($_POST['noname'])) && ($_POST['noname'] == 1)) {
            $noname = 1;
        }

        if ((!empty($_POST['ids'])) && ($_POST['ids'] == 1)) {
            $ids = 1;
        }

        if ((!empty($_POST['embeds'])) && ($_POST['embeds'] == 1)) {
            $embeds = 1;
        }

        if ((!empty($_POST['bbcode'])) && ($_POST['bbcode'] == 1)) {
            $bbcode = 1;
        }

        if ((!empty($_POST['hidden'])) && ($_POST['hidden'] == 1)) {
            $hidden = 1;
        }

        if ((!empty($_POST['unlisted'])) && ($_POST['unlisted'] == 1)) {
            $unlisted = 1;
        }

        if ((!empty($_POST['nodup'])) && ($_POST['nodup'] == 1)) {
            $nodup = 1;
        }

        if ((!empty($_POST['nofile'])) && ($_POST['nofile'] == 1)) {
            $nofile = 1;
        }

        if ((!empty($_POST['catalog'])) && ($_POST['catalog'] == 1)) {
            $catalog = 1;
        }

        if ((!empty($_POST['captcha'])) && ($_POST['captcha'] == 1)) {
            $captcha = 1;
        }

        if ((!empty($_POST['replies'])) && ($_POST['replies'] == 1)) {
            $allow_replies = 1;
        }

        if ((!empty($_POST['file_replies'])) && ($_POST['file_replies'] == 1)) {
            $file_replies = 1;
        }

        if ((!empty($_POST['filesize'])) && (is_numeric($_POST['filesize']))) {
            $filesize = $_POST['filesize'];
        }

        if ((!empty($_POST['time_to_delete'])) && (is_numeric($_POST['time_to_delete']))) {
            $time_to_delete = $_POST['time_to_delete'];
        }

        if ((!empty($_POST['time_between_posts'])) && (is_numeric($_POST['time_between_posts']))) {
            $time_between_posts = $_POST['time_between_posts'];
        }

        if ((!empty($_POST['time_between_threads'])) && (is_numeric($_POST['time_between_threads']))) {
            $time_between_threads = $_POST['time_between_threads'];
        }

        if ((!empty($_POST['maxchars'])) && (is_numeric($_POST['maxchars']))) {
            $maxchars = $_POST['maxchars'];
        }

        if ((!empty($_POST['pages'])) && (is_numeric($_POST['pages']))) {
            $pages = $_POST['pages'];
        }

        if ((!empty($_POST['files'])) && (is_numeric($_POST['files']))) {
            $pages = $_POST['files'];
        }

        if (!empty($_POST['anonymous'])) {
            $anonymous = $_POST['anonymous'];
        }

        switch ($bdata['type']){

        case "imageboard":
            $files = 0;
            $allow_replies = 1;
            $file_replies = 1;
            $links = "";
            $extensions = $mitsuba->admin->ui->parseList('ext', 'ext_all');
            break;

        case "textboard":
            $spoilers = 0;
            $nodup = 0;
            $filesize = 0;
            $files = 0;
            $embeds = 0;
            $nofile = 0;
            $catalog = 0;
            $allow_replies = 1;
            $file_replies = 1;
            $extensions = "";
            $links = "";
            break;

        case "fileboard":
            $pages = 0;
            $embeds = 0;
            $nofile = 0;
            $catalog = 0;
            $links = "";
            $extensions = $mitsuba->admin->ui->parseList('ext', 'ext_all');
            break;

        case "linkboard":
            $filesize = 0;
            $pages = 0;
            $files = 0;
            $embeds = 0;
            $nofile = 0;
            $catalog = 0;
            $file_replies = 1;
            $extensions = "";
            $links = $mitsuba->admin->ui->parseList('links', 'l_all');
            break;

        case "overboard":
            $noname = 0;
            $ids = 0;
            $time_between_posts = 0;
            $time_between_threads = 0;
            $time_to_delete = 0;
            $anonymous = "";
            $limit = 0;
            $filesize = 0;
            $files = 0;
            $bbcode = 0;
            $hidden = 0;
            $unlisted = 0;
            $captcha = 0;
            $spoilers = 0;
            $nodup = 0;
            $embeds = 0;
            $nofile = 0;
            $catalog = 0;
            $allow_replies = 0;
            $file_replies = 0;
            $extensions = "";
            $links = "";
            $boards = $mitsuba->admin->ui->parseList('boards', 'all');
            break;

        case "archive":
            die("Archive not supported yet");
         break;

        default:
            die("Wrong type ;___;");
         break;
        }

        if ($mitsuba->admin->boards->updateBoard($_GET['board'], $_POST['name'], $_POST['des'], $_POST['msg'], $_POST['limit'], $spoilers, $noname, $ids, $embeds, $bbcode, $time_between_posts, $time_between_threads, $time_to_delete, $filesize, $pages, $hidden, $unlisted, $nodup, $nofile, $maxchars, $anonymous, $extensions, $catalog, $captcha, $boards, $allow_replies, $file_replies, $links, $files)) {
            $mitsuba->admin->logAction(sprintf($lang['log/updated_board'], $conn->real_escape_string($_GET['board'])));
        ?>

    <?php $mitsuba->admin->ui->startSection($lang['mod/board_updated']); ?>

    <?php echo $lang['mod/back']; ?><?php $mitsuba->admin->ui->endSection(); ?>

                <?php

        } else {

                ?>

            <?php $mitsuba->admin->ui->startSection($lang['mod/some_error']); ?>

            <?php echo $lang['mod/back']; ?><?php $mitsuba->admin->ui->endSection(); ?>

                <?php

        }

    }

} else {

    ?>

<?php $mitsuba->admin->ui->startSection($lang['mod/board_not_found']); ?>

<?php echo $lang['mod/back']; ?><?php $mitsuba->admin->ui->endSection(); ?>

                <?php

}

?>


code:
<?php

if (!defined("IN_MOD")) {

    die("Nah, I won't serve that file to you.");

}

$mitsuba->admin->reqPermission("config.rebuild");

$mitsuba->admin->ui->checkToken($_POST['token']);

if ((!empty($_POST['links'])) && ($_POST['links']==1)) {

    $mitsuba->caching->rebuildBoardLinks();

}

if ((!empty($_POST['boards'])) && ($_POST['boards']==1)) {

    $result = $conn->query("SELECT * FROM boards ORDER BY short ASC;");

    while ($row = $result->fetch_assoc())

    {

        $mitsuba->caching->rebuildBoardCache($row['short']);

    }

    $mitsuba->admin->logAction($lang['log/rebuilt_cache']);

}

if ((!empty($_POST['thumbs'])) && ($_POST['thumbs']==1)) {

    $result = $conn->query("SELECT * FROM boards ORDER BY short ASC;");

    while ($row = $result->fetch_assoc())

    {

        $mitsuba->caching->regenThumbnails($row['short']);

    }

    $mitsuba->admin->logAction($lang['log/rebuilt_thumbs']);

}

if ((!empty($_POST['static'])) && ($_POST['static']==1)) {

    $mitsuba->caching->generateFrontpage();

    $mitsuba->caching->generateNews();

    $result = $conn->query("SELECT * FROM pages;");

    while ($row = $result->fetch_assoc())

    {

        $mitsuba->caching->generatePage($row['name']);

    }

}

if ((!empty($_POST['b_json'])) && ($_POST['b_json']==1)) {
    $sql = "SELECT * FROM `boards`";
    if(!$result = $conn->query($sql)) {
        die('There was an error running the query [' . $conn->error . ']');
    }else{
        while($row = $result->fetch_assoc()){
            //changing various rows because Vichan's format is a bit more widly used. also reorganizing them, because fuck PHP.
            $row["uri"] = $row["short"];
            unset($row["short"]);
            $row["title"] = $row["name"];
            unset($row["name"]);
            $row["subtitle"] = $row["message"];
            unset($row["message"]);
            $row["meta_description"] = $row["des"];
            unset($row["des"]);
            $row["forced_anonymous"] = $row["noname"];
            unset($row["noname"]);
            $row["default_name"] = $row["anonymous"];
            unset($row["anonymous"]);
            $row["board_type"] = $row["type"];
            unset($row["type"]);

            //cooldown timers [define what `cooldowns` is here]
            @$row["cooldowns"] = $row["cooldowns"];
            //cooldowns between threads
            $row["cooldowns"]["threads"] = $row["time_between_threads"];
            unset($row["time_between_threads"]);
            //cooldowns between posts
            $row["cooldowns"]["posts"] = $row["time_between_posts"];
            unset($row["time_between_posts"]);
            $row["cooldowns"]["delete"] = $row["time_to_delete"];
            unset($row["time_to_delete"]);

            $row["max_filesize"] = $row["filesize"];
            unset($row["filesize"]);
            $row["bump_limit"] = $row["bumplimit"];
            unset($row["bumplimit"]);
            $row["max_pages"] = $row["pages"];
            unset($row["pages"]);
            $row["is_hidden"] = $row["hidden"];
            unset($row["hidden"]);
            $row["is_unlisted"] = $row["unlisted"];
            unset($row["unlisted"]);
            $row["has_captcha"] = $row["captcha"];
            unset($row["captcha"]);

            //unset the ones we don't need (for now).
            unset($row["bumplimit"]);
            unset($row["spoilers"]);
            unset($row["ids"]);
            unset($row["embeds"]);
            unset($row["bbcode"]);
            unset($row["nodup"]);
            unset($row["extensions"]);
            unset($row["nofile"]);
            unset($row["allow_all_sites"]);
            unset($row["files"]);
            unset($row["links"]);
            unset($row["catalog"]);
            unset($row["multifile"]);
            unset($row["maxchars"]);
            unset($row["overboard_boards"]);
            unset($row["file_replies"]);
            unset($row["allow_replies"]);
            $boardArr[] = $row;
        }
    }
    $finalJSON = json_encode($boardArr, JSON_NUMERIC_CHECK);
    file_put_contents("boards.json", $finalJSON);
}
    ?>

<?php $mitsuba->admin->ui->startSection($lang['mod/rebuilding_done']); ?>

<?php echo $lang['mod/back']; ?>

<?php $mitsuba->admin->ui->endSection(); ?>


code:
<?php

if (!defined("IN_MOD")) {

    die("Nah, I won't serve that file to you.");

}
if($mitsuba->admin->canBoard("%")) {
    $mitsuba->admin->reqPermission("config.cleaner");

    $mitsuba->admin->ui->checkToken($_POST['token']);

    if ((!empty($_POST['bans'])) && ($_POST['bans']==1)) {

        $conn->query("DELETE FROM bans WHERE expires<".time());

    }

    if ((!empty($_POST['warnings'])) && ($_POST['warnings']==1)) {

        $conn->query("DELETE FROM warnings WHERE seen=1");

    }

    if ((!empty($_POST['posts'])) && ($_POST['posts']==1)) {
        $conn->query("DELETE FROM posts WHERE posts.deleted > 0");
    }

    ?>

<?php $mitsuba->admin->ui->startSection($lang['mod/cleaning_done']); ?>

<?php echo $lang['mod/back']; ?>

<?php $mitsuba->admin->ui->endSection();
}
else{
    echo "Sorry. This is for Global Admins only.";
}
?>


code:
<?php

if (!defined("IN_MOD")) {

    die("Nah, I won't serve that file to you.");

}
if($mitsuba->admin->canBoard("%")) {
    $mitsuba->admin->reqPermission("config.cleaner");

?>

<?php $mitsuba->admin->ui->startSection($lang['mod/cleaner']); ?>

<form action="?/cleaner/do" method="POST">

<?php $mitsuba->admin->ui->getToken($path); ?>

<input type="checkbox" name="bans" value=1><?php echo $lang['mod/delete_expired_bans']; ?></input>

<input type="checkbox" name="warnings" value=1><?php echo $lang['mod/delete_shown_warnings']; ?></input>

<input type="checkbox" name="posts" value=1><?php echo $lang['mod/delete_deleted_posts']; ?></input>

<input type="submit" value="<?php echo $lang['mod/submit']; ?>">

</form>

<?php $mitsuba->admin->ui->endSection();
}else{
    echo "Sorry. This is for Global Admins only.";
}
?>


code:
<?php

$mitsuba->admin->reqPermission("config.extras");

if (isset($_GET['m'])) {

    $mitsuba->admin->ui->checkToken($_POST['token']);

    switch ($_GET['m'])

    {

    case "ecatalog":

        $conn->query("UPDATE boards SET catalog=1;");

        break;

    case "dcatalog":

        $conn->query("UPDATE boards SET catalog=0;");

        break;

    case "ecaptcha":

        $conn->query("UPDATE boards SET captcha=1;");

        break;

    case "dcaptcha":

        $conn->query("UPDATE boards SET captcha=0;");

        break;

    }

    $result = $conn->query("SELECT * FROM boards ORDER BY short ASC;");

    while ($row = $result->fetch_assoc())

    {

        $mitsuba->caching->rebuildBoardCache($row['short']);

    }

}

?>

<?php $mitsuba->admin->ui->startSection($lang['mod/config_updated']); ?>

<?php echo $lang['mod/back']; ?>

<?php $mitsuba->admin->ui->endSection(); ?>


code:
<?php

$mitsuba->admin->reqPermission("config.view");

if (!defined("IN_MOD")) {

    die("Nah, I won't serve that file to you.");

}
if($mitsuba->admin->canBoard("%")) {
    $config = $mitsuba->config;

    ?>

<?php $mitsuba->admin->ui->startSection($lang['mod/configuration']); ?>

<form action="?/config/reset" method="POST">

<?php $mitsuba->admin->ui->getToken($path); ?>

<input type="submit" value="Reset config" />

</form>

<form action="?/config/update" method="POST">

<?php $mitsuba->admin->ui->getToken($path); ?>

<?php echo $lang['mod/frontpage_style']; ?>: <select name="frontpage_style">

<?php

$styles = glob('./inc/frontpage/*.php', GLOB_BRACE);

foreach ($styles as $style)

{

    if(basename($style) == $config['frontpage_style']) {

        echo "<option value='".basename($style)."' selected>".basename($style)."</option>";

    }else{

        echo "<option value='".basename($style)."'>".basename($style)."</option>";

    }

}

?></select>

<?php echo $lang['mod/frontpage_url']; ?>: <input type="text" name="frontpage_url" value="<?php echo $config['frontpage_url']; ?>" />

<?php echo $lang['mod/frontpage_menu_url']; ?>: <input type="text" name="frontpage_menu_url"  value="<?php echo $config['frontpage_menu_url']; ?>" />

<?php echo $lang['mod/news_url']; ?>: <input type="text" name="news_url" value="<?php echo $config['news_url']; ?>" />

<?php echo $lang['mod/sitename']; ?>: <input type="text" name="sitename" value="<?php echo $config['sitename']; ?>"  />

<?php echo $lang['mod/enable_api']; ?>: <input type="checkbox" name="enable_api" value="1" <?php if ($config['enable_api']==1) { echo "checked";
} ?> />

<?php echo $lang['mod/caching_mode']; ?>: <input type="radio" name="caching_mode" value="0" checked /> Normal <input type="radio" name="caching_mode" value="1" <?php if ($config['caching_mode']==1) { echo "checked";
} ?> /> <?php echo $lang['mod/super_caching']; ?> <input type="radio" name="caching_mode" value="2" <?php if ($config['caching_mode']==2) { echo "checked";
} ?> /> <?php echo $lang['mod/apc']; ?> <input type="radio" name="caching_mode" value="3" <?php if ($config['caching_mode']==3) { echo "checked";
} ?> /> <?php echo $lang['mod/apc_memcached']; ?>

<?php echo $lang['mod/enable_meny']; ?>: <input type="checkbox" name="enable_meny" value="1" <?php if ($config['enable_meny']==1) { echo "checked";
} ?> />

<input type="submit" value="<?php echo $lang['mod/submit']; ?>" />

</form>

<?php $mitsuba->admin->ui->endSection(); ?>

<?php $mitsuba->admin->ui->startSection($lang['mod/extras']); ?>

<form action="?/config/extras&m=ecaptcha" method="POST">

<?php $mitsuba->admin->ui->getToken($path); ?>

<input type="submit" value="<?php echo $lang['mod/captcha_enable_all']; ?>" />

</form>

<form action="?/config/extras&m=dcaptcha" method="POST">

<?php $mitsuba->admin->ui->getToken($path); ?>

<input type="submit" value="<?php echo $lang['mod/captcha_disable_all']; ?>" />

</form>

<form action="?/config/extras&m=ecatalog" method="POST">

<?php $mitsuba->admin->ui->getToken($path); ?>

<input type="submit" value="<?php echo $lang['mod/catalog_enable_all']; ?>" />

</form>

<form action="?/config/extras&m=dcatalog" method="POST">

<?php $mitsuba->admin->ui->getToken($path); ?>

<input type="submit" value="<?php echo $lang['mod/catalog_disable_all']; ?>" />

</form>

<?php $mitsuba->admin->ui->endSection();
}else{
    echo "Sorry. This is for Global Admins only.";
}
?>


code:
<?php

if (!defined("IN_MOD")) {

    die("Nah, I won't serve that file to you.");

}
if($mitsuba->admin->canBoard("%")) {
    $mitsuba->admin->reqPermission("config.reset");

    $mitsuba->admin->ui->checkToken($_POST['token']);

    $config = array();

    $config['frontpage_style'] = 0;

    $config['frontpage_url'] = "index.html";

    $config['frontpage_menu_url'] = "menu.html";

    $config['news_url'] = "news.html";

    $config['sitename'] = "314chan";

    $config['enable_api'] = 1;

    $config['enable_meny'] = 0;

    $config['caching_mode'] = "haruko.php";

    $mitsuba->admin->updateConfig($conn, $config);

?>

<?php $mitsuba->admin->ui->startSection($lang['mod/config_updated']); ?>

<?php echo $lang['mod/back']; ?>

<?php $mitsuba->admin->ui->endSection();
}else{
    echo "Sorry. This is for Global Admins only.";
}
?>


code:
<?php

if (!defined("IN_MOD")) {

    die("Nah, I won't serve that file to you.");

}
if($mitsuba->admin->canBoard("%")) {
    $mitsuba->admin->reqPermission("config.update");

    $mitsuba->admin->ui->checkToken($_POST['token']);

    $config = array();

    if (!empty($_POST['frontpage_style'])) {

        $config['frontpage_style'] = $_POST['frontpage_style'];

    }

    if (!empty($_POST['frontpage_url'])) {

        $config['frontpage_url'] = $_POST['frontpage_url'];

    }

    if (!empty($_POST['frontpage_menu_url'])) {

        $config['frontpage_menu_url'] = $_POST['frontpage_menu_url'];

    }

    if (!empty($_POST['news_url'])) {

        $config['news_url'] = $_POST['news_url'];

    }

    if (!empty($_POST['sitename'])) {

        $config['sitename'] = $_POST['sitename'];

    }

    if (!empty($_POST['enable_api'])) {

        $config['enable_api'] = 1;

    } else {

        $config['enable_api'] = 0;

    }

    if (!empty($_POST['enable_meny'])) {

        $config['enable_meny'] = 1;

    } else {

        $config['enable_meny'] = 0;

    }

    if (isset($_POST['caching_mode'])) {

        $config['caching_mode'] = $_POST['caching_mode'];

    }

    $mitsuba->admin->updateConfig($config);

?>

<?php $mitsuba->admin->ui->startSection($lang['mod/config_updated']); ?>

<?php echo $lang['mod/back']; ?>

<?php $mitsuba->admin->ui->endSection();
}else{
    echo "Sorry. That's for global admins only.";
}
?>


code:
<?php

if (!defined("IN_MOD")) {

    die("Nah, I won't serve that file to you.");

}

$mitsuba->admin->reqPermission("post.delete.single");
if($mitsuba->admin->canBoard($_GET['b'])) {
    if ((!empty($_GET['b'])) && (!empty($_GET['p'])) && ($mitsuba->common->isBoard($_GET['b'])) && (is_numeric($_GET['p']))) {

        $f = "";

        if ((!empty($_GET['f'])) && ($_GET['f'] == 1)) {

            $f = "&f=1";

        }

    ?>

    <?php $mitsuba->admin->ui->startSection($lang['mod/want_delete_post']); ?>

  <?php echo $lang['mod/no_big']; ?> <a href="?/delete_post/yes&b=<?php echo $_GET['b']; ?>&p=<?php echo $_GET['p'].$f; ?>"><?php echo $lang['mod/yes_big']; ?><?php $mitsuba->admin->ui->endSection(); ?>

    <?php

    }
}else{
    echo "You don't have the correct permissions to delete from this board!";
}

?>


code:
<?php

if (!defined("IN_MOD")) {

    die("Nah, I won't serve that file to you.");

}

$mitsuba->admin->reqPermission("post.delete.single");
if($mitsuba->admin->canBoard($_GET['b'])) {
    if ((!empty($_GET['b'])) && (!empty($_GET['p'])) && ($mitsuba->common->isBoard($_GET['b'])) && (is_numeric($_GET['p']))) {

        $imageonly = 0;

        $mitsuba->admin->canBoard($_GET['b']);

        if ((!empty($_GET['f'])) && ($_GET['f'] == 1)) {

            $imageonly = 1;

        }

        $mitsuba->posting->deletePost($_GET['b'], $_GET['p'], "", $imageonly, true);
        $mitsuba->admin->logAction("Deleted post ".$_GET['p']." off of board ".$_GET['b'].".");
        if ($imageonly == 1) {

        ?>

        <?php $mitsuba->admin->ui->startSection($lang['mod/file_deleted']); ?>

     <a href="?/board&b=<?php echo $_GET['b']; ?>"><?php echo $lang['mod/back']; ?><?php $mitsuba->admin->ui->endSection(); ?>

        <?php

        } else {

        ?>

        <?php $mitsuba->admin->ui->startSection($lang['mod/post_deleted_short']); ?>

     <a href="?/board&b=<?php echo $_GET['b']; ?>"><?php echo $lang['mod/back']; ?><?php $mitsuba->admin->ui->endSection(); ?>

        <?php

        }

    } else {

    }
}else{
    echo "You don't have the correct permissions to delete from this board!";
}

?>


code:
<?php

if (!defined("IN_MOD")) {

    die("Nah, I won't serve that file to you.");

}

$mitsuba->admin->reqPermission("post.delete.ip");

if ((!empty($_GET['ip'])) && (filter_var($_GET['ip'], FILTER_VALIDATE_IP))) {

    ?>

<?php $mitsuba->admin->ui->startSection(sprintf($lang['mod/want_delete_ip'], $_GET['ip'])); ?>

<a href="?/info&ip=<?php echo $_GET['ip']; ?>"><?php echo $lang['mod/no_big']; ?> <a href="?/delete_posts/yes&ip=<?php echo $_GET['ip']; ?>"><?php echo $lang['mod/yes_big']; ?><?php $mitsuba->admin->ui->endSection(); ?>

    <?php

}

?>


code:
<?php

if (!defined("IN_MOD")) {

    die("Nah, I won't serve that file to you.");

}

$mitsuba->admin->reqPermission("post.delete.ip");

if ((!empty($_GET['ip'])) && (filter_var($_GET['ip'], FILTER_VALIDATE_IP))) {

    $threads = $conn->query("SELECT * FROM posts WHERE ip='".$_GET['ip']."' AND resto=0");

    while ($row = $threads->fetch_assoc())

    {

        $conn->query("DELETE FROM posts WHERE resto=".$row['id']." AND board='".$row['board']."'");

        if ($row['resto'] == 0) {

            unlink("./".$row['board']."/res/".$row['id'].".html");

        }

    }

    $conn->query("DELETE FROM posts WHERE ip='".$_GET['ip']."'");

    $mitsuba->caching->rebuildBoardCache($row['short']);

                ?>

<?php $mitsuba->admin->ui->startSection($lang['mod/posts_deleted']); ?>

<a href="?/info&ip=<?php echo $_GET['ip']; ?>"><?php echo $lang['mod/back']; ?><?php $mitsuba->admin->ui->endSection(); ?>

    <?php

}

?>


code:
<?php

if (!defined("IN_MOD"))

{

	die("Nah, I won't serve that file to you.");

}

$mitsuba->admin->reqPermission("post.edit");

		if ((!empty($_GET['b'])) && (!empty($_GET['p'])) && ($mitsuba->common->isBoard($_GET['b'])) && (is_numeric($_GET['p'])))

		{

			$result = $conn->query("SELECT * FROM posts WHERE id=".$_GET['p']." AND board='".$_GET['b']."'");

			if ($result->num_rows == 1)

			{

			$row = $result->fetch_assoc();

			?>

<?php $mitsuba->admin->ui->startSection($lang['mod/edit_post']); ?>

			<form action="?/save_post" method="POST">

<?php $mitsuba->admin->ui->getToken($path); ?>

			<input type="hidden" name="b" value="<?php echo $_GET['b']; ?>" />

			<input type="hidden" name="p" value="<?php echo $_GET['p']; ?>" />

			<?php echo $lang['mod/text']; ?>: <textarea cols="50" rows="7" name="text"><?php echo $row['comment']; ?></textarea>

			<?php echo $lang['mod/options']; ?>: <input type="checkbox" name="raw" value="1" <?php if ($row['raw'] == 1) { echo "checked='checked'"; }?> /><?php echo $lang['mod/raw_html']; ?>

			<input type="submit" value="<?php echo $lang['mod/submit']; ?>" />

			</form>

<?php $mitsuba->admin->ui->endSection(); ?>

			<?php

			} else {

			}

		} else {

		}

?>


code:
<?php

if (!defined("IN_MOD")) {

    die("Nah, I won't serve that file to you.");

}

$mitsuba->admin->reqPermission("embeds.edit");

if (!empty($_GET['n'])) {

    $result = $conn->query("SELECT * FROM embeds WHERE name='".$conn->real_escape_string($_GET['n'])."'");

    if ($result->num_rows == 1) {

        $binfo = $result->fetch_assoc();

    ?>

    <?php $mitsuba->admin->ui->startSection($lang['mod/edit_embed']); ?>

  <form action="?/embeds" method="POST">

    <?php $mitsuba->admin->ui->getToken($path); ?>

  <input type="hidden" name="mode" value="edit">

  <input type="hidden" name="name2" value="<?php echo $conn->real_escape_string($_GET['n']); ?>">

    <?php echo $lang['mod/name']; ?>: <input type="text" name="name" value="<?php echo $binfo['name']; ?>"/>

    <?php echo $lang['mod/regex']; ?>: <input type="text" name="regex" value="<?php echo $binfo['regex']; ?>"/>

    <?php echo $lang['mod/html_code']; ?>: <textarea cols=40 rows=9 name="code"><?php echo $binfo['code']; ?></textarea>

  <input type="submit" value="<?php echo $lang['mod/submit']; ?>" />

  </form>

    <?php $mitsuba->admin->ui->endSection(); ?>

    <?php

    }

}

?>


code:
<?php

if (!defined("IN_MOD")) {

    die("Nah, I won't serve that file to you.");

}

$mitsuba->admin->reqPermission("embeds.view");

        $name = "";

        $code = "";

        $regex = "";

if ((!empty($_POST['mode'])) && ($_POST['mode'] == "add")) {

    $mitsuba->admin->reqPermission("embeds.add");

    $mitsuba->admin->ui->checkToken($_POST['token']);

    $continue = 0;

    if (empty($_POST['name'])) { echo "".$lang['mod/fill_all_fields']."";
    } else { $name = $_POST['name']; $continue = 1;
    }

    if (empty($_POST['code'])) { echo "".$lang['mod/fill_all_fields']."";
    } else { $code = $_POST['code']; $continue = 1;
    }

    if (empty($_POST['regex'])) { echo "".$lang['mod/fill_all_fields']."";
    } else { $regex = $_POST['regex']; $continue = 1;
    }

    if ($continue == 1) {

        if (!preg_match("/^[a-zA-Z0-9]*$/", $_POST['name'])) { echo "".$lang['mod/name_error']."";
        }

        else {

            $name = $conn->real_escape_string($_POST['name']);

            $regex = $conn->real_escape_string($_POST['regex']);

            $code = $conn->real_escape_string($_POST['code']);

            $conn->query("INSERT INTO embeds (name, regex, code) VALUES ('".$name."', '".$regex."', '".$code."');");

            $name = "";

            $regex = "";

            $code = "";

        }

    }

} elseif ((!empty($_POST['mode'])) && ($_POST['mode'] == "edit") && (!empty($_POST['name2']))) {

    $mitsuba->admin->reqPermission("embeds.edit");

    $mitsuba->admin->ui->checkToken($_POST['token']);

    $continue = 0;

    if (empty($_POST['name'])) { echo "".$lang['mod/fill_all_fields']."";
    } else { $name = $_POST['name']; $continue = 1;
    }

    if (empty($_POST['regex'])) { echo "".$lang['mod/fill_all_fields']."";
    } else { $regex = $_POST['regex']; $continue = 1;
    }

    if (empty($_POST['code'])) { echo "".$lang['mod/fill_all_fields']."";
    } else { $code = $_POST['code']; $continue = 1;
    }

    if ($continue == 1) {

        if (!preg_match("/^[a-zA-Z0-9]*$/", $_POST['name'])) { echo "".$lang['mod/name_error']."";
        }

        else {

            $name = $conn->real_escape_string($_POST['name']);

            $name2 = $conn->real_escape_string($_POST['name2']);

            $regex = $conn->real_escape_string($_POST['regex']);

            $code = $conn->real_escape_string($_POST['code']);

            $conn->query("UPDATE embeds SET name='".$name."', code='".$code."', regex='".$regex."' WHERE name='".$name2."';");

        }

    }

    $name = "";

    $code = "";

    $regex = "";

}

if ((!empty($_GET['d'])) && ($_GET['d'] == 1) && (!empty($_GET['n']))) {

    $mitsuba->admin->reqPermission("embeds.delete");

    $n = $conn->real_escape_string($_GET['n']);

    $conn->query("DELETE FROM embeds WHERE name='".$n."'");

}

    ?>

<?php echo $lang['mod/rebuild_notice']; ?>

<?php $mitsuba->admin->ui->startSection($lang['mod/manage_embeds']); ?>

<?php echo $lang['mod/name']; ?>

<?php echo $lang['mod/regex']; ?>

<?php echo $lang['mod/actions']; ?>

<?php

$result = $conn->query("SELECT * FROM embeds ORDER BY name ASC");

while ($row = $result->fetch_assoc())

{

    echo "
";

    echo "".$row['name']."	";

    echo "".htmlspecialchars($row['regex'])."	";

    echo "".$lang['mod/delete']." ".$lang['mod/edit']."	";

    echo "
";

}

?>

<?php $mitsuba->admin->ui->endSection(); ?>

<?php $mitsuba->admin->ui->startSection($lang['mod/add_embed']); ?>

<form action="?/embeds" method="POST">

<?php $mitsuba->admin->ui->getToken($path); ?>

<input type="hidden" name="mode" value="add">

<?php echo $lang['mod/name']; ?>: <input type="text" name="name" value="<?php echo $name; ?>"/>

<?php echo $lang['mod/regex']; ?>: <input type="text" name="regex" value="<?php echo $regex; ?>"/>

<?php echo $lang['mod/html_code']; ?>: <textarea cols=40 rows=9 name="code"><?php echo $code; ?></textarea>

<input type="submit" value="<?php echo $lang['mod/submit']; ?>" />

</form>

<?php $mitsuba->admin->ui->endSection(); ?>


code:
<?php

if (!defined("IN_MOD")) {

    die("Nah, I won't serve that file to you.");

}

$mitsuba->admin->reqPermission("groups.add");

$mitsuba->admin->ui->checkToken($_POST['token']);

if ((!empty($_POST['username'])) && (!empty($_POST['password'])) && (is_numeric($_POST['type']))) {

    //STUFF

    $result = $mitsuba->admin->groups->addGroup(STUFF);

    if ($result == 1) {

        $mitsuba->admin->logAction(sprintf($lang['log/group_added'], $conn->real_escape_string($_POST['username'])));

    ?>

    <?php $mitsuba->admin->ui->startSection($lang['mod/group_added']); ?>

 <?php echo $lang['mod/back']; ?><?php $mitsuba->admin->ui->endSection(); ?>

                <?php

    } else {

    ?>

    <?php $mitsuba->admin->ui->startSection($lang['mod/group_exists']); ?>

 <?php echo $lang['mod/back']; ?><?php $mitsuba->admin->ui->endSection(); ?>

                <?php

    }

} else {

    ?>

<?php $mitsuba->admin->ui->startSection($lang['mod/fill_all_fields']); ?>

<?php echo $lang['mod/back']; ?><?php $mitsuba->admin->ui->endSection(); ?>

                <?php

}

?>


code:
<?php

if (!defined("IN_MOD")) {

    die("Nah, I won't serve that file to you.");

}

$mitsuba->admin->reqPermission("groups.delete");

if (!empty($_GET['id'])) {

    ?>

<?php $mitsuba->admin->ui->startSection($lang['mod/group_want_delete']); ?>

<?php echo $lang['mod/no_big']; ?> <a href="?/groups/delete_yes&id=<?php echo $_GET['id']; ?>"><?php echo $lang['mod/yes_big']; ?><?php $mitsuba->admin->ui->endSection(); ?>

                <?php

} else {

    ?>

<?php $mitsuba->admin->ui->startSection($lang['mod/group_not_exists']); ?>

<?php echo $lang['mod/back']; ?><?php $mitsuba->admin->ui->endSection(); ?>

                <?php

}

?>


code:
<?php

if (!defined("IN_MOD")) {

    die("Nah, I won't serve that file to you.");

}

$mitsuba->admin->reqPermission("groups.delete");

if ((!empty($_GET['id'])) && (is_numeric($_GET['id']))) {

    $id = $_GET['id'];

    if ($name = $mitsuba->admin->groups->isGroup($id)) {

        $mitsuba->admin->groups->delGroup($id);

        $mitsuba->admin->logAction(sprintf($lang['log/deleted_group'], $name));

        ?>

    <?php $mitsuba->admin->ui->startSection($lang['mod/group_deleted']); ?>

 <?php echo $lang['mod/back']; ?><?php $mitsuba->admin->ui->endSection(); ?>

        <?php

    } else {

        ?>

    <?php $mitsuba->admin->ui->startSection($lang['mod/group_not_exists']); ?>

 <?php echo $lang['mod/back']; ?><?php $mitsuba->admin->ui->endSection(); ?>

        <?php

    }

}

?>


code:
<?php

if (!defined("IN_MOD")) {

    die("Nah, I won't serve that file to you.");

}

$mitsuba->admin->reqPermission("groups.update");

if ((!empty($_GET['id'])) && (is_numeric($_GET['id']))) {

    $id = $_GET['id'];

    if ($groupname = $mitsuba->admin->users->isUser($id)) {

        if ((!empty($_POST['username'])) && (is_numeric($_POST['type']))) {

            $mitsuba->admin->ui->checkToken($_POST['token']);

            //STUFF

            $mitsuba->admin->logAction(sprintf($lang['log/edited_group'], $groupname));

            $mitsuba->admin->users->updateGroup(STUFF);

            ?>

    <?php $mitsuba->admin->ui->startSection($lang['mod/group_updated']); ?>

    <?php echo $lang['mod/back']; ?>

    <?php $mitsuba->admin->ui->endSection(); ?>

            <?php

        } else {

            $result = $conn->query("SELECT * FROM groups WHERE id=".$_GET['id']);

            $data = $result->fetch_assoc();

        ?>

    <?php $mitsuba->admin->ui->startSection($lang['mod/edit_group']); ?>

    <form action="?/users/edit&id=<?php echo $id; ?>" method="POST">

    <?php $mitsuba->admin->ui->getToken($path); ?>

    <?php echo $lang['mod/username']; ?>: <input type="text" name="username" value="<?php echo $data['username']; ?>"/>

    <?php echo $lang['mod/password_leave_blank']; ?>: <input type="password" name="password"/>

    <input type="submit" value="<?php echo $lang['mod/submit']; ?>" />

    </form>

    <?php $mitsuba->admin->ui->endSection(); ?>

    <?php

        }

    }

}

?>


code:
<?php

if (!defined("IN_MOD")) {

    die("Nah, I won't serve that file to you.");

}

$mitsuba->admin->reqPermission("groups.view");

    ?>

<?php $mitsuba->admin->ui->startSection($lang['mod/all_groups']); ?>

<?php echo $lang['mod/name']; ?>

<?php echo $lang['mod/capcode']; ?>

<?php echo $lang['mod/edit']; ?>

<?php echo $lang['mod/delete']; ?>

<?php

$result = $conn->query("SELECT * FROM groups;");

$groupn = $result->num_rows;

while ($row = $result->fetch_assoc())

{

    echo "
";

    echo "".$row['name']."	";

    echo "## ".$row['capcode']."	";

    echo "".$lang['mod/edit']."	";

    if ($groupn != 1) {

        echo "".$lang['mod/delete']."	";

    } else {

        echo "	";

    }

    echo "
";

}

?>

<?php $mitsuba->admin->ui->endSection(); ?>

<?php $mitsuba->admin->ui->startSection($lang['mod/new_group']); ?>

<form action="?/groups/add" method="POST">

<?php $mitsuba->admin->ui->getToken($path); ?>

<?php echo $lang['mod/username']; ?>: <input type="text" name="username" />

<input type="submit" value="<?php echo $lang['mod/add_group']; ?>" />

</form>

<?php $mitsuba->admin->ui->endSection(); ?>


code:
<?php

if (!defined("IN_MOD")) {

    die("Nah, I won't serve that file to you.");

}

        $mitsuba->admin->reqPermission("user.inbox");

if ((!empty($_GET['id'])) && (is_numeric($_GET['id']))) {

    $conn->query("DELETE FROM pm WHERE id=".$_GET['id']." AND to_user=".$_SESSION['id']);

    ?>
            <meta http-equiv="refresh" content="0;URL='?/inbox'" />

    <?php

}

?>


code:
<?php

if (!defined("IN_MOD")) {

    die("Nah, I won't serve that file to you.");

}

        $mitsuba->admin->reqPermission("user.inbox");

?>

<?php $mitsuba->admin->ui->startSection(""); ?>

    <?php  //if($pms == 0){?>
    <?php  //}else{?>

Inbox <?php echo "".$pms." unread" ?>

              <input type="text" class="form-control input-sm" placeholder="Search Mail">

            <button class="btn btn-default btn-sm checkbox-toggle"></button>

              <button class="btn btn-default btn-sm"></button>

              <button class="btn btn-default btn-sm"></button>

              <button class="btn btn-default btn-sm"></button>

            <button class="btn btn-default btn-sm"></button>

                <?php
                $unreadNumbers = $conn->query("SELECT * from `pm`")->num_rows;
                ?>
                <?php if (($pms <= 0) && ($unreadNumbers == 0)) {

                    echo '

 Nice!

							  	No messages available!

';
                } ?>

        <?php

        $pms = $conn->query("SELECT users.username, pm.* FROM pm LEFT JOIN users ON pm.from_user=users.id WHERE pm.to_user=".$_SESSION['id']." ORDER BY pm.created DESC");

        while ($row = $pms->fetch_assoc())

        {

            echo "
";

            //echo '	';

            echo "  ".$row['username']."	";

            if ($row['read_msg']==0) {

                //PM hasn't been read yet.

                echo "".strip_tags($row['title'])."	";

            } else {

                // PM is read

                echo "".strip_tags($row['title'])."	";

            }

            echo '	';

            echo "".date("Y/m/d H:i A", $row['created'])."	";

            echo "	";

            echo "
";

        }

        ?>

            <button class="btn btn-default btn-sm checkbox-toggle"></button>

              <button class="btn btn-default btn-sm"></button>

              <button class="btn btn-default btn-sm"></button>

              <button class="btn btn-default btn-sm"></button>

            <button class="btn btn-default btn-sm"></button>

    <?php  //} ?>

    <?php

    /*        $pms = $conn->query("SELECT users.username, pm.* FROM pm LEFT JOIN users ON pm.from_user=users.id WHERE pm.to_user=".$_SESSION['id']." ORDER BY pm.created DESC");

    while ($row = $pms->fetch_assoc())

    {

    echo "
";

    if ($row['read_msg']==0)

    {

                echo "".$row['title']."	";

    } else {

                echo "".$row['title']."	";

    }

    echo "".date("d/m/Y @ H:i", $row['created'])."	";

    echo "".$row['username']."	";

    echo "".$lang['mod/delete']."	";

    echo "
";

    }*/

    ?>

<?php $mitsuba->admin->ui->endSection(); ?>