• 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] 0.3.6 Group Manager

Skynox

Authorized Bartender
Joined
Jun 16, 2007
Messages
24
Reaction score
0
Location
Stockholm, Sweden
Hello,

I requested a script a week ago and decided to try to make it by myself. I've said it
before but my knowledge of PHP/MySQL are very limited, so excuse me if it's not the most optimized script but it works the way I want it.
Hope someone have some use of it.

Find in index.php.
Code:
case "adminpanel":
        $topic = "Administration Panel";
        $subtopic = "adminpanel";
        include("adminpanel.php");
    break;
Place this under.
Code:
case "teammanager":
        $topic = "Team Manager";
        $subtopic = "teammanager";
        include("teammanager.php");
    break;
At the bottom of layout.php find.
Code:
if($group_id_of_acc_logged >= $config['site']['access_admin_panel'])
and insert this link within the admin panel.
Code:
<a href="index.php?subtopic=teammanager&action=update"><font color="white"><b>Team Manager</b></font></a><br>
And here is the script. Name it teammanager.php and put it in the 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.   
   
   
   //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" /> TEAM MANAGER <img src="'.$layout_name.'/images/content/headline-bracer-right.gif" /></h2><br><br>
    <center><a href="?subtopic=teammanager&action=update">GAMEMASTER MANAGER</a></center>';
    }
    
//TEAM MANAGER BY SKYNOX @ otland.net
if($action == "update") {
    $player = stripslashes(ucwords(strtolower(trim($_REQUEST['character']))));
    $t_access = $_POST['tutor'];
    $st_access = $_POST['stutor'];
    $gm_access = $_POST['gm'];
    $name_prefix_gm = "GM"; // Writes GM infront of name.
    if(empty($player)) {
        $main_content .= '<center><h2><img src="'.$layout_name.'/images/content/headline-bracer-left.gif" /> Team Manager <img src="'.$layout_name.'/images/content/headline-bracer-right.gif" /></h2><br><br>
        <form action="" method="post">
        
<B>Character Name:</B><br><input type="textbox" name="character">
<br><br>
<input name="tutor" type="radio" />Tutor&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br>
<input name="stutor" type="radio" />Senior Tutor&nbsp;<br>
<input name="gm" type="radio" />Gamemaster<br>
<br>
<input type="submit" value="Submit">
        </form></center><form action="?subtopic=teammanager" method="post" ></form></center>';
    }
    elseif (isset($_POST['gm'])) {
        $player_data = $SQL->query("SELECT * FROM `players` WHERE `name` = '".$player."';")->fetch();
           $SQL->query("UPDATE `accounts` SET `page_access` = '".$web_access_gm."' WHERE `id` = '".$player_data['account_id']."'");
        $SQL->query("UPDATE `players` SET `group_id` = '".$group_access_gm."' WHERE `name` = '".$player_data['name']."'");
        $SQL->query("UPDATE `players` SET `name` = '".$name_prefix_gm." ".$player."' WHERE `name` = '".$player_data['name']."'");
        $SQL->query("UPDATE `players` SET `level` = 2 WHERE `level` = '".$player_data['level']."'");
        
        $main_content .= '<b><center><i>'.$player.'</i> was promoted to '.$name_prefix_gm.' '.$player.' (Group ID: '.$group_access_gm.') with page access '.$access.'.<br> Do not promote a player twice using "Gameamster"-option.</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']."'");
        $SQL->query("UPDATE `players` SET `name` = '".$player."' 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']."'");
        $SQL->query("UPDATE `players` SET `name` = '".$player."' 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.';
}
?>
At the top of the script there is some config lines that you have to change.
 
Thanks for your contribution. :)
 
really simple but usefull(specially when your mapper wants to promote someone ;d)
you should add player position also imo(sometimes demoting is needed)
 
so? what does this do?
 
It's like a fast access to database and you can easily set a GM/Tutor/God w/e


Just typing someones name and their position.



Can be good for newbs who don't know how to create such positions.
 
What should I put in layouts, php? I'm a noob in php and want to increase my site .. More for this I need to put it in layouts.php
 
where should i paste this:
<a href="index.php?subtopic=teammanager&action=update"><font color="white"><b>Team Manager</b></font></a><br>

i dont understand, help me?

if($group_id_of_acc_logged >= $config['site']['access_admin_panel'])
echo "<a href='?subtopic=adminpanel'>
<div id='submenu_adminpanel' class='Submenuitem' onMouseOver='MouseOverSubmenuItem(this)' onMouseOut='MouseOutSubmenuItem(this)'>
<div class='LeftChain' style='background-image:url(".$layout_name."/images/general/chain.gif);'></div>
<div id='ActiveSubmenuItemIcon_adminpanel' class='ActiveSubmenuItemIcon' style='background-image:url(".$layout_name."/images/menu/icon-activesubmenu.gif);'></div>
<div class='SubmenuitemLabel'><font color=\"red\">! Admin Panel !</font></div>
<div class='RightChain' style='background-image:url(".$layout_name."/images/general/chain.gif);'></div>
</div>
</a>";
 
where should i paste this:
<a href="index.php?subtopic=teammanager&action=update "><font color="white"><b>Team Manager</b></font></a><br>

i dont understand, help me?
if($group_id_of_acc_logged >= $config['site']['access_admin_panel'])
echo "<a href='?subtopic=adminpanel'>
<div id='submenu_adminpanel' class='Submenuitem' onMouseOver='MouseOverSubmenuItem(this)' onMouseOut='MouseOutSubmenuItem(this)'>
<div class='LeftChain' style='background-image:url(".$layout_name."/images/general/chain.gif);'></div>
<div id='ActiveSubmenuItemIcon_adminpanel' class='ActiveSubmenuItemIcon' style='background-image:url(".$layout_name."/images/menu/icon-activesubmenu.gif);'></div>
<div class='SubmenuitemLabel'><font color=\"red\">! Admin Panel !</font></div>
<div class='RightChain' style='background-image:url(".$layout_name."/images/general/chain.gif);'></div>
</div>
</a>";
 
Back
Top