Changeset 304 for minimanager/guild.php


Ignore:
Timestamp:
Mar 13, 2008, 7:39:11 PM (17 years ago)
Author:
george
Message:

Aktualizace na minimanager 0.1.6d.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • minimanager/guild.php

    r142 r304  
    88 * License: GNU General Public License v2(GPL)
    99 */
    10  
     10
    1111require_once("header.php");
    12 valid_login(1);
     12valid_login(0);
    1313require_once("scripts/id_tab.php");
    1414//########################################################################################################################
     
    2020 $sql = new SQL;
    2121 $sql->connect($characters_db[$realm_id]['addr'], $characters_db[$realm_id]['user'], $characters_db[$realm_id]['pass'], $characters_db[$realm_id]['name']);
    22  
     22
    2323 $start = (isset($_GET['start'])) ? $sql->quote_smart($_GET['start']) : 0;
    2424 $order_by = (isset($_GET['order_by'])) ? $sql->quote_smart($_GET['order_by']) : "gid";
    25  
     25
    2626 $dir = (isset($_GET['dir'])) ? $sql->quote_smart($_GET['dir']) : 1;
    2727 $order_dir = ($dir) ? "ASC" : "DESC";
    2828 $dir = ($dir) ? 0 : 1;
    29  
     29
    3030 $query_1 = $sql->query("SELECT count(*) FROM guild");
    3131 $all_record = $sql->result($query_1,0);
    3232
    33  $query = $sql->query("SELECT guild.guildid AS gid, guild.name AS gname,guild.leaderguid AS lguid,SUBSTRING_INDEX(guild.MOTD,' ',6), guild.createdate,
     33 $query = $sql->query("SELECT guild.guildid AS gid, guild.name AS name,guild.leaderguid AS lguid,SUBSTRING_INDEX(guild.MOTD,' ',6), guild.createdate,
    3434                                                (SELECT name FROM `character` WHERE guid = lguid) AS l_name,(SELECT COUNT(*) FROM guild_member WHERE guildid = gid) AS tot_chars
    3535                                                FROM guild ORDER BY $order_by $order_dir LIMIT $start, $itemperpage");
     
    3939 $output .="<center><table class=\"top_hidden\">
    4040          <tr><td>
    41                         <table class=\"hidden\"> 
     41                        <table class=\"hidden\">
    4242                                <tr><td>
    4343                        <form action=\"guild.php\" method=\"get\" name=\"form\">
     
    4646                        <input type=\"text\" size=\"45\" name=\"search_value\" />
    4747                        <select name=\"search_by\">
    48                                 <option value=\"gname\">{$lang_guild['by_name']}</option>
     48                                <option value=\"name\">{$lang_guild['by_name']}</option>
    4949                                <option value=\"leaderguid\">{$lang_guild['by_guild_leader']}</option>
    5050                                <option value=\"createdate\">{$lang_guild['by_create_date']}</option>
     
    5959
    6060 $output .= "<table class=\"lined\">
    61    <tr> 
     61   <tr>
    6262        <th width=\"5%\"><a href=\"guild.php?order_by=gid&amp;start=$start&amp;dir=$dir\">".($order_by=='gid' ? "<img src=\"img/arr_".($dir ? "up" : "dw").".gif\" /> " : "")."{$lang_guild['id']}</a></th>
    63         <th width=\"23%\"><a href=\"guild.php?order_by=gname&amp;start=$start&amp;dir=$dir\">".($order_by=='gname' ? "<img src=\"img/arr_".($dir ? "up" : "dw").".gif\" /> " : "")."{$lang_guild['guild_name']}</a></th>
     63        <th width=\"23%\"><a href=\"guild.php?order_by=name&amp;start=$start&amp;dir=$dir\">".($order_by=='name' ? "<img src=\"img/arr_".($dir ? "up" : "dw").".gif\" /> " : "")."{$lang_guild['guild_name']}</a></th>
    6464        <th width=\"5%\"><a href=\"guild.php?order_by=tot_chars&amp;start=$start&amp;dir=$dir\">".($order_by=='tot_chars' ? "<img src=\"img/arr_".($dir ? "up" : "dw").".gif\" /> " : "")."{$lang_guild['tot_members']}</a></th>
    6565        <th width=\"5%\">Online Members</th>
     
    102102 $sql = new SQL;
    103103 $sql->connect($characters_db[$realm_id]['addr'], $characters_db[$realm_id]['user'], $characters_db[$realm_id]['pass'], $characters_db[$realm_id]['name']);
    104  
     104
    105105 $search_value = $sql->quote_smart($_GET['search_value']);
    106106 $search_by = $sql->quote_smart($_GET['search_by']);
     
    118118}
    119119
    120  $query = $sql->query("SELECT guild.guildid AS gid, guild.name AS gname,guild.leaderguid AS lguid,SUBSTRING_INDEX(guild.MOTD,' ',6), guild.createdate,
     120 $query = $sql->query("SELECT guild.guildid AS gid, guild.name AS name,guild.leaderguid AS lguid,SUBSTRING_INDEX(guild.MOTD,' ',6), guild.createdate,
    121121                                                (SELECT name FROM `character` WHERE guid = lguid) AS l_name, (SELECT COUNT(*) FROM guild_member WHERE guildid = gid) AS tot_chars
    122122                                                FROM guild WHERE $search_by LIKE '%$search_value%' ORDER BY $order_by $order_dir LIMIT $sql_search_limit");
     
    133133                        <input type=\"text\" size=\"30\" name=\"search_value\" />
    134134                        <select name=\"search_by\">
    135                                 <option value=\"gname\">{$lang_guild['by_name']}</option>
     135                                <option value=\"name\">{$lang_guild['by_name']}</option>
    136136                                <option value=\"leaderguid\">{$lang_guild['by_guild_leader']}</option>
    137137                                <option value=\"createdate\">{$lang_guild['by_create_date']}</option>
     
    144144
    145145 $output .= "<table class=\"lined\">
    146    <tr> 
     146   <tr>
    147147        <th width=\"5%\"><a href=\"guild.php?action=search&amp;error=4&amp;order_by=guildid&amp;search_by=$search_by&amp;search_value=$search_value&amp;dir=$dir\">".($order_by=='guildid' ? "<img src=\"img/arr_".($dir ? "up" : "dw").".gif\" /> " : "")."{$lang_guild['id']}</a></th>
    148         <th width=\"25%\"><a href=\"guild.php?action=search&amp;error=4&amp;order_by=gname&amp;search_by=$search_by&amp;search_value=$search_value&amp;dir=$dir\">".($order_by=='gname' ? "<img src=\"img/arr_".($dir ? "up" : "dw").".gif\" /> " : "")."{$lang_guild['guild_name']}</a></th>
     148        <th width=\"25%\"><a href=\"guild.php?action=search&amp;error=4&amp;order_by=name&amp;search_by=$search_by&amp;search_value=$search_value&amp;dir=$dir\">".($order_by=='name' ? "<img src=\"img/arr_".($dir ? "up" : "dw").".gif\" /> " : "")."{$lang_guild['guild_name']}</a></th>
    149149        <th width=\"5%\"><a href=\"guild.php?action=search&amp;error=4&amp;order_by=tot_chars&amp;search_by=$search_by&amp;search_value=$search_value&amp;dir=$dir\">".($order_by=='tot_chars' ? "<img src=\"img/arr_".($dir ? "up" : "dw").".gif\" /> " : "")."{$lang_guild['tot_members']}</a></th>
    150150        <th width=\"15%\"><a href=\"guild.php?action=search&amp;error=4&amp;order_by=leaderguid&amp;search_by=$search_by&amp;search_value=$search_value&amp;dir=$dir\">".($order_by=='leaderguid' ? "<img src=\"img/arr_".($dir ? "up" : "dw").".gif\" /> " : "")."{$lang_guild['guild_leader']}</a></th>
     
    190190 $sql = new SQL;
    191191 $sql->connect($characters_db[$realm_id]['addr'], $characters_db[$realm_id]['user'], $characters_db[$realm_id]['pass'], $characters_db[$realm_id]['name']);
    192  
     192
    193193 $guild_id = $sql->quote_smart($_GET['id']);
    194  
     194
    195195 $query = $sql->query("SELECT guildid, name, info, MOTD, createdate FROM guild WHERE guildid = '$guild_id'");
    196196 $guild_data = $sql->fetch_row($query);
     
    234234    <td colspan=\"11\">{$lang_guild['tot_members']}: $total_members</td>
    235235  </tr>
    236   <tr>
    237     <th width=\"3%\">{$lang_guild['remove']}</th>
    238         <th width=\"21%\">{$lang_guild['name']}</th>
     236  <tr>";
     237    if ($user_lvl > 2){
     238    $output .= " <th width=\"3%\">{$lang_guild['remove']}</th>";
     239       }
     240    $output .= "
     241    <th width=\"21%\">{$lang_guild['name']}</th>
    239242    <th width=\"3%\">Race</th>
    240         <th width=\"3%\">Class</th>
     243    <th width=\"3%\">Class</th>
    241244        <th width=\"3%\">{$lang_guild['level']}</th>
    242245        <th width=\"21%\">{$lang_guild['rank']}</th>
     
    249252 while ($member = $sql->fetch_row($members)){
    250253
    251         $query = $sql->query("SELECT `race`,`class`,`online`, `account`, `logout_time`, SUBSTRING_INDEX(SUBSTRING_INDEX(`character`.`data`, ' ', 35), ' ', -1) AS level FROM `character` WHERE `name` = '$member[2]';");
     254        $query = $sql->query("SELECT `race`,`class`,`online`, `account`, `logout_time`, SUBSTRING_INDEX(SUBSTRING_INDEX(`character`.`data`, ' ', 35), ' ', -1) AS level, mid(lpad( hex( CAST(substring_index(substring_index(data,' ',".(36+1)."),' ',-1) as unsigned) ),8,'0'),4,1) as gender FROM `character` WHERE `name` = '$member[2]';");
    252255
    253256        $online = $sql->fetch_row($query);
    254257        $accid = $online[3];
    255258        $llogin = count_days($online[4], time());
    256        
     259
    257260 $level = $online[5];
    258261
     
    294297                }
    295298
    296        
     299
    297300        if($llogin < 1)
    298301        {
     
    324327        }
    325328
    326 
    327         $output .= " <tr>
    328         <td><img src=\"img/aff_cross.png\" alt=\"\" onclick=\"answerBox('{$lang_global['delete']}: <font color=white>{$member[2]}</font><br />{$lang_global['are_you_sure']}', 'guild.php?action=rem_char_from_guild&amp;id=$member[0]&amp;guld_id=$guild_id');\" style=\"cursor:pointer;\" /></td>
    329         <td><a href=\"char.php?id=$member[0]\">$member[2]</a></td>
    330         <td><img src='img/c_icons/{$online[0]}-0.gif' onmousemove='toolTip(\"".get_player_race($online[0])."\",\"item_tooltip\")' onmouseout='toolTip()' /></td>
     329        $output .= " <tr>";
     330        if ($user_lvl > 2){
     331                $output .= " <td><img src=\"img/aff_cross.png\" alt=\"\" onclick=\"answerBox('{$lang_global['delete']}: <font color=white>{$member[2]}</font><br />{$lang_global['are_you_sure']}', 'guild.php?action=rem_char_from_guild&amp;id=$member[0]&amp;guld_id=$guild_id');\" style=\"cursor:pointer;\" /></td>";
     332        }
     333        $output .= " <td><a href=\"char.php?id=$member[0]\">$member[2]</a></td>
     334        <td><img src='img/c_icons/{$online[0]}-{$online[6]}.gif' onmousemove='toolTip(\"".get_player_race($online[0])."\",\"item_tooltip\")' onmouseout='toolTip()' /></td>
    331335        <td><img src='img/c_icons/{$online[1]}.gif' onmousemove='toolTip(\"".get_player_class($online[1])."\",\"item_tooltip\")' onmouseout='toolTip()' /></td>
    332336        <td>$lev</td>
     
    342346 $output .= "</table><br />";
    343347  $sql->close();
    344  
     348
    345349 $output .= "<table class=\"hidden\">
    346350          <tr><td>";
     
    382386 $output .= "</td></tr>
    383387        </table>
    384                 </form></center><br />";               
     388                </form></center><br />";
    385389}
    386390
     
    390394function rem_char_from_guild(){
    391395        global $characters_db, $realm_id, $user_lvl;
    392        
     396
    393397        require_once("scripts/defines.php");
    394        
     398
    395399        if(isset($_GET['id'])) $guid = $_GET['id'];
    396400                else redirect("guild.php?error=1");
     
    418422//########################################################################################################################
    419423$err = (isset($_GET['error'])) ? $_GET['error'] : NULL;
    420        
     424
    421425$output .= "<div class=\"top\">";
    422426switch ($err) {
     
    440444
    441445switch ($action) {
    442 case "browse_guilds": 
     446case "browse_guilds":
    443447   browse_guilds();
    444448   break;
    445 case "search": 
     449case "search":
    446450   search();
    447451   break;
    448 case "view_guild": 
     452case "view_guild":
    449453   view_guild();
    450454   break;
    451 case "del_guild": 
     455case "del_guild":
    452456   del_guild();
    453457   break;
    454 case "rem_char_from_guild": 
     458case "rem_char_from_guild":
    455459   rem_char_from_guild();
    456460   break;
Note: See TracChangeset for help on using the changeset viewer.