• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

[GESIOR AAC] Improved Group Manager

Skynox

Authorized Bartender
Joined
Jun 16, 2007
Messages
24
Reaction score
0
Location
Stockholm, Sweden
I've improved the group manager so that you can execute
following commands. It's highly recommended to update from the old version http://otland.net/f118/gesior-aac-0-3-6-group-manager-66303/.
And it's a very good script if you combine with my
http://otland.net/f118/gesior-aac-0-3-6-group-based-admin-panel-65068/

Features:

Tutor Manager
* Promote character
* Demote character

Gamemaster Manager
* Create gamemaster
* Delete gamemaster/character
open index.php and find.
Code:
case "adminpanel":
        $topic = "Administration Panel";
        $subtopic = "adminpanel";
        include("adminpanel.php");
    break;
add this under it.
Code:
case "teammanager":
        $topic = "Team Manager";
        $subtopic = "teammanager";
        include("teammanager.php");
    break;
open layout.php and find
Code:
if($group_id_of_acc_logged >= $config['site']['access_admin_panel'])
Within the administration panel and this link
Code:
<a href="index.php?subtopic=teammanager"><font color="white"><b>Group Manager</b></font></a><br>
Now open your notepad and paste this code in.
Name it teammanager.php and save it into your root folder
PHP:
    <?PHP
   //TEAM MANAGER - CONFIGURATION//
   
   
   ### TUTOR CONFIG ###
   $web_access_t = "0"; // Put the page access for tutors here. Set to 0 by default.
   $group_access_t = "2"; // Put the group_id for tutors here. Set to 2 by default.
   
   ### SENIOR TUTOR CONFIG ###
   $web_access_st = "0"; // Put the page access for senior tutors here. Set to 0 by default.
   $group_access_st = "3"; // Put the group_id for senior tutors here. Set to 3 by default.
   
   ### GAMEMASTER CONFIG ###
   $web_access_gm = "3"; // Put the page access for gamemasters here. Set to 3 by default.
   $group_access_gm = "4"; // Put the group_id for gamemasters here. Set to 4 by default.  
   
   $name_prefix_gm = "GM"; // Writes GM infront of name. 
   
   
   //END OF CONFIGURATION - DONT EDIT BELOW//
   
   

if($group_id_of_acc_logged >= $config['site']['access_admin_panel']) {
if((empty($action))) {
    $main_content .= '<center><h2><img src="'.$layout_name.'/images/content/headline-bracer-left.gif" /> GROUP MANAGER <img src="'.$layout_name.'/images/content/headline-bracer-right.gif" /></h2><br><br>
    <center><a href="?subtopic=teammanager&action=update">TUTOR MANAGER</a><br><br>
    <a href="?subtopic=teammanager&action=creategamemaster">GAMEMASTER MANAGER</a><br><br>
    <a href="?subtopic=teammanager&action=deletegamemaster">DELETE CHARACTER</a><br><br><br></center>';
    
    }
    
//GROUP MANAGER
if($action == "update") {
    $player = stripslashes(ucwords(strtolower(trim($_REQUEST['character']))));
    $t_access = $_POST['tutor'];
    $st_access = $_POST['stutor'];
    $demote = $_POST['demote'];
    if(empty($player)) {
        $main_content .= '<center><h2><img src="'.$layout_name.'/images/content/headline-bracer-left.gif" /> PROMOTE / DEMOTE <img src="'.$layout_name.'/images/content/headline-bracer-right.gif" /></h2>
<form action="" method="post">

<B>Character Name:</B><br><input type="textbox" name="character">
<br><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input name="tutor" type="radio" />Tutor&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br>
&nbsp;&nbsp;&nbsp;&nbsp;<input name="stutor" type="radio" />Senior Tutor<br><br>
<input name="demote" type="radio" />Demote<br>
<br>
<input type="submit" value="Update">
        </form></center><form action="?subtopic=teammanager" method="post" ></form></center>';
    }
    elseif (isset($_POST['demote'])) {
        $player_data = $SQL->query("SELECT * FROM `players` WHERE `name` = '".$player."';")->fetch();
           $SQL->query("UPDATE `accounts` SET `page_access` = '0' WHERE `id` = '".$player_data['account_id']."'");
        $SQL->query("UPDATE `players` SET `group_id` = '1' WHERE `name` = '".$player_data['name']."'");
        
        $main_content .= '<b><center><i>'.$player.'</i> was demoted.<br></b></center>
        <br>
        <form action="?subtopic=teammanager" method="post" ></form>';
         }
         elseif (isset($_POST['stutor'])) {
        $player_data = $SQL->query("SELECT * FROM `players` WHERE `name` = '".$player."';")->fetch();
        $SQL->query("UPDATE `accounts` SET `page_access` = '".$web_access_st."' WHERE `id` = '".$player_data['account_id']."'");
        $SQL->query("UPDATE `players` SET `group_id` = '".$group_access_st."' WHERE `name` = '".$player_data['name']."'");
        
        $main_content .= '<b><center><i>'.$player.'</i> was promoted to Senior Tutor (Group ID: '.$group_access_st.') with page access '.$web_access_st.'.</b></center>
        <br>
        <form action="?subtopic=teammanager" method="post" ></form>';
        }
        elseif (isset($_POST['tutor'])) {
        $player_data = $SQL->query("SELECT * FROM `players` WHERE `name` = '".$player."';")->fetch();
        $SQL->query("UPDATE `accounts` SET `page_access` = '".$web_access_t."' WHERE `id` = '".$player_data['account_id']."'");
        $SQL->query("UPDATE `players` SET `group_id` = '".$group_access_t."' WHERE `name` = '".$player_data['name']."'");         

        $main_content .= '<b><center><i>'.$player.'</i> was promoted to Tutor (Group ID: '.$group_access_t.') with page access '.$web_access_t.'.</b><br> </center>
        <br>
        <form action="?subtopic=teammanager" method="post" ></form>';
        }
    }
}
else
{
$main_content .= 'Sorry, you have not the rights to access this page.';
}

//CREATE GAMEMASTER
if($group_id_of_acc_logged >= $config['site']['access_admin_panel']) {
if($action == "creategamemaster") {
$player = stripslashes(ucwords(strtolower(trim($_REQUEST['character']))));
    $player_exist = $_POST['character'];
    $gm_name = $_POST['gm_name'];
    if(empty($player)) {
        $main_content .= '<center><h2><img src="'.$layout_name.'/images/content/headline-bracer-left.gif" /> CREATE GAMEMASTER <img src="'.$layout_name.'/images/content/headline-bracer-right.gif" /></h2><br><br>
        <form action="" method="post">
        
<B>Character Name:</B><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type="textbox" name="character">&nbsp;&nbsp;<img src="images/info.png" alt="Guidelines" title="Enter name of character that will recive the gamemaster." />
<br><br>
<B>Gamemaster Name:</B><br>&nbsp;&nbsp;&nbsp;&nbsp;<input type="textbox" name="gm_name">
<br><br>
<input type="submit" value="Create">
        </form></center><form action="?subtopic=teammanager" method="post" ></form></center>';
    }
    else
    {
        $player_data = $SQL->query("SELECT * FROM `players` WHERE `name` = '".$player."';")->fetch();
           $SQL->query('INSERT INTO players (name, group_id, account_id, sex, vocation, experience, level, maglevel, health, healthmax, mana, manamax, manaspent, soul, direction, lookbody, lookfeet, lookhead, looklegs, looktype, lookaddons, posx, posy, posz, cap, lastlogin, lastip, save, conditions, skulltime, skull, guildnick, rank_id, town_id, loss_experience, loss_mana, loss_skills, lastlogout, blessings, premend, online, comment, created, hide_char, nick_verify) VALUES ("GM '.$gm_name.'", 4, '.$player_data['account_id'].', 1, 0, 0, 2, 0, 185, 185, 35, 35, 0, 100,"", 44, 44, 44, 44, 75, 0, 0, 0, 0, 420, "", "", 1,"","","","","","1","","","","","","","","",'.time().',1,1)');
        $SQL->query("UPDATE `accounts` SET `page_access` = '".$web_access_gm."' WHERE `id` = '".$player_data['account_id']."'");
        
        $main_content .= '<b><center><i>GM '.$gm_name.' was created.<br>Gamemaster belongs to '.$player_exist.'.<br><br></b></center>
        <br>
        <form action="?subtopic=teammanager" method="post" ></form>';
        }
    }
}
else
{
$main_content .= 'Sorry, you have not the rights to access this page.';
}

//DELETE GAMEMASTER
if($group_id_of_acc_logged >= $config['site']['access_admin_panel']) {
if($action == "deletegamemaster") {
$player = stripslashes(ucwords(strtolower(trim($_REQUEST['character']))));
    $player = $_POST['character'];
    if(empty($player)) {
        $main_content .= '<center><h2><img src="'.$layout_name.'/images/content/headline-bracer-left.gif" /> DELETE CHARACTER <img src="'.$layout_name.'/images/content/headline-bracer-right.gif" /></h2><br><br>
        <form action="" method="post">
        
<B>Character Name:</B><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type="textbox" name="character">&nbsp;&nbsp;<img src="images/info.png" alt="Guidelines" title="Enter name of character to delete." />
<br><br>
<input type="submit" value="Delete">
        </form></center><form action="?subtopic=teammanager" method="post" ></form></center>';
    }
    else
    {
        $player_data = $SQL->query("SELECT * FROM `players` WHERE `name` = '".$player."';")->fetch();
           $SQL->query("UPDATE `accounts` SET `page_access` = '0' WHERE `id` = '".$player_data['account_id']."'");
        $SQL->query("DELETE FROM `players` WHERE name = '".$player."'");
        
        $main_content .= '<b><center><i>'.$player.' was deleted.<br><br></b></center>
        <br>
        <form action="?subtopic=teammanager" method="post" ></form>';
        }
    }
}
else
{
$main_content .= 'Sorry, you have not the rights to access this page.';
}        
?>

attachment.php


To create a gamemaster type a name the character in the first text input that will be given the gamemaster, it will assign the gamemaster to that players account.
And in the other text input type the gamemaster name without GM infront of it, it will automatically type that before the name.

I've attached a tiny icon named info.png that you have to save and put inside the image folder.

Please make some comments about the script and rep if you like it.

Kind regards,
Skynox
 

Attachments

Back
Top