function load_groupcp()
{
    global $mybb, $db, $cache, $templates, $title, $header, $headerinclude, $footer, $theme, $group;
    if ($mybb->settings['rpgsuite_groupmanagecp'] && $mybb->input['action'] == "managegroup") {
        // Get group id
        if ($mybb->input['gid'] && $mybb->usergroup['issupermod']) {
            $gid = intval($mybb->input['gid']);
            $groupnav = '&gid=' . $gid;
        } else {
            $gid = $mybb->user['displaygroup'];
            $groupnav = '';
        }
        $cpcontent = "";
        if ($mybb->settings['rpgsuite_groupranks_custom']) {
            $customranklink = '<a href="modcp.php?action=managegroup&section=customranks' . $groupnav . '">Manage Custom Ranks</a>';
        } else {
            $customranklink = '';
        }
        $usergroup = new UserGroup($mybb, $db, $cache);
        if ($usergroup->initialize($gid)) {
            $group = $usergroup->get_info();
            if (handle_form($usergroup)) {
                $url = "modcp.php?action=managegroup&gid=" . $gid;
                if ($mybb->input['section']) {
                    $url .= "&section=" . $mybb->input['section'];
                }
                redirect($url, "Your pack settings were successfully updated.");
            }
            if ($mybb->input['section'] == 'groupoptions') {
                $title = 'Manage Options';
                add_breadcrumb('Manage Options');
                $cpcontent = load_groupmod_options($usergroup);
            } else {
                if ($mybb->input['section'] == 'groupmembers') {
                    $title = 'Manage Members';
                    add_breadcrumb('Manage Members');
                    $cpcontent = load_groupmod_members($usergroup);
                } else {
                    if ($mybb->input['section'] == 'customranks' && $mybb->settings['rpgsuite_groupranks_custom']) {
                        $ttile = 'Manage Custom Ranks';
                        add_breadcrumb('Manage Custom Ranks');
                        $cpcontent = load_groupmod_customranks($usergroup);
                    } else {
                        $title = 'Manage Ranks';
                        add_breadcrumb('Manage Ranks');
                        $cpcontent = load_groupmod_ranks($usergroup);
                    }
                }
            }
            // Add group styling
            eval("\$headerinclude .= \"" . $templates->get('rpgmisc_groupstyle') . "\";");
        } else {
            $cpcontent = "Invalid Group";
        }
        eval("\$groupmanagecp = \"" . $templates->get('rpggroupmanagecp_full') . "\";");
        output_page($groupmanagecp);
        exit;
    }
}
Exemple #2
0
function rankview_bit($gid)
{
    global $db, $mybb, $cache;
    $usergroup = new UserGroup($mybb, $db, $cache);
    if ($usergroup->initialize($gid)) {
        $group = $usergroup->get_info();
        if ($group['hasranks']) {
            return "Viewing <a href='index.php?action=showranks&gid=" . $gid . "'>" . $group['title'] . " Ranks</a>";
        } else {
            return "Viewing <a href='index.php?action=showranks&gid=" . $gid . "'>" . $group['title'] . " Members</a>";
        }
    } else {
        return "Viewing <a href='index.php?action=showranks'>Group Members</a>";
    }
}
Exemple #3
0
function viewranks_init()
{
    global $mybb, $db, $cache, $templates, $header, $footer, $headerinclude, $title, $theme, $parser;
    if ($mybb->settings['rpgsuite_groupranks'] && $mybb->input['action'] == "showranks") {
        // Get group id
        if ($mybb->input['gid'] != '') {
            $gid = intval($mybb->input['gid']);
        } else {
            $gid = $mybb->user['displaygroup'];
        }
        $usergroup = new UserGroup($mybb, $db, $cache);
        if ($usergroup->initialize($gid)) {
            $group = $usergroup->get_info();
            // Add Group Styling
            eval("\$headerinclude .= \"" . $templates->get('rpgmisc_groupstyle') . "\";");
            if ($group['hasranks']) {
                $title = $group['title'] . " Ranks";
                if ($group['fid']) {
                    add_breadcrumb($group['title'] . ' Forum', 'forumdisplay.php?fid=' . (int) $group['fid']);
                }
                add_breadcrumb($group['title'] . ' Ranks');
                $tierlist = build_ranks($usergroup);
                $unrankedlist = build_unranked($usergroup);
                eval("\$rankpage = \"" . $templates->get('rpggroupview_ranks_full') . "\";");
                output_page($rankpage);
            } else {
                $title = $group['title'] . " Members";
                if ($group['fid']) {
                    add_breadcrumb($group['title'] . ' Forum', 'forumdisplay.php?fid=' . (int) $group['fid']);
                }
                add_breadcrumb($group['title'] . ' Members');
                // set up the pager
                $multipage = setup_viewgroup_pages($group['gid'], $usergroup->get_member_count(), $start);
                $memberlist = build_members($usergroup, $start);
                eval("\$memberpage = \"" . $templates->get('rpggroupview_noranks_full') . "\";");
                output_page($memberpage);
            }
            exit;
        }
    }
}
Exemple #4
0
<?php

// Disallow direct access to this file for security reasons
if (!defined("IN_MYBB")) {
    die("Direct initialization of this file is not allowed.<br /><br />Please make sure IN_MYBB is defined.");
}
require_once MYBB_ROOT . "/inc/plugins/rpg_suite/models/class_UserGroup.php";
require_once MYBB_ROOT . "/inc/plugins/rpg_suite/models/class_RPGSuite.php";
$plugins->run_hooks("admin_rpgsuite_group_begin");
$page->add_breadcrumb_item('Manage Packs', 'index.php?module=rpgsuite-groups');
// Ensure we have a valid group id
$usergroup = new UserGroup($mybb, $db, $cache);
if ($usergroup->initialize((int) $mybb->input['gid'])) {
    $group = $usergroup->get_info();
    $page->add_breadcrumb_item('Pack: ' . $group['title']);
    // Play with group settings! :)
    $sub_tabs['settings'] = array('title' => "Settings", 'link' => "index.php?module=rpgsuite-group&amp;action=settings&amp;gid=" . $group['gid'], 'description' => 'Group settings');
    $sub_tabs['members'] = array('title' => "Manage Pack Members", 'link' => "index.php?module=rpgsuite-group&amp;action=members&amp;gid=" . $group['gid'], 'description' => "The group's current members");
    $sub_tabs['ranks'] = array('title' => "Custom Ranks", 'link' => "index.php?module=rpgsuite-group&amp;action=ranks&amp;gid=" . $group['gid'], 'description' => "The group's custom ranks (can be set even if disallowed, only by admin)");
    $sub_tabs['disband'] = array('title' => "Disband Pack", 'link' => "index.php?module=rpgsuite-group&amp;action=disband&amp;gid=" . $group['gid'], 'description' => "Disband this group");
    $sub_tabs['relocate'] = array('title' => "Relocate Pack", 'link' => "index.php?module=rpgsuite-group&amp;action=relocate&amp;gid=" . $group['gid'], 'description' => "Relocate to another territory.");
    // define this variable so our forms get updated
    $ranktable = $usergroup->get_ranks(1);
    // FIRST let's handle any submits....
    if ($mybb->request_method == "post") {
        if ($mybb->input['action'] == 'relocate') {
            $settings = array('title' => $db->escape_string($mybb->input['title']), 'region' => $db->escape_string($mybb->input['region']), 'prefix' => $db->escape_string($mybb->input['prefix']));
            $usergroup->relocate($settings);
            flash_message("Group Relocated", "success");
            admin_redirect("index.php?module=rpgsuite-group&action=settings&gid=" . $group['gid']);
        } else {