mirror of
				https://github.com/slawkens/myaac.git
				synced 2025-10-30 23:46:24 +01:00 
			
		
		
		
	and https://otland.net/threads/myaac-v0-0-1.251454/page-7#post-2444035
This commit is contained in:
		| @@ -120,6 +120,7 @@ define('USE_ACCOUNT_NAME', fieldExist('name', 'accounts')); | |||||||
| $tmp = ''; | $tmp = ''; | ||||||
| if($cache->enabled() && $cache->fetch('vocations', $tmp)) { | if($cache->enabled() && $cache->fetch('vocations', $tmp)) { | ||||||
| 	$config['vocations'] = unserialize($tmp); | 	$config['vocations'] = unserialize($tmp); | ||||||
|  | 	$config['vocation_last'] = $cache->get('vocation_last'); | ||||||
| } | } | ||||||
| else { | else { | ||||||
| 	$vocations = new DOMDocument(); | 	$vocations = new DOMDocument(); | ||||||
| @@ -135,14 +136,15 @@ else { | |||||||
| 	$config['vocations'] = array(); | 	$config['vocations'] = array(); | ||||||
| 	foreach($vocations->getElementsByTagName('vocation') as $vocation) { | 	foreach($vocations->getElementsByTagName('vocation') as $vocation) { | ||||||
| 		$id = $vocation->getAttribute('id'); | 		$id = $vocation->getAttribute('id'); | ||||||
| 		//if($id == $vocation->getAttribute('fromvoc')) | 		if($id == $vocation->getAttribute('fromvoc')) | ||||||
|  | 			$config['vocation_last'] = $id; | ||||||
|  |  | ||||||
| 		$config['vocations'][$id] = $vocation->getAttribute('name'); | 		$config['vocations'][$id] = $vocation->getAttribute('name'); | ||||||
| 		//else |  | ||||||
| 		//	$config['vocations'][$id] = $vocation->getAttribute('name'); |  | ||||||
| 	} | 	} | ||||||
|  |  | ||||||
| 	if($cache->enabled()) { | 	if($cache->enabled()) { | ||||||
| 		$cache->set('vocations', serialize($config['vocations']), 120); | 		$cache->set('vocations', serialize($config['vocations']), 120); | ||||||
|  | 		$cache->set('vocation_last', $config['vocation_last'], 120); | ||||||
| 	} | 	} | ||||||
| } | } | ||||||
| unset($tmp, $id, $vocation); | unset($tmp, $id, $vocation); | ||||||
|   | |||||||
| @@ -316,8 +316,8 @@ if($action == 'show') | |||||||
| 					if($level_in_guild > $rank->getLevel() || $guild_leader) | 					if($level_in_guild > $rank->getLevel() || $guild_leader) | ||||||
| 						if($guild_leader_char->getName() != $player->getName()) | 						if($guild_leader_char->getName() != $player->getName()) | ||||||
| 							echo ' <font size=1>{<a href="?subtopic=guilds&action=kickplayer&guild='.urlencode($guild->getName()).'&name='.urlencode($player->getName()).'">KICK</a>}</font>'; | 							echo ' <font size=1>{<a href="?subtopic=guilds&action=kickplayer&guild='.urlencode($guild->getName()).'&name='.urlencode($player->getName()).'">KICK</a>}</font>'; | ||||||
| 					if($player->isOnline()) | 					//if($player->isOnline()) | ||||||
| 						$s_members_online++; | 					//	$s_members_online++; | ||||||
| 					echo '</FORM></TD><TD align="right" width="10%">'.$player->getLevel().'</TD><TD align="right" width="20%"><font color="'.($player->isOnline() ? 'green"><b>Online' : 'red"><b>Offline').'</b></font></TD></TR>'; | 					echo '</FORM></TD><TD align="right" width="10%">'.$player->getLevel().'</TD><TD align="right" width="20%"><font color="'.($player->isOnline() ? 'green"><b>Online' : 'red"><b>Offline').'</b></font></TD></TR>'; | ||||||
| 				} | 				} | ||||||
| 				echo '</TABLE></TD></TR>'; | 				echo '</TABLE></TD></TR>'; | ||||||
|   | |||||||
| @@ -52,7 +52,12 @@ if($config['online_outfit']) { | |||||||
| 	} | 	} | ||||||
| } | } | ||||||
|  |  | ||||||
| $vocs = array(0, 0, 0, 0, 0); | if($config['online_vocations']) { | ||||||
|  | 	$vocs = array(); | ||||||
|  | 	foreach($config['vocations'] as $id => $name) | ||||||
|  | 		$vocs[$id] = 0; | ||||||
|  | } | ||||||
|  |  | ||||||
| if(tableExist('players_online')) // tfs 1.0 | if(tableExist('players_online')) // tfs 1.0 | ||||||
| 	$playersOnline = $db->query('SELECT `accounts`.`country`, `players`.`name`, `level`, `vocation`' . $outfit . ', `' . $skull_time . '` as `skulltime`, `' . $skull_type . '` as `skull` FROM `accounts`, `players`, `players_online` WHERE `players`.`id` = `players_online`.`player_id` AND `accounts`.`id` = `players`.`account_id`  ORDER BY ' . $order); | 	$playersOnline = $db->query('SELECT `accounts`.`country`, `players`.`name`, `level`, `vocation`' . $outfit . ', `' . $skull_time . '` as `skulltime`, `' . $skull_type . '` as `skull` FROM `accounts`, `players`, `players_online` WHERE `players`.`id` = `players_online`.`player_id` AND `accounts`.`id` = `players`.`account_id`  ORDER BY ' . $order); | ||||||
| else | else | ||||||
| @@ -90,6 +95,7 @@ foreach($playersOnline as $player) | |||||||
| 		<td>'.$config['vocations'][$player['vocation']].'</td> | 		<td>'.$config['vocations'][$player['vocation']].'</td> | ||||||
| 	</tr>'; | 	</tr>'; | ||||||
|  |  | ||||||
|  | 	if($config['online_vocations']) | ||||||
| 		$vocs[$player['vocation']]++; | 		$vocs[$player['vocation']]++; | ||||||
| } | } | ||||||
|  |  | ||||||
| @@ -180,7 +186,7 @@ if($config['online_vocations']): ?> | |||||||
| 			</tr> | 			</tr> | ||||||
|  |  | ||||||
| 		<?php | 		<?php | ||||||
| 			for($i = 1; $i < 5; $i++) | 			for($i = 1; $i <= $config['vocation_last']; $i++) | ||||||
| 			echo '<tr bgcolor="' . getStyle($i) . '"> | 			echo '<tr bgcolor="' . getStyle($i) . '"> | ||||||
| 				<td width="25%">' . $config['vocations'][$i] . '</td> | 				<td width="25%">' . $config['vocations'][$i] . '</td> | ||||||
| 				<td width="75%">' . $vocs[$i] . '</td> | 				<td width="75%">' . $vocs[$i] . '</td> | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 slawkens1
					slawkens1