Changeset 142 for minimanager/guild.php
- Timestamp:
- Nov 23, 2007, 11:29:33 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
minimanager/guild.php
r19 r142 11 11 require_once("header.php"); 12 12 valid_login(1); 13 13 require_once("scripts/id_tab.php"); 14 14 //######################################################################################################################## 15 15 // BROWSE GUILDS 16 16 //######################################################################################################################## 17 17 function browse_guilds() { 18 global $lang_guild, $lang_global, $output, $ mangos_db, $realm_id, $itemperpage;18 global $lang_guild, $lang_global, $output, $characters_db, $realm_id, $itemperpage, $realm_db; 19 19 20 20 $sql = new SQL; 21 $sql->connect($ mangos_db[$realm_id]['addr'], $mangos_db[$realm_id]['user'], $mangos_db[$realm_id]['pass'], $mangos_db[$realm_id]['name']);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; … … 61 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=\"2 5%\"><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=gname&start=$start&dir=$dir\">".($order_by=='gname' ? "<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 <th width=\"5%\">Online Members</th> 65 66 <th width=\"15%\"><a href=\"guild.php?order_by=leaderguid&start=$start&dir=$dir\">".($order_by=='leaderguid' ? "<img src=\"img/arr_".($dir ? "up" : "dw").".gif\" /> " : "")."{$lang_guild['guild_leader']}</a></th> 66 <th width=\"3 5%\">{$lang_guild['guild_motd']}</th>67 <th width=\"32%\">{$lang_guild['guild_motd']}</th> 67 68 <th width=\"15%\"><a href=\"guild.php?order_by=createdate&start=$start&dir=$dir\">".($order_by=='createdate' ? "<img src=\"img/arr_".($dir ? "up" : "dw").".gif\" /> " : "")."{$lang_guild['create_date']}</a></th> 68 69 </tr>"; 69 70 70 71 while ($data = $sql->fetch_row($query)) { 72 73 $gonline = $sql->query("SELECT count(*) AS GCNT FROM `guild_member`, `character`, `guild` WHERE guild.guildid = ".$data[0]." AND guild_member.guildid = guild.guildid AND guild_member.guid = character.guid AND character.online = 1;"); 74 $guild_online = $sql->result($gonline,"GCNT"); 75 71 76 $output .= "<tr> 72 77 <td>$data[0]</td> 73 78 <td><a href=\"guild.php?action=view_guild&error=3&id=$data[0]\">$data[1]</a></td> 74 79 <td>$data[6]</td> 80 <td>$guild_online</td> 75 81 <td><a href=\"char.php?id=$data[2]\">$data[5]</a></td> 76 82 <td>$data[3] ...</td> … … 90 96 //######################################################################################################################## 91 97 function search() { 92 global $lang_guild, $lang_global, $output, $ mangos_db, $realm_id, $sql_search_limit;98 global $lang_guild, $lang_global, $output, $characters_db, $realm_id, $sql_search_limit; 93 99 94 100 if(!isset($_GET['search_value']) || !isset($_GET['search_by'])) redirect("guild.php?error=2"); 95 101 96 102 $sql = new SQL; 97 $sql->connect($ mangos_db[$realm_id]['addr'], $mangos_db[$realm_id]['user'], $mangos_db[$realm_id]['pass'], $mangos_db[$realm_id]['name']);103 $sql->connect($characters_db[$realm_id]['addr'], $characters_db[$realm_id]['user'], $characters_db[$realm_id]['pass'], $characters_db[$realm_id]['name']); 98 104 99 105 $search_value = $sql->quote_smart($_GET['search_value']); … … 166 172 } 167 173 174 function count_days( $a, $b ) { 175 $gd_a = getdate( $a ); 176 $gd_b = getdate( $b ); 177 $a_new = mktime( 12, 0, 0, $gd_a['mon'], $gd_a['mday'], $gd_a['year'] ); 178 $b_new = mktime( 12, 0, 0, $gd_b['mon'], $gd_b['mday'], $gd_b['year'] ); 179 return round( abs( $a_new - $b_new ) / 86400 ); 180 } 168 181 169 182 //######################################################################################################################## … … 171 184 //######################################################################################################################## 172 185 function view_guild() { 173 global $lang_guild, $lang_global, $output, $ mangos_db, $realm_id, $user_lvl;186 global $lang_guild, $lang_global, $output, $characters_db, $realm_id, $user_lvl; 174 187 175 188 if(!isset($_GET['id'])) redirect("guild.php?error=1"); 176 189 177 190 $sql = new SQL; 178 $sql->connect($ mangos_db[$realm_id]['addr'], $mangos_db[$realm_id]['user'], $mangos_db[$realm_id]['pass'], $mangos_db[$realm_id]['name']);191 $sql->connect($characters_db[$realm_id]['addr'], $characters_db[$realm_id]['user'], $characters_db[$realm_id]['pass'], $characters_db[$realm_id]['name']); 179 192 180 193 $guild_id = $sql->quote_smart($_GET['id']); … … 185 198 $members = $sql->query("SELECT guild_member.guid, guild_member.rank AS mrank, 186 199 `character`.name, SUBSTRING_INDEX(SUBSTRING_INDEX(`character`.`data`, ' ', 35), ' ', -1) AS level, 187 (SELECT rname FROM guild_rank WHERE guildid ='$guild_id' AND rid = mrank) AS rname 200 (SELECT rname FROM guild_rank WHERE guildid ='$guild_id' AND rid = mrank) AS rname, 201 guild_member.Pnote, guild_member.OFFnote 188 202 FROM guild_member,`character` 189 203 LEFT JOIN guild_member k1 ON k1.`guid`=`character`.`guid` 190 204 WHERE guild_member.guildid = '$guild_id' AND guild_member.guid=`character`.guid 191 205 ORDER BY mrank"); 206 207 208 192 209 $total_members = $sql->num_rows($members); 193 210 … … 199 216 </script> 200 217 <center> 201 <fieldset style=\"width: 600px;\">218 <fieldset style=\"width: 950px;\"> 202 219 <legend>{$lang_guild['guild']}</legend> 203 <table class=\"lined\" style=\"width: 560px;\">220 <table class=\"lined\" style=\"width: 910px;\"> 204 221 <tr class=\"bold\"> 205 <td colspan=\" 4\">$guild_data[1]</td>222 <td colspan=\"11\">$guild_data[1]</td> 206 223 </tr> 207 224 <tr> 208 <td colspan=\" 4\">{$lang_guild['create_date']}: $guild_data[4]</td>225 <td colspan=\"11\">{$lang_guild['create_date']}: $guild_data[4]</td> 209 226 </tr> 210 227 <tr> 211 <td colspan=\" 4\">{$lang_guild['info']}: $guild_data[2]</td>228 <td colspan=\"11\">{$lang_guild['info']}: $guild_data[2]</td> 212 229 </tr> 213 230 <tr> 214 <td colspan=\" 4\">{$lang_guild['motd']}: $guild_data[3]</td>231 <td colspan=\"11\">{$lang_guild['motd']}: $guild_data[3]</td> 215 232 </tr> 216 233 <tr> 217 <td colspan=\" 4\">{$lang_guild['tot_members']}: $total_members</td>234 <td colspan=\"11\">{$lang_guild['tot_members']}: $total_members</td> 218 235 </tr> 219 236 <tr> 220 <th width=\"5%\">{$lang_guild['remove']}</th> 221 <th width=\"45%\">{$lang_guild['name']}</th> 222 <th width=\"5%\">{$lang_guild['level']}</th> 223 <th width=\"45%\">{$lang_guild['rank']}</th> 237 <th width=\"3%\">{$lang_guild['remove']}</th> 238 <th width=\"21%\">{$lang_guild['name']}</th> 239 <th width=\"3%\">Race</th> 240 <th width=\"3%\">Class</th> 241 <th width=\"3%\">{$lang_guild['level']}</th> 242 <th width=\"21%\">{$lang_guild['rank']}</th> 243 <th width=\"14%\">Player Note</th> 244 <th width=\"14%\">Office Note</th> 245 <th width=\"15%\">Last Login (Days)</th> 246 <th width=\"3%\">Online</th> 224 247 </tr>"; 225 248 226 249 while ($member = $sql->fetch_row($members)){ 250 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]';"); 252 253 $online = $sql->fetch_row($query); 254 $accid = $online[3]; 255 $llogin = count_days($online[4], time()); 256 257 $level = $online[5]; 258 259 if($level > 0) 260 { 261 $lev = '<font color="#FFFFFF">'.$level.'</font>'; 262 } 263 if($level > 9) 264 { 265 $lev = '<font color="#858585">'.$level.'</font>'; 266 } 267 if($level > 19) 268 { 269 $lev = '<font color="#339900">'.$level.'</font>'; 270 } 271 if($level > 29) 272 { 273 $lev = '<font color="#3300CC">'.$level.'</font>'; 274 } 275 if($level > 39) 276 { 277 $lev = '<font color="#5552FF">'.$level.'</font>'; 278 } 279 if($level > 49) 280 { 281 $lev = '<font color="#FF8000">'.$level.'</font>'; 282 } 283 if($level > 59) 284 { 285 $lev = '<font color="#FF0000">'.$level.'</font>'; 286 } 287 if($level > 69) 288 { 289 $lev = '<font color="#FF00CC">'.$level.'</font>'; 290 } 291 if($level > 70) 292 { 293 $lev = '<font color="#FFF000">'.$level.'</font>'; 294 } 295 296 297 if($llogin < 1) 298 { 299 $lastlogin = '<font color="#009900">'.$llogin.'</font>'; 300 } 301 if($llogin >= 1) 302 { 303 $lastlogin = '<font color="#0000CC">'.$llogin.'</font>'; 304 } 305 if($llogin > 5) 306 { 307 $lastlogin = '<font color="#FFFF00">'.$llogin.'</font>'; 308 } 309 if($llogin > 15) 310 { 311 $lastlogin = '<font color="#FF8000">'.$llogin.'</font>'; 312 } 313 if($llogin > 30) 314 { 315 $lastlogin = '<font color="#FF0000">'.$llogin.'</font>'; 316 } 317 if($llogin > 60) 318 { 319 $lastlogin = '<font color="#FF00FF">'.$llogin.'</font>'; 320 } 321 if($llogin > 90) 322 { 323 $lastlogin = '<font color="#8000FF">'.$llogin.'</font>'; 324 } 325 326 227 327 $output .= " <tr> 228 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> 229 329 <td><a href=\"char.php?id=$member[0]\">$member[2]</a></td> 230 <td>$member[3]</td> 330 <td><img src='img/c_icons/{$online[0]}-0.gif' onmousemove='toolTip(\"".get_player_race($online[0])."\",\"item_tooltip\")' onmouseout='toolTip()' /></td> 331 <td><img src='img/c_icons/{$online[1]}.gif' onmousemove='toolTip(\"".get_player_class($online[1])."\",\"item_tooltip\")' onmouseout='toolTip()' /></td> 332 <td>$lev</td> 231 333 <td>".($member[4]?$member[4]:$lang_guild['guild_leader'])." ($member[1])</td> 334 <td>$member[5]</td> 335 <td>$member[6]</td> 336 <td>$lastlogin</td> 337 <td>".(($online[2]) ? "<img src=\"img/up.gif\" alt=\"\" />" : "-")."</td> 232 338 </tr>"; 233 339 } 340 234 341 235 342 $output .= "</table><br />"; … … 282 389 //REMOVE CHAR FROM GUILD 283 390 function rem_char_from_guild(){ 284 global $ mangos_db, $realm_id, $user_lvl;391 global $characters_db, $realm_id, $user_lvl; 285 392 286 393 require_once("scripts/defines.php"); … … 292 399 293 400 $sql = new SQL; 294 $sql->connect($ mangos_db[$realm_id]['addr'], $mangos_db[$realm_id]['user'], $mangos_db[$realm_id]['pass'], $mangos_db[$realm_id]['name']);401 $sql->connect($characters_db[$realm_id]['addr'], $characters_db[$realm_id]['user'], $characters_db[$realm_id]['pass'], $characters_db[$realm_id]['name']); 295 402 296 403 $char_data = $sql->query("SELECT data FROM `character` WHERE guid = '$guid' LIMIT 1");
Note:
See TracChangeset
for help on using the changeset viewer.