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 added a new discussion topic JS errors in Market plugin in the group Plugin Development
    Elgg 2.3.10 Market plugin 2.3 I try the plugin and initially it seems to work fine, but I receive javascript errors: equire.js:1961 GET ww.example.org/cache/0/default/market.js net::ERR_ABORTED 403   Uncaught Error:...
  • Reuven replied on the discussion topic Moving the Site menu
    I mean - move the whole "site" menu in one stroke - not item by item. view reply
  • Reuven replied on the discussion topic Moving the Site menu
    Thank you Rohit Gupta. I did it, and the "menu" item appears under "account". However, I need the whole "site" menu to move... view reply
  • Reuven added a new discussion topic Moving the Site menu in the group Plugin Development
    Elgg 2.3.10, Aalborg Theme We have to move the Site menu to be under the "Account" button (top bar right) as a dropdown list. Help and code examples will be very much appreciated. Thank you very much
  • Reuven replied on the discussion topic imagick does not keep transparency of png
    Unfortunately, the new version of Imagine does not solve the problem. Anyway, thank you very much. view reply
  • Reuven replied on the discussion topic imagick does not keep transparency of png
    As @RVR said Elgg saves an entity icon in .JPG format always, and JPG does not support transparent background. However, the fact is that with GD php extension, Elgg retain the transparency of PNG even... view reply
  • Reuven replied on the discussion topic imagick does not keep transparency of png
    Thank you iionly for the detailed and useful guidance. view reply
  • Reuven replied on the discussion topic imagick does not keep transparency of png
    Any suggestion how to overcome this problem? Thank you view reply
  • Reuven replied on the discussion topic imagick does not keep transparency of png
    Thank you RvR, but I do not understand. When I deactivate imagic plugin, Elgg keeps the transparency of PNG. So, it is maybe not Elgg's fault. In addition, with Tidypics plugin set to imagic it keeps the transparency... view reply
  • Reuven added a new discussion topic imagick does not keep transparency of png in the group Plugin Development
    Elgg 2.3.10,  Plugin imagick 1.0 I upload png image with transparent areas. The imagick transform it to jpg and the transparent areas to black. If possible I prefer to keep it png with transparency. If not than jpg with the...
    • As @RVR said Elgg saves an entity icon in .JPG format always, and JPG does not support transparent background.

      However, the fact is that with GD php extension, Elgg retain the transparency of PNG even though the image file name has JPG suffix. The reason for this is that Elgg does not transform PNG to JPG. It just replaces the suffixes, i.e PNG -> JPG. I checked this phenomena (replacing the suffixes) outside Elgg's environment and found the same. The browsers (Chrome, FF and IE) retain the transparency and animation of PNG and GIF, even though the suffix of the files is JPG.

      @iionly said:

      Tidypics keeps the image format unchanged when resizing/creating the thumbnails and it uses the Imagick php extension directly

      Now we know that Elgg also keeps the format unchanged (changes only the suffix - which is not the best practice IMHO). I believe it is possible to build a plugin that replicates the functionality of Tidypics, and handle all the images of Elgg through Imagick php extension directly. In this way the problem with the PNG transparency will be solved. 

      Could someone suggest how to do it?

      Thank you very much.

    • I think it wouldn't be that easy to write such a plugin. The point is: Elgg core makes use of the Imagine library to use the same set of API functions regardless if GD or Imagick php are used. Imagine "translates" the functions accordingly. Also, Elgg most likely currently expects that the images (profile images, entity icons and file thumbnails) have the jpg suffix regardless what file type the files really are. If the png files would now suddenly saved with png extensions they would probably not getting served.

      The problem with the image file creation could probably be solved by replacing all Elgg core actions with modified versions that use their own set of image resizing functions (like Tidypics does). Probably the output file type issue could also be fixed somehow - but don't ask me for any details as I wouldn't have them right now.

      The question is if it couldn't be solved by improving the Imagick plugin and/or using a newer version of the Imagine library as Elgg core currently does. These questions might be best answered by the Coldtrick guys as they might know best. Unfortunately, I can't provide any more help currently just due to lack of detailed knowledge.

    • Unfortunately, the new version of Imagine does not solve the problem.

      Anyway, thank you very much.

  • Reuven replied on the discussion topic looking for a simple video/youtube upload plugin
    The 2.3.x version should be somewhere on github. If not I'll send you the one I use later this day view reply
  • Reuven replied on the discussion topic looking for a simple video/youtube upload plugin
    Try this one. https://github.com/ColdTrick/oembed For me it does the trick. Enjoy Features This plugin tries to replace URLs in output/longtext with embed code. For example if you paste a YouTube URL it will be replaced... view reply
  • 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