Changeset 304 for minimanager/guild.php
- Timestamp:
- Mar 13, 2008, 7:39:11 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
minimanager/guild.php
r142 r304 8 8 * License: GNU General Public License v2(GPL) 9 9 */ 10 10 11 11 require_once("header.php"); 12 valid_login( 1);12 valid_login(0); 13 13 require_once("scripts/id_tab.php"); 14 14 //######################################################################################################################## … … 20 20 $sql = new SQL; 21 21 $sql->connect($characters_db[$realm_id]['addr'], $characters_db[$realm_id]['user'], $characters_db[$realm_id]['pass'], $characters_db[$realm_id]['name']); 22 22 23 23 $start = (isset($_GET['start'])) ? $sql->quote_smart($_GET['start']) : 0; 24 24 $order_by = (isset($_GET['order_by'])) ? $sql->quote_smart($_GET['order_by']) : "gid"; 25 25 26 26 $dir = (isset($_GET['dir'])) ? $sql->quote_smart($_GET['dir']) : 1; 27 27 $order_dir = ($dir) ? "ASC" : "DESC"; 28 28 $dir = ($dir) ? 0 : 1; 29 29 30 30 $query_1 = $sql->query("SELECT count(*) FROM guild"); 31 31 $all_record = $sql->result($query_1,0); 32 32 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, 34 34 (SELECT name FROM `character` WHERE guid = lguid) AS l_name,(SELECT COUNT(*) FROM guild_member WHERE guildid = gid) AS tot_chars 35 35 FROM guild ORDER BY $order_by $order_dir LIMIT $start, $itemperpage"); … … 39 39 $output .="<center><table class=\"top_hidden\"> 40 40 <tr><td> 41 <table class=\"hidden\"> 41 <table class=\"hidden\"> 42 42 <tr><td> 43 43 <form action=\"guild.php\" method=\"get\" name=\"form\"> … … 46 46 <input type=\"text\" size=\"45\" name=\"search_value\" /> 47 47 <select name=\"search_by\"> 48 <option value=\" gname\">{$lang_guild['by_name']}</option>48 <option value=\"name\">{$lang_guild['by_name']}</option> 49 49 <option value=\"leaderguid\">{$lang_guild['by_guild_leader']}</option> 50 50 <option value=\"createdate\">{$lang_guild['by_create_date']}</option> … … 59 59 60 60 $output .= "<table class=\"lined\"> 61 <tr> 61 <tr> 62 62 <th width=\"5%\"><a href=\"guild.php?order_by=gid&start=$start&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&start=$start&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&start=$start&dir=$dir\">".($order_by=='name' ? "<img src=\"img/arr_".($dir ? "up" : "dw").".gif\" /> " : "")."{$lang_guild['guild_name']}</a></th> 64 64 <th width=\"5%\"><a href=\"guild.php?order_by=tot_chars&start=$start&dir=$dir\">".($order_by=='tot_chars' ? "<img src=\"img/arr_".($dir ? "up" : "dw").".gif\" /> " : "")."{$lang_guild['tot_members']}</a></th> 65 65 <th width=\"5%\">Online Members</th> … … 102 102 $sql = new SQL; 103 103 $sql->connect($characters_db[$realm_id]['addr'], $characters_db[$realm_id]['user'], $characters_db[$realm_id]['pass'], $characters_db[$realm_id]['name']); 104 104 105 105 $search_value = $sql->quote_smart($_GET['search_value']); 106 106 $search_by = $sql->quote_smart($_GET['search_by']); … … 118 118 } 119 119 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, 121 121 (SELECT name FROM `character` WHERE guid = lguid) AS l_name, (SELECT COUNT(*) FROM guild_member WHERE guildid = gid) AS tot_chars 122 122 FROM guild WHERE $search_by LIKE '%$search_value%' ORDER BY $order_by $order_dir LIMIT $sql_search_limit"); … … 133 133 <input type=\"text\" size=\"30\" name=\"search_value\" /> 134 134 <select name=\"search_by\"> 135 <option value=\" gname\">{$lang_guild['by_name']}</option>135 <option value=\"name\">{$lang_guild['by_name']}</option> 136 136 <option value=\"leaderguid\">{$lang_guild['by_guild_leader']}</option> 137 137 <option value=\"createdate\">{$lang_guild['by_create_date']}</option> … … 144 144 145 145 $output .= "<table class=\"lined\"> 146 <tr> 146 <tr> 147 147 <th width=\"5%\"><a href=\"guild.php?action=search&error=4&order_by=guildid&search_by=$search_by&search_value=$search_value&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&error=4&order_by= gname&search_by=$search_by&search_value=$search_value&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&error=4&order_by=name&search_by=$search_by&search_value=$search_value&dir=$dir\">".($order_by=='name' ? "<img src=\"img/arr_".($dir ? "up" : "dw").".gif\" /> " : "")."{$lang_guild['guild_name']}</a></th> 149 149 <th width=\"5%\"><a href=\"guild.php?action=search&error=4&order_by=tot_chars&search_by=$search_by&search_value=$search_value&dir=$dir\">".($order_by=='tot_chars' ? "<img src=\"img/arr_".($dir ? "up" : "dw").".gif\" /> " : "")."{$lang_guild['tot_members']}</a></th> 150 150 <th width=\"15%\"><a href=\"guild.php?action=search&error=4&order_by=leaderguid&search_by=$search_by&search_value=$search_value&dir=$dir\">".($order_by=='leaderguid' ? "<img src=\"img/arr_".($dir ? "up" : "dw").".gif\" /> " : "")."{$lang_guild['guild_leader']}</a></th> … … 190 190 $sql = new SQL; 191 191 $sql->connect($characters_db[$realm_id]['addr'], $characters_db[$realm_id]['user'], $characters_db[$realm_id]['pass'], $characters_db[$realm_id]['name']); 192 192 193 193 $guild_id = $sql->quote_smart($_GET['id']); 194 194 195 195 $query = $sql->query("SELECT guildid, name, info, MOTD, createdate FROM guild WHERE guildid = '$guild_id'"); 196 196 $guild_data = $sql->fetch_row($query); … … 234 234 <td colspan=\"11\">{$lang_guild['tot_members']}: $total_members</td> 235 235 </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> 239 242 <th width=\"3%\">Race</th> 240 243 <th width=\"3%\">Class</th> 241 244 <th width=\"3%\">{$lang_guild['level']}</th> 242 245 <th width=\"21%\">{$lang_guild['rank']}</th> … … 249 252 while ($member = $sql->fetch_row($members)){ 250 253 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]';"); 252 255 253 256 $online = $sql->fetch_row($query); 254 257 $accid = $online[3]; 255 258 $llogin = count_days($online[4], time()); 256 259 257 260 $level = $online[5]; 258 261 … … 294 297 } 295 298 296 299 297 300 if($llogin < 1) 298 301 { … … 324 327 } 325 328 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&id=$member[0]&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&id=$member[0]&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> 331 335 <td><img src='img/c_icons/{$online[1]}.gif' onmousemove='toolTip(\"".get_player_class($online[1])."\",\"item_tooltip\")' onmouseout='toolTip()' /></td> 332 336 <td>$lev</td> … … 342 346 $output .= "</table><br />"; 343 347 $sql->close(); 344 348 345 349 $output .= "<table class=\"hidden\"> 346 350 <tr><td>"; … … 382 386 $output .= "</td></tr> 383 387 </table> 384 </form></center><br />"; 388 </form></center><br />"; 385 389 } 386 390 … … 390 394 function rem_char_from_guild(){ 391 395 global $characters_db, $realm_id, $user_lvl; 392 396 393 397 require_once("scripts/defines.php"); 394 398 395 399 if(isset($_GET['id'])) $guid = $_GET['id']; 396 400 else redirect("guild.php?error=1"); … … 418 422 //######################################################################################################################## 419 423 $err = (isset($_GET['error'])) ? $_GET['error'] : NULL; 420 424 421 425 $output .= "<div class=\"top\">"; 422 426 switch ($err) { … … 440 444 441 445 switch ($action) { 442 case "browse_guilds": 446 case "browse_guilds": 443 447 browse_guilds(); 444 448 break; 445 case "search": 449 case "search": 446 450 search(); 447 451 break; 448 case "view_guild": 452 case "view_guild": 449 453 view_guild(); 450 454 break; 451 case "del_guild": 455 case "del_guild": 452 456 del_guild(); 453 457 break; 454 case "rem_char_from_guild": 458 case "rem_char_from_guild": 455 459 rem_char_from_guild(); 456 460 break;
Note:
See TracChangeset
for help on using the changeset viewer.