alerts

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

  • Hey I forgot to post this along time ago, but you still are wondering how to get the alerts on the main nav working..here you go

    in the abstract add
    --------------------------------------------------------------------------------------------------
    $AJAX['ataks'] = $total['count'];

    $sql = "SELECT COUNT(*) as count FROM %%FLEETS%% WHERE fleet_start_time > :time AND fleet_mission = :missionId AND fleet_mess = 0 AND fleet_owner <> :userId AND fleet_target_owner = :userId;";
    $total = Database::get()->selectSingle($sql, array(
    ':userId' => $USER['id'],
    ':time' => TIMESTAMP,
    ':missionId' => 6
    ));
    $AJAX['spio'] = $total['count'];

    $sql = "SELECT COUNT(*) as count FROM %%FLEETS%% WHERE fleet_start_time > :time AND fleet_mission = :missionId AND fleet_mess = 0 AND fleet_owner <> :userId AND fleet_target_owner = :userId;";
    $total = Database::get()->selectSingle($sql, array(
    ':userId' => $USER['id'],
    ':time' => TIMESTAMP,
    ':missionId' => 9
    ));
    $AJAX['unic'] = $total['count'];

    $sql = "SELECT COUNT(*) as count FROM %%FLEETS%% WHERE fleet_start_time > :time AND fleet_mission = :missionId AND fleet_mess = 0 AND fleet_owner <> :userId AND fleet_target_owner = :userId;";
    $total = Database::get()->selectSingle($sql, array(
    ':userId' => $USER['id'],
    ':time' => TIMESTAMP,
    ':missionId' => 10
    ));
    $AJAX['rakets'] = $total['count'];


    and add in
    $this->assign(array(

    'ataks'=> $AJAX['ataks'],
    'spio'=> $AJAX['spio'],
    'unic'=> $AJAX['unic'],
    'rakets'=> $AJAX['rakets'],

    in main nav add:
    <div id="indicators">
    <div id="attack" class="indicator {if $ataks > 0}active_indicator{/if} tooltip" data-tooltip-content="{$LNG.customm_1}">
    <div class="icoi"></div>
    </div>
    <div id="espionage" class="indicator {if $spio > 0}active_indicator{/if} tooltip" data-tooltip-content="{$LNG.customm_4}" href="game.php?page=overview">
    <div class="icoi"></div>
    </div>
    <div id="destruction" class="indicator {if $unic > 0}active_indicator{/if} tooltip" data-tooltip-content="{$LNG.customm_3}">
    <div class="icoi"></div>
    </div>
    <div id="rocket" class="indicator {if $rakets > 0}active_indicator{/if} tooltip" data-tooltip-content="{$LNG.customm_5}">
    <div class="icoi"></div>
    </div>
    </div>
  • tellez wrote:

    No entiendo en que archivos agregar cada codigo de esos.
    Busca esto AbstractGamePage.class.php agrega dentro de la función protected function getNavigationData() antes de esto $this->assign(array(

    PHP Source Code: AbstractGamePage.class.php

    1. $AJAX['ataks'] = $total['count'];
    2. $sql = "SELECT COUNT(*) as count FROM %%FLEETS%% WHERE fleet_start_time > :time AND fleet_mission = :missionId AND fleet_mess = 0 AND fleet_owner <> :userId AND fleet_target_owner = :userId;";
    3. $total = Database::get()->selectSingle($sql, array(
    4. ':userId' => $USER['id'],
    5. ':time' => TIMESTAMP,
    6. ':missionId' => 6
    7. ));
    8. $AJAX['spio'] = $total['count'];
    9. $sql = "SELECT COUNT(*) as count FROM %%FLEETS%% WHERE fleet_start_time > :time AND fleet_mission = :missionId AND fleet_mess = 0 AND fleet_owner <> :userId AND fleet_target_owner = :userId;";
    10. $total = Database::get()->selectSingle($sql, array(
    11. ':userId' => $USER['id'],
    12. ':time' => TIMESTAMP,
    13. ':missionId' => 9
    14. ));
    15. $AJAX['unic'] = $total['count'];
    16. $sql = "SELECT COUNT(*) as count FROM %%FLEETS%% WHERE fleet_start_time > :time AND fleet_mission = :missionId AND fleet_mess = 0 AND fleet_owner <> :userId AND fleet_target_owner = :userId;";
    17. $total = Database::get()->selectSingle($sql, array(
    18. ':userId' => $USER['id'],
    19. ':time' => TIMESTAMP,
    20. ':missionId' => 10
    21. ));
    22. $AJAX['rakets'] = $total['count'];
    Display All

    Dentro de la misma función que agregaste el código anterior busca $this->assign(array(
    Luego de esto

    PHP Source Code

    1. 'hasGate' => $PLANET[$resource[43]] > 0,
    Agrega


    PHP Source Code

    1. 'ataks'=> $AJAX['ataks'],
    2. 'spio'=> $AJAX['spio'],
    3. 'unic'=> $AJAX['unic'],
    4. 'rakets'=> $AJAX['rakets'],
    Y luego en alguna parte del fichero main.navigaton.tpl lo siguiente


    HTML Source Code

    1. <div id="indicators">
    2. <div id="attack" class="indicator {if $ataks > 0}active_indicator{/if} tooltip" data-tooltip-content="{$LNG.customm_1}">
    3. <div class="icoi"></div>
    4. </div>
    5. <div id="espionage" class="indicator {if $spio > 0}active_indicator{/if} tooltip" data-tooltip-content="{$LNG.customm_4}" href="game.php?page=overview">
    6. <div class="icoi"></div>
    7. </div>
    8. <div id="destruction" class="indicator {if $unic > 0}active_indicator{/if} tooltip" data-tooltip-content="{$LNG.customm_3}">
    9. <div class="icoi"></div>
    10. </div>
    11. <div id="rocket" class="indicator {if $rakets > 0}active_indicator{/if} tooltip" data-tooltip-content="{$LNG.customm_5}">
    12. <div class="icoi"></div>
    13. </div>
    14. </div>
    Display All
    Todo esto lo saque del primer mensaje, deberías detenerte y leer los mensajes, siempre te dicen donde deben copiarse cada fragmento de código
    No probé si funciona, pero debería funcionarte
    VERY SAD :/ :/ :/ :/
  • remmeber if you use the alert the css has to be added

    Source Code

    1. <div id="indicators">
    2. <div id="attack" class="indicator {if $ataks > 0}active_indicator{/if} tooltip" data-tooltip-content="{$LNG.customm_1}">
    3. <div class="icoi"></div>
    4. </div>
    5. <div id="espionage" class="indicator {if $spio > 0}active_indicator{/if} tooltip" data-tooltip-content="{$LNG.customm_4}" href="game.php?page=overview">
    6. <div class="icoi"></div>
    7. </div>
    8. <div id="destruction" class="indicator {if $unic > 0}active_indicator{/if} tooltip" data-tooltip-content="{$LNG.customm_3}">
    9. <div class="icoi"></div>
    10. </div>
    11. <div id="rocket" class="indicator {if $rakets > 0}active_indicator{/if} tooltip" data-tooltip-content="{$LNG.customm_5}">
    12. <div class="icoi"></div>
    13. </div>
    14. </div>
    Display All


    Source Code

    1. #indicators{
    2. width: 235px;
    3. height: 20px;
    4. margin:5px auto;
    5. background: none;
    6. margin-bottom:14px;
    7. position: relative;
    8. }
    9. #indicators .indicator{
    10. width: 49.5px;
    11. height: 23px;
    12. padding:1px;
    13. margin-left: 3px;
    14. -moz-border-radius: 3px;
    15. -webkit-border-radius: 3px;
    16. border-radius: 3px;
    17. float:left;
    18. /*cursor:help !important;*/
    19. background: #050f20;
    20. border-bottom: 1px solid rgba(0,0,0,0.3);
    21. border-top: 1px solid rgba(0,0,0,0.3);
    22. border: 1px solid #000c;
    23. box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.25), 0 1px rgba(255, 255, 255, 0.04);
    24. }
    25. #indicators .indicator .icoi{
    26. width: 23px;
    27. height: 23px;
    28. background-position:left top;
    29. background-size:cover;
    30. }
    31. #attack .icoi{
    32. background:url(./img/iconav/attack.png) no-repeat;
    33. }
    34. #destruction .icoi{
    35. background:url(./img/iconav/destruction.png) no-repeat;
    36. }
    37. #espionage .icoi{
    38. background:url(./img/iconav/espionage.png) no-repeat;
    39. }
    40. #rocket .icoi{
    41. background:url(./img/iconav/rocket.png) no-repeat;
    42. }
    43. #grab .icoi{
    44. background:url(./img/iconav/grab.png) no-repeat;
    45. }
    46. #attack{
    47. }
    48. #grab{
    49. margin-left:5px !important;
    50. }
    51. #destruction{
    52. margin-left:5px !important;
    53. }
    54. #espionage{
    55. margin-left: 5px !important;
    56. }
    57. #rocket{
    58. margin-left:5px !important;
    59. }
    60. #indicators .active_indicator{
    61. background:#e61000;
    62. -moz-box-shadow: 0px 0px 3px #ff1300;
    63. -webkit-box-shadow: 0px 0px 3px #ff1300;
    64. box-shadow: 0px 0px 3px #ff1300;
    65. -moz-box-shadow: 0px 0px 2px #ff1300, 0px 0px 2px #ff1300, 0px 0px 2px #ff1300, 0px 0px 2px #ff1300, 0px 0px 1px #ff1300;
    66. -webkit-box-shadow: 0px 0px 2px #ff1300, 0px 0px 2px #ff1300, 0px 0px 2px #ff1300, 0px 0px 2px #ff1300, 0px 0px 1px #ff1300;
    67. box-shadow: 0px 0px 2px #ff1300, 0px 0px 2px #ff1300, 0px 0px 2px #ff1300, 0px 0px 2px #ff1300, 0px 0px 1px #ff1300;
    68. filter: progid:DXImageTransform.Microsoft.gradient(startColorstr = '#ff1300', endColorstr = '#c30f00');
    69. -ms-filter: "progid:DXImageTransform.Microsoft.gradient(startColorstr = '#ff1300', endColorstr = '#c30f00')";
    70. background-image: -moz-linear-gradient(top, #ff1300, #c30f00);
    71. background-image: -ms-linear-gradient(top, #ff1300, #c30f00);
    72. background-image: -o-linear-gradient(top, #ff1300, #c30f00);
    73. background-image: -webkit-gradient(linear, center top, center bottom, from(#ff1300), to(#c30f00));
    74. background-image: -webkit-linear-gradient(top, #ff1300, #c30f00);
    75. background-image: linear-gradient(top, #ff1300, #c30f00);
    76. border:1px solid #ff1300;
    77. }
    78. #indicators .active_indicator .icoi{
    79. background-position:bottom !important;
    80. }
    Display All
  • sorry i forgot to you will need to add ShowScanPage.class.php, plus the files in my original post to have the indicators plus the sound in real time

    go here Busco algún mod de alarma to complete this mod

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