Bonjour ! Depuis quelques jours j'essaye de concevoir une petite modification pour le menu des planètes. En effet, lorsque le joueur à plusieurs planètes, et que sur chacune de ces planètes il y'a une Lune, le menu est très vite encombré (L'idée existe déjà dans la version officielle du jeu) L'idée en image Avant: Après: Merci à Homer pour le code !! class.template.php //PlanetMenu if(empty($this->UserPlanets)) $this->getplanets(); $this->loadscript("planetmenu.js"); $this->loadscript("topnav.js"); $this->execscript("PlanetMenu();"); $this->phpself = "?page=".request_var('page', '')."&mode=".request_var('mode', ''); $PlanetSelect = array(); $Scripttime = array(); foreach($this->UserPlanets as $CurPlanetID => $PlanetQuery) { if(!empty($PlanetQuery['b_building_id'])) { $QueueArray = explode(";", $PlanetQuery['b_building_id']); $ActualCount = count($QueueArray); for ($ID = 0; $ID < $ActualCount; $ID++) { $ListIDArray = explode(",", $QueueArray[$ID]); if($ListIDArray[3] > TIMESTAMP) $Scripttime[$PlanetQuery['id']][] = $ListIDArray[3]; } } if($PlanetQuery['planet_type'] == 3) { $Query = "S ELECT `id` FROM ".PLANETS." WHERE `galaxy` = '".$PlanetQuery['galaxy']."' AND `system` = '".$PlanetQuery['system']."' AND `planet` = '".$PlanetQuery['planet']."' ;"; $PID = $db->uniquequery($Query); $Planetlist[$PID['id']]['moon'] = array ( 'url' => $this->phpself."&cp=".$PlanetQuery['id'], 'name' => $PlanetQuery['name'].(($PlanetQuery['planet_type'] == 3) ? " (".$LNG['fcm_moon'].")":""), 'image' => $PlanetQuery['image'], 'galaxy' => $PlanetQuery['galaxy'], 'system' => $PlanetQuery['system'], 'planet' => $PlanetQuery['planet'], 'ptype' => $PlanetQuery['planet_type'], ); continue; } $Planetlist[$PlanetQuery['id']] = array( 'url' => $this->phpself."&cp=".$PlanetQuery['id'], 'name' => $PlanetQuery['name'].(($PlanetQuery['planet_type'] == 3) ? " (".$LNG['fcm_moon'].")":""), 'image' => $PlanetQuery['image'], 'galaxy' => $PlanetQuery['galaxy'], 'system' => $PlanetQuery['system'], 'planet' => $PlanetQuery['planet'], 'ptype' => $PlanetQuery['planet_type'], 'moon' => "" ); $PlanetSelect[$this->phpself."&cp=".$PlanetQuery['id']] = $PlanetQuery['name'].(($PlanetQuery['planet_type'] == 3) ? " (" . $LNG['fcm_moon'] . ")":"")." [".$PlanetQuery['galaxy'].":".$PlanetQuery['system'].":".$PlanetQuery['planet']."] "; } ATTENTION: Il faut enlever l'espace dans la requête SQL au niveau du S ELECT => SELECT planet_menu.tpl <div id="planet_menu"> <div id="planet_menu_header"><a href="javascript:ShowPlanetMenu()" id="planet_menu_link"><font color="red">>></font> {$show_planetmenu}</a></div> <div id="planet_menu_content"{if $is_pmenu == 0} style="display:none;"{/if}> <table style="text-align:center;margin:0"> <tr> {foreach key=PlanetID item=PlanetInfo from=$PlanetMenu} <td class="transparent" style="width:80px;"> <a href="{$PlanetInfo.url}" title="{$PlanetInfo.name}"> <img src="styles/theme/{$Raza_skin}/planeten/small/s_{$PlanetInfo.image}.png" height="35" width="35" alt="{$PlanetInfo.name}" /> <br /> {if $PlanetID == $current_pid} <div class="plt"> <span style="color:red" class="planetname"><b>{$PlanetInfo.name}</b></span> <br /> <span style="color:white"><b>[{$PlanetInfo.galaxy}:{$PlanetInfo.system}:{$PlanetInfo.planet}]</b></span> {if $PlanetInfo.moon != ""} <div class="moonplt"> <a href="{$PlanetInfo.moon.url}" title="{$PlanetInfo.moon.name}"> <img src="styles/theme/{$Raza_skin}/planeten/small/s_{$PlanetInfo.moon.image}.png" height="20" width="20" alt="{$PlanetInfo.moon.name}" /> </a> </div> {/if} </div> {else} <div class="plt"> <span style="color:#69C3FB"> {$PlanetInfo.name}</span> <br /> <span style="color:grey">[{$PlanetInfo.galaxy}:{$PlanetInfo.system}:{$PlanetInfo.planet}]</span> {if $PlanetInfo.moon != ""} <div class="moonplt"> <a href="{$PlanetInfo.moon.url}" title="{$PlanetInfo.moon.name}"> <img src="styles/theme/{$Raza_skin}/planeten/small/s_{$PlanetInfo.moon.image}.png" height="20" width="20" alt="{$PlanetInfo.moon.name}" /> </a> </div> {/if} </div> {/if} <br /><span id="planet_{$PlanetID}"></span> </a> </td> {/foreach} </tr> </table> </div> </div> <script type="text/javascript"> planetmenu = {$Scripttime}; </script> formato.css /* MENU DE PLANETAS */ #planet_menu { width:100%; position:fixed; bottom:0px; z-index:2; } #planet_menu_link{ font-weight:700; text-decoration: none; position:relative; top:5px; } #planet_menu_header{ background:url(imagenes/navegacion/barra_planetas.png) no-repeat right; height:21px; text-align:right; padding: 0px 10px 0px 0px; } #planet_menu_content{ background:url(imagenes/bg_planetas.png) repeat-x transparent; text-align:center; padding-top: 10px; overflow: auto; } .plt { position: relative; }
.moonplt { position: absolute; top: -35px; right: 10px; } /* END MENU DE PLANETAS */
|