2.0 add points to home page

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

    • 2.0 add points to home page

      Hello, there is a rank info code on the main page, but there are points in this code, the number of players, the ranking status, I just want to show the score I want to take the score in statistics anyway,
      can you help me in code support.

      thank you everyone

      example:



      I want to show the score in the ranking there
    • Zeus wrote:

      Hola, hay un código de información de clasificación en la página principal, pero hay puntos en este código, la cantidad de jugadores, el estado de la clasificación, solo quiero mostrar la puntuación. Quiero tomar la puntuación en las estadísticas de todos modos.
      ¿Puedes ayudarme en el soporte de código?

      gracias a todos

      ejemplo:

      [adjuntar=2443][/adjuntar]

      Quiero mostrar la puntuación en el ranking allí.
      Buscar ShowOverviewPage.class.php cambiar

      Source Code

      1. $rankInfo = sprintf($LNG['ov_userrank_info'], pretty_number($statData['total_points']), $LNG['ov_place'],
      2. $statData['total_rank'], $statData['total_rank'], $LNG['ov_of'], $config->users_amount);
      por

      Source Code

      1. $rankInfo = pretty_number($statData['total_points']);
      VERY SAD :/ :/ :/ :/
    • @yamilrh

      hello i have one more question i have done this process i ran it but can you give me a code that i can run on other pages i need to run that score on all the pages i can add


      update i am currently parsing the codes and it was successful in the buildings zone the code i made

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

    • Zeus wrote:

      hello i have one more question i have done this process i ran it but can you give me a code that i can run on other pages i need to run that score on all the pages i can add


      update i am currently parsing the codes and it was successful in the buildings zone the code i made
      If you want to do it on all your pages you just have to add the code directly in the AbstractGamePage.class file


      PHP Source Code

      1. protected function getNavigationData() {
      2. /** ADDON **/
      3. $sql = 'SELECT total_points, total_rank
      4. FROM %%STATPOINTS%%
      5. WHERE id_owner = :userId AND stat_type = :statType';
      6. $rankInfo = Database::get()->selectSingle($sql, array(
      7. ':userId' => $USER['id'],
      8. ':statType' => 1
      9. ));
      10. $this->assign(array(
      11. 'PlanetSelect' => $PlanetSelect,
      12. 'new_message' => $USER['messages'],
      13. 'vacation' => $USER['urlaubs_modus'] ? _date($LNG['php_tdformat'], $USER['urlaubs_until'], $USER['timezone']) : false,
      14. 'delete' => $USER['db_deaktjava'] ? sprintf($LNG['tn_delete_mode'], _date($LNG['php_tdformat'], $USER['db_deaktjava'] + ($config->del_user_manually * 86400)), $USER['timezone']) : false,
      15. 'darkmatter' => $USER['darkmatter'],
      16. 'current_pid' => $PLANET['id'],
      17. 'image' => $PLANET['image'],
      18. 'resourceTable' => $resourceTable,
      19. 'shortlyNumber' => $themeSettings['TOPNAV_SHORTLY_NUMBER'],
      20. 'closed' => !$config->game_disable,
      21. 'hasBoard' => filter_var($config->forum_url, FILTER_VALIDATE_URL, FILTER_FLAG_SCHEME_REQUIRED),
      22. 'hasAdminAccess' => !empty(Session::load()->adminAccess),
      23. 'hasGate' => $PLANET[$resource[43]] > 0,
      24. 'username' => $USER['username'],
      25. 'previousPlanet' => $previousPlanet['id'],
      26. 'nextPlanet' => $nextPlanet['id'],
      27. // ADDON
      28. 'rankInfo' => pretty_number($rankInfo['total_points']),
      29. ));
      30. }
      Display All
      enjoy
    • ben cammon php ye ekledim isdedigim sayfada gosterebiliorum

      Source Code

      1. $db = Database::get();
      2. $sql = "SELECT
      3. user.*,
      4. stat.total_points,
      5. stat.total_rank,
      6. COUNT(message.message_id) as messages
      7. FROM %%USERS%% as user
      8. LEFT JOIN %%STATPOINTS%% as stat ON stat.id_owner = user.id AND stat.stat_type = '1'
      9. LEFT JOIN %%MESSAGES%% as message ON message.message_owner = user.id AND message.message_unread = :unread
      10. WHERE user.id = :userId
      11. GROUP BY message.message_owner;";
      12. $USER = $db->selectSingle($sql, array(
      13. ':unread' => 1,
      14. ':userId' => $session->userId
      15. ));
      16. 'total_point => $USER['total_points'],
      Display All