[MOD][STYLE] Navigation menu

    This site uses cookies. By continuing to browse this site, you are agreeing to our Cookie Policy.

    • [MOD][STYLE] Navigation menu

      hier ist das 2 spalten menü mit angriffswarnung, wie gewünscht. für 1.8.x und 1.7.3
      die warnung aktualisiert sich alle 10 sekunden. das interval kann eingestellt werden. somit ist die warnung immer aktuell.
      wenn die warnung rot ist, blinkt sie sanft.

      bitte lest die readme datei aufmerksam.
      hinzufügen und kopieren sind zwei unterschiedliche sachen. ;)



      Files
    • then show me the errors :)
      did u took the 1,7 version?
      did u followed the readme?
      did u understood the difference between add and copy?

      there could be some errors, if 1.8 tpl is not identical to 1.7 tpl, didnt tested it. have no clean 1.7 version installed. my 1.7 dont uses this menu at all...
      and i was to lazy to install a net 2moons for this little mod...

      if u checked the points aboth, and u can answer them all with 'yes'.
      pls send me ur errormessages.
    • Make a double menu like in Xterium for 2moons 1.7.3 and 1.8 please without attack indicators
    • bugfix

      the javascript for the base.js loads a page and insert the answer in the menu. when the session is expired the indexpage is loaded. the script trys to insert this into the menu, wich causes a grafic glitch.
      therefor replace the given script aboth with this one.
      i'll update the zips in the first post, so if you have downloaded after this post 16.9.2017 2:26 this change is already included.

      JavaScript Source Code

      1. function attacken(){
      2. var alarmdiv = document.getElementById("alarm");
      3. var xmlhttp = new XMLHttpRequest();
      4. var url = "game.php?page=scan";
      5. xmlhttp.onreadystatechange = function() {
      6. if (xmlhttp.readyState == 4 && xmlhttp.status == 200) {
      7. if (isNaN(xmlhttp.responseText)){
      8. alarmdiv.innerHTML = 'disconnected';
      9. alarmdiv.style.background = 'red';
      10. alarmdiv.setAttribute('class', 'atta');
      11. }else{
      12. if(xmlhttp.responseText != '0'){
      13. alarmdiv.innerHTML = xmlhttp.responseText + ' ' + alarmtext;
      14. alarmdiv.style.background = 'red';
      15. alarmdiv.setAttribute('class', 'atta');
      16. }else{
      17. alarmdiv.innerHTML = xmlhttp.responseText + ' ' + alarmtext;
      18. alarmdiv.setAttribute('class', '');
      19. alarmdiv.style.background = 'rgba(0,200,0,0.2)';
      20. }
      21. }
      22. }
      23. };
      24. xmlhttp.open("GET", url, true);
      25. xmlhttp.send();
      26. }
      Display All
      also fixed a grafic glitch with some resolutions, therefor changed the part for the format.css (this change is also inserted in the zips of the first post)

      CSS Source Code

      1. /** new 2colum menu **/
      2. #page {
      3. margin-left: 258px;
      4. }
      5. #menu div{
      6. text-align:left;
      7. }
      8. #menu td{
      9. vertical-align:top;
      10. }
      11. #menu a{
      12. font-weight: bold;
      13. font-size: 1.1em;
      14. padding: 4px 10px !important;
      15. }
      16. .menu-footer {
      17. background-size: 100%;
      18. }
      19. .menu-head {
      20. background-size: 100% 129% !important;
      21. }
      22. #leftmenu {
      23. width: 258px;
      24. }
      25. #leftmenu table{
      26. width: 258px;
      27. }
      28. #alarm {
      29. background: green;
      30. margin: 2px 6px;
      31. padding: 2px;
      32. }
      33. .atta {
      34. -webkit-animation-name: atta; /* Safari 4.0 - 8.0 */
      35. -webkit-animation-duration: 4s; /* Safari 4.0 - 8.0 */
      36. -webkit-animation-iteration-count: infinite; /* Safari 4.0 - 8.0 */
      37. animation-name: atta;
      38. animation-duration: 4s;
      39. animation-iteration-count: infinite;
      40. }
      41. /** new 2colum menu end**/
      Display All
    • falls jemmand auch nen roten balken haben möchte falls ein mond zerstört werden soll einfach die
      showscanpage.class.php
      mit folgendem code ersetzen:


      PHP Source Code

      1. <?php
      2. class ShowScanPage extends AbstractGamePage
      3. {
      4. function __construct()
      5. {
      6. parent::__construct();
      7. }
      8. function Show()
      9. {
      10. global $USER;
      11. $db = Database::get();
      12. $Alarm = $db->selectSingle("SELECT COUNT(`fleet_target_owner`) as nr
      13. FROM uni".$USER['universe']."_fleets WHERE `fleet_target_owner` = '". $USER['id'] ."' AND (`fleet_mission` = '1' OR `fleet_mission` = '2' OR `fleet_mission` = '9') AND `fleet_mess` ='0';");
      14. echo $Alarm['nr'];
      15. exit;
      16. }
      17. }
      Display All
      danke nochmal mimikri für deine klasse arbeit! :)
    • Dazu eine Frage bitte,
      wenn da wo "XX Angriffe" in grün oder rot einfach nur steht "disconnected" in rot unterlegt, was könnte das sein ?
      ist das ein Fehler bei mir ?

      The post was edited 1 time, last by agony ().

    • die leiste wird von einem js betrieben und ruft alle 10 sec eine seite auf, diese liefert die zahl der angriffe. diskonnected heißt dass die antwort keine zahl ist, das kann sein weil die session abgelaufen ist, dann wäre es die loginseite. das kann sein weil die aufgerufene seite nicht exisitert(datei nicht kopiert) oder weil sie einen fehler verursacht(zb. in version 1.7), oder weil es keine internetverbndung gibt, die firewall den zugriff blockiert...
    • Как это всё просто делается, если что то не правильно поправите сами.

      Вставляете куда хотите

      /------------------------------------------------------------------------/

      #ataka {
      float: left;
      width: 119px;
      height: 33px;
      -moz-border-radius: 16px;
      -webkit-border-radius: 16px;
      border-radius: 16px;
      margin-left: 10px;
      background: rgba(0,0,0,0.1);
      }

      /----------------------------------/

      <div id="ataka"></div>

      /------------------------------------------------------------------------/

      У меня находится в topnav.js

      var refreshId = setInterval(function() {
      $('#ataka').load('game.php?page=scan');
      }, 7000);

      /------------------------------------------------------------------------/

      <?php
      class ShowScanPage extends AbstractGamePage
      {
      function __construct()
      {
      parent::__construct();
      }

      function Show()
      {
      global $USER;
      $db = Database::get();

      $Alarm1_2 = $db->selectSingle("SELECT fleet_mission, COUNT(`fleet_mission`) as nrs FROM uni" . $USER['universe'] . "_fleets WHERE `fleet_target_owner` = '" . $USER['id'] . "' AND (`fleet_mission` = '1' OR `fleet_mission` = '2') AND `fleet_mess` ='0';");
      $Alarm6 = $db->selectSingle("SELECT fleet_mission, COUNT(`fleet_mission`) as nrsr FROM uni" . $USER['universe'] . "_fleets WHERE `fleet_target_owner` = '" . $USER['id'] . "' AND (`fleet_mission` = '6') AND `fleet_mess` ='0';");
      $Alarm10 = $db->selectSingle("SELECT fleet_mission, COUNT(`fleet_mission`) as nr FROM uni" . $USER['universe'] . "_fleets WHERE `fleet_target_owner` = '" . $USER['id'] . "' AND (`fleet_mission` = '10') AND `fleet_mess` ='0';");

      if ($Alarm1_2['fleet_mission'] == 1 || $Alarm1_2['fleet_mission'] == 2) {
      echo "<div class=\"attackik tooltip\" data-tooltip-content=\"Внимание! Вас атакуют!\">";
      echo $Alarm1_2['nrs'];
      echo "</div>";
      } else {
      echo "<div class=\"orbit_fl tooltip\" data-tooltip-content=\"На Вашу империю нет атак.\">";
      echo "</div>";
      }
      if ($Alarm6['fleet_mission'] == 6) {
      echo "<div class=\"scaningsi tooltip\" data-tooltip-content=\"Внимание! Вашу империю сканируют!\">";
      echo $Alarm6['nrsr'];
      echo "</div>";
      } else {
      echo "<div class='orbit_fls tooltip' data-tooltip-content=\"Вашу империю не сканируют.\">";
      echo "</div>";
      }
      if ($Alarm10['fleet_mission'] == 10) {
      echo "<div class=\"rocketsi tooltip\" data-tooltip-content=\"Внимание! На вас летят ракеты!\">";
      echo $Alarm10['nr'];
      echo "</div>";
      } else {
      echo "<div class='rocket_fls tooltip' data-tooltip-content=\"На Вашу империю не летят ракеты.\">";
      echo "</div>";
      }
      exit();
      $Alarm1_2 = Database::disconnect();
      $Alarm6 = Database::disconnect();
      $Alarm10 = Database::disconnect();
      }
      }

      /------------------------------------------------------------------------/

      Вот пример класса

      .attackik {
      -moz-border-radius: 16px;
      -webkit-border-radius: 16px;
      border-radius: 16px;
      background: url('./images/ico/attack-1.png') no-repeat rgba(0,0,0,0.3);
      padding-left: 0px;
      margin-left: 0px;
      margin-top: 0px;
      width: 33px;
      height: 33px;
      float: left;
      }
      .orbit_fl {
      -moz-border-radius: 16px;
      -webkit-border-radius: 16px;
      border-radius: 16px;
      background: url('./images/ico/orbit_fl.png') no-repeat rgba(0,0,0,0.3);
      padding-left: 0px;
      margin-left: 0px;
      margin-top: 0px;
      width: 33px;
      height: 33px;
      float: left;
      }

      Остальные сами сделаете как вам понравится.

      На каждое действие показывает своё количество

      The post was edited 6 times, last by Klon ().

    • можно в жопу даже вставить :D
      At the moment I'm working on versions of 2moons 1.8-1.9-2.0-2.1
      --------------------------------------------------------------------------------

      My personal game
      coswars - Open