Error in Sent message (I cant delete message)

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

    • Error in Sent message (I cant delete message)

      Hi everyone ^^
      I have error with messages, i cant delete sent messages. 2moons/steemnova engine.
      I search help on steemnova github but no one was able to help. Maybe you can help? What to look for in the code? What could be causing the error?
    • You can also use the code in the admin panel to manage the deletion of messages which will allow you to empty your database without having to wait for the execution of the cron
    • I didn't get your question, and i am answering by assuming your cronjob is not working ?

      Find includes/cronjob/CleanerCronjob.class.php

      check if this presents $del_before = TIMESTAMP - ($config->del_oldstuff * 86400);

      $sql = 'DELETE FROM %%MESSAGES%% WHERE `message_time` < :time;';
      Database::get()->delete($sql, array(
      ':time' => $del_before
      ));

      if it seems OK then you have no problems with your code (default code) and you need your cronjob working,
      ogniter.net

      for a slightly better version of steemnova

      github.com/koraykarakus/steemnova-1.8-x
    • en styles/templates/game/page.messages.view.tpl

      Añade

      HTML Source Code

      1. <i class="fas fa-times right" style="font-size: 15px; color: red;" onclick="msgDel({$Message.id}, {$MessID}); Message.getMessages({$MessID}); return false;"></i>




      En scripts/game/message.js

      Añade


      JavaScript Source Code

      1. function msgDel(MessID, MessType)
      2. {
      3. curUnread = MessID;
      4. Message.MessID = MessType;
      5. Message.MessageCount(MessType);
      6. $('#loading').show();
      7. $.get('game.php?page=messages&mode=delonemsg&MsgID='+MessID+'&ajax=1', function(data) {
      8. $('#loading').hide();
      9. NotifyBox(data);
      10. });
      11. }
      Display All
      y en includes/pages/game/ShowMessagesPage.class.php

      Añade


      PHP Source Code

      1. function delonemsg()
      2. {
      3. global $LNG, $USER;
      4. $MsgID = HTTP::_GP('MsgID', 100);
      5. $sql = "SELECT COUNT(*) as state FROM %%MESSAGES%% WHERE message_owner = :userId AND message_id = :message_id;";
      6. $MessageCount = database::get()->selectSingle($sql, array(
      7. ':userId' => $USER['id'],
      8. ':message_id' => $MsgID,
      9. ), 'state');
      10. if(empty($MessageCount)){
      11. echo $LNG['msgt_88'];
      12. }else{
      13. $sql = "DELETE FROM %%MESSAGES%% WHERE message_owner = :userId AND message_id = :message_id;";
      14. database::get()->delete($sql, array(
      15. ':userId' => $USER['id'],
      16. ':message_id' => $MsgID,
      17. ));
      18. echo $LNG['msgt_88'];
      19. }
      20. }
      Display All


      En language/tu lenguaje/CUSTOM.php

      Añade

      $LNG['msgt_88'] = 'Mensaje eliminado';
      In The end
    • m4ti wrote:

      Ala wrote:

      ...
      @Ala El método no funciona. ¿Quizás será más fácil cuando les muestre los archivos?megawrzuta.pl/filesgroup/ae856…ab7cf7006a727bea7322.html
      aquí hay 3 archivos






      Tal ves estés haciendo algo mal por que si funciona asegúrate que le hallas borrado el historial a tu navegador para que se te apliquen los cambios
      In The end
    • Ala wrote:

      function delonemsg()
      {
      global $LNG, $USER;
      $MsgID = HTTP::_GP('MsgID', 100);

      $sql = "SELECT COUNT(*) as state FROM %%MESSAGES%% WHERE message_owner = :userId AND message_id = :message_id;";
      $MessageCount = database::get()->selectSingle($sql, array(
      ':userId' => $USER['id'],
      ':message_id' => $MsgID,
      ), 'state');

      if(empty($MessageCount)){
      echo $LNG['msgt_88'];
      }else{
      $sql = "DELETE FROM %%MESSAGES%% WHERE message_owner = :userId AND message_id = :message_id;";
      database::get()->delete($sql, array(
      ':userId' => $USER['id'],
      ':message_id' => $MsgID,
      ));
      echo $LNG['msgt_88'];
      }
      }
      Debes añadir esta función en tu ShowMessagesPage.class.php
      In The end
    • @Ala

      Gracias por su respuesta
      <i class="fas fa-times right" style="font-size: 15px; color: red;" onclick="msgDel({$Message.id}, {$MessID}); Message.getMessages({$MessID}); return false;"></i>
      Este fragmento hace que los mensajes no se abran en absoluto

      ¿Quizás estoy poniendo estos fragmentos en el lugar equivocado? Envié los archivos de arriba, ¿puedes editarlos y enviarlos de vuelta? ¿Es demasiado trabajo?





    • Como ves en la imagen solo tienes que sustituir los archivos que te envío en este comprimido y borrar el historial de navegación en tu navegador y listo al dar en la cruz roja se eliminara el mensaje
      Files
      • message.zip

        (5.44 kB, downloaded 291 times, last: )
      In The end
    • @Ala

      Lo siento, después de copiar los archivos, los estilos no se cargan correctamente y no tengo el ícono de eliminar mensaje. Analizaré tus archivos y tal vez se pueda hacer algo.


      El problema está más bien en el archivo .tpl solo porque después de copiar los archivos .php y .js restantes, no sucede nada malo
    • Ala wrote:

      Después de cambiar loa ficheros que te di solo tienes que eliminar el historial de navegación en tu navegador para que se te apliques los cambios
      Limpié el caché en el lugar, de todos modos rompen el estilo.

      lo intentaré otra vez
    • I am not familiar to version you use but

      if you cannot see message button then try changing class

      from "fas fa -times to "fa fa-times" meaning remove the "s" letter.

      other than this you need to send AJAX request to delete message

      example and not forgot to exit at the end of ajax..
      ogniter.net

      for a slightly better version of steemnova

      github.com/koraykarakus/steemnova-1.8-x