Changeset 595 for trunk/pages/guilda.php
- Timestamp:
- May 19, 2009, 7:58:09 AM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/pages/guilda.php
r580 r595 15 15 { 16 16 $guild_id = $id; 17 $guild_data = $db -> query("SELECT `guildid`, `name`, `createdate` FROM `guild` WHERE `guildid` = ".$guild_id." LIMIT 1;") -> fetch_array(); 18 $members = $db -> query("SELECT guild_member.guid, guild_member.rank AS mrank, `characters`.name, SUBSTRING_INDEX(SUBSTRING_INDEX(`characters`.`data`, ' ', ".$Config['Mangos']['CharacterDataOffset']['Level']." + 1), ' ', -1) AS level, (SELECT rname FROM guild_rank WHERE guildid =".$guild_id." AND rid = mrank+1) AS rname, guild_member.pnote, guild_member.offnote FROM guild_member,`characters` LEFT JOIN guild_member k1 ON k1.`guid`=`characters`.`guid` WHERE guild_member.guildid = ".$guild_id." AND guild_member.guid=`characters`.guid ORDER BY mrank"); 19 $total_members = $members -> num_rows; 20 $members_data = $members -> fetch_array(); 21 $online_mem = $db -> query("SELECT count(*) AS online_mem FROM `guild_member`, `characters`, `guild` WHERE guild.guildid = ".$guild_id." AND guild_member.guildid = guild.guildid AND guild_member.guid = characters.guid AND characters.online = 1;") -> fetch_array();; 17 $DbResult = $db->query('SELECT `guildid`, `name`, `createdate` FROM `guild` WHERE `guildid` = '.$guild_id.' LIMIT 1'); 18 $guild_data = $DbResult->fetch_assoc(); 19 $members = $db->query('SELECT guild_member.guid, guild_member.rank AS mrank, `characters`.name, SUBSTRING_INDEX(SUBSTRING_INDEX(`characters`.`data`, " ", '.$Config['Mangos']['CharacterDataOffset']['Level'].' + 1), " ", -1) AS level, (SELECT rname FROM guild_rank WHERE guildid ='.$guild_id.' AND rid = mrank + 1) AS rname, guild_member.pnote, guild_member.offnote FROM guild_member,`characters` LEFT JOIN guild_member k1 ON k1.`guid`=`characters`.`guid` WHERE guild_member.guildid = '.$guild_id.' AND guild_member.guid=`characters`.guid ORDER BY mrank'); 20 $total_members = $members->num_rows; 21 $members_data = $members->fetch_assoc(); 22 $DbResult = $db->query('SELECT count(*) AS online_mem FROM `guild_member`, `characters`, `guild` WHERE guild.guildid = '.$guild_id.' AND guild_member.guildid = guild.guildid AND guild_member.guid = characters.guid AND characters.online = 1'); 23 $online_mem = $DbResult->fetch_assoc(); 24 22 25 // guild info 23 26 $date_arr = explode(' ', $guild_data['createdate']); … … 27 30 $human_date = date('d.m.Y H:i:s', $time); 28 31 echo('<a href="?page=guildy"><- Zpět na výpis</a><br />'); 29 echo('<table border="1">32 echo('<table class="BaseTable"> 30 33 <tr> 31 <td colspan="2" ><font size="5">Guilda : '.$guild_data['name'].'</font></td>34 <td colspan="2" style="font-size: x-large;">Spolek '.$guild_data['name'].'</td> 32 35 </tr> 33 36 <tr> … … 39 42 <td>'.$total_members.' (Online : '.$online_mem['online_mem'].')</td> 40 43 </tr> 41 </table> ');44 </table><br />'); 42 45 43 46 // members info 44 echo('<table border="1">47 echo('<table class="BaseTable"> 45 48 <tr> 46 49 <th align="center">Jméno</th> 47 50 <th align="center">Rasa</th> 48 <th align="center"> Class</th>51 <th align="center">Třída</th> 49 52 <th align="center">Úroveň</th> 50 <th align="center"> Rank</th>51 <th align="center">Poslední přihlášení ( Dny)</th>53 <th align="center">Hodnost</th> 54 <th align="center">Poslední přihlášení (dny)</th> 52 55 <th align="center">Online</th> 53 56 </tr>'); … … 57 60 $online = $query->fetch_assoc(); 58 61 $accid = $online['account']; 59 $llogin = count_days($online['logout_time'], time()); 60 if($llogin < 1) 61 { 62 $lastlogin = '<font color="#009900">'.$llogin.'</font>'; 63 } 64 if($llogin >= 1) 65 { 66 $lastlogin = '<font color="#0000CC">'.$llogin.'</font>'; 67 } 68 if($llogin > 5) 69 { 70 $lastlogin = '<font color="#FFFF00">'.$llogin.'</font>'; 71 } 72 if($llogin > 15) 73 { 74 $lastlogin = '<font color="#FF8000">'.$llogin.'</font>'; 75 } 76 if($llogin > 30) 77 { 78 $lastlogin = '<font color="#FF0000">'.$llogin.'</font>'; 79 } 80 if($llogin > 60) 81 { 82 $lastlogin = '<font color="#FF00FF">'.$llogin.'</font>'; 83 } 84 if($llogin > 90) 85 { 86 $lastlogin = '<font color="#8000FF">'.$llogin.'</font>'; 87 } 88 $level = $online['level']; 89 if($level > 0) 90 { 91 $lev = '<font color="#FFFFFF">'.$level.'</font>'; 92 } 93 if($level > 9) 94 { 95 $lev = '<font color="#858585">'.$level.'</font>'; 96 } 97 if($level > 19) 98 { 99 $lev = '<font color="#339900">'.$level.'</font>'; 100 } 101 if($level > 29) 102 { 103 $lev = '<font color="#3300CC">'.$level.'</font>'; 104 } 105 if($level > 39) 106 { 107 $lev = '<font color="#5552FF">'.$level.'</font>'; 108 } 109 if($level > 49) 110 { 111 $lev = '<font color="#FF8000">'.$level.'</font>'; 112 } 113 if($level > 59) 114 { 115 $lev = '<font color="#FF0000">'.$level.'</font>'; 116 } 117 if($level > 69) 118 { 119 $lev = '<font color="#FF00CC">'.$level.'</font>'; 120 } 121 if($level > 70) 122 { 123 $lev = '<font color="#FFF000">'.$level.'</font>'; 124 } 125 if($online['gender'] == 0) $gender = '0'; 126 else $gender = '1'; 62 63 $LogoutTime = count_days($online['logout_time'], time()); 64 $LogoutTimeColorList = array(0 => '#0000CC', 5 => '#FFFF00', 15 => '#FF8000', 30 => '#FF0000', 60 => '#FF00FF', 90 => '#8000FF'); 65 $LogoutTimeColor = '#009900'; 66 foreach($LogoutTimeColorList as $Time => $Color) 67 { 68 if($LogoutTime > $Time) $LogoutTimeColor = $Color; 69 } 70 71 $Level = $online['level']; 72 $LevelColorList = array(9 => '#858585', 19 => '#339900', 29 => '#3300CC', 39 => '#5552FF', 49 => '#FF8000', 59 => '#FF0000', 69 => '#FF00CC', 70 => '#FFF000'); 73 $LevelColor = '#FFFFFF'; 74 foreach($LevelColorList as $Index => $Color) 75 { 76 if($Level > $Index) $LevelColor = $Color; 77 } 78 79 if($online['gender'] == 0) $gender = 0; 80 else $gender = 1; 127 81 echo('<tr>'. 128 82 '<td align="center">'.$member[2].'</td>'. 129 '<td align="center"><img src="imgs/icons/'.$online['race'].'-'.$gender.'.gif" ></td>'.130 '<td align="center"><img src="imgs/icons/'.$online['class'].'.gif" ></td>'.131 '<td align="center" >'.$lev.'</td>'.83 '<td align="center"><img src="imgs/icons/'.$online['race'].'-'.$gender.'.gif" alt="pohlaví" /></td>'. 84 '<td align="center"><img src="imgs/icons/'.$online['class'].'.gif" alt="třída" /></td>'. 85 '<td align="center" style="color: '.$LevelColor.'">'.$Level.'</td>'. 132 86 '<td align="center">'.$member[4].' ('.$member[1].')</td>'. 133 '<td align="center">'.$lastlogin.'</td>'. 134 '<td align="center">'.(($online['online']) ? '<img src="imgs/inc/on.gif" alt="online" />' : '<img src="imgs/inc/off.gif" alt="offline" />').'</td></td>'); 87 '<td align="center" style="color: '.$LogoutTimeColor.'">'.$LogoutTime.'</td>'. 88 '<td align="center">'.(($online['online']) ? '<img src="imgs/inc/on.gif" alt="online" />' : '<img src="imgs/inc/off.gif" alt="offline" />').'</td>'. 89 '</tr>'); 135 90 } 136 91 echo('</table>');
Note:
See TracChangeset
for help on using the changeset viewer.