Reuven

About me: Amateur web developer - Professional volunteer :)

Send private message

You must be logged in to send a private message.

Friends

No friends yet.

Group membership

Activity

  • Reuven replied on the discussion topic Tidypics - wrap the sidebar links with DIV
    Thank you iionly. I'll proceed with JS, but if a solution popups in your mind please post it here. Thanks and a happy new year view reply
  • Reuven replied on the discussion topic Minor changes to vendor files
    Works great. views/default/elgg.js.php is new to me... good to know :) Thank you very much RvR view reply
  • Reuven replied on the discussion topic Minor changes to vendor files
    I want to add a "close" text to the system messages, e.g. <p style="text-align: right; color: #e8f907;">close</p>. ​Below you'll see my added code to messages.php and elgglib.js. It works well... view reply
  • Reuven added a new discussion topic Minor changes to vendor files in the group Plugin Development
    I need to introduce a minor change to the messages in each of the following files: path/vendor/elgg/elgg/js/lib/elgglib.js   path/vendor/elgg/elgg/views/default/page/elements/messages.php Should I overwrite these pages in my...
    • I want to add a "close" text to the system messages, e.g. <p style="text-align: right; color: #e8f907;">close</p>.

      ​Below you'll see my added code to messages.php and elgglib.js. It works well when I change the core (temporarily of course). I've not yet overridden it with a plugin but I believe it will work. However, I think that since the system messages are triggered by events, it should be possible to add the code through a plugin hook, but I do not know how to do it.

      Thank you very much.

      --------------------------------------------- 

      In messages.php the code is:

      please note my added code in the comment "my addition". 

      echo '<ul class="elgg-system-messages">';
      
      
      // hidden li so we validate
      
      echo '<li class="hidden"></li>';
      
      
      if (isset($vars['object']) && is_array($vars['object']) && sizeof($vars['object']) > 0) {
      
      foreach ($vars['object'] as $type => $list ) {
      
      foreach ($list as $message) {
      
      echo "<li class=\"elgg-message elgg-state-$type\">";
      
      echo elgg_autop($message);
      
      echo '<p style="text-align: right; color: #e8f907;">close</p>';//==== my addition
      
      echo '</li>';
      
      }
      
      }
      
      }
      
      
      echo '</ul>';

      And in elgglib.js, the code is:

      please note my added code in the comment "my addition". 

      elgg.system_messages = function(msgs, delay, type) {
      
      if (elgg.isUndefined(msgs)) {
      
      return;
      
      }
      
      
      var classes = ['elgg-message'],
      
      messages_html = [],
      
      appendMessage = function(msg) {
      
      messages_html.push('<li class="' + classes.join(' ') + '"><p>' + msg + 
      '</p><p style="text-align: right; color: #e8f907;">close</p></li>');//=== my addition
      
      },
      
      systemMessages = $('ul.elgg-system-messages'),
      
      i;
      
      .... etc....

       

       

       

       

    • Just override this view:

      views/default/page/elements/messages.php

      as

      /mod/your_plugin/views/default/page/elements/messages.php

      And this:

      views/default/elgg.js.php

      as

      /mod/your_plugin/views/default/elgg.js.php

      Where add location of your rewritted elgglib.js instead of

      $elggDir->getPath("js/lib/elgglib.js"),
    • Works great.

      views/default/elgg.js.php is new to me... good to know :)

      Thank you very much RvR

  • Reuven replied on the discussion topic Fatal error with image upload
    And warm regards to ColdTrick as well :) view reply
  • Reuven replied on the discussion topic Fatal error with image upload
    Works perfectly especially with the plugin. Thank you very much Well done RVR view reply
  • Reuven added a new discussion topic Fatal error with image upload in the group Plugin Development
    I try to upload an image (for group cover image): 4050 X 2727 pixels, 967 KB , and receive a fatal error:  Fatal error: Allowed memory size of 67108864 bytes exhausted (tried to allocate 1321326 bytes)...
  • Reuven replied on the discussion topic Tidypics - wrap the sidebar links with DIV
    Thank yo iionly, I tried a few options but nothing came out. It seems that I do not understand. Could you please give me an example. Thank yo very much view reply