adrew22a

Send private message

You must be logged in to send a private message.

Friends

No friends yet.

Group membership

Activity

  • adrew22a replied on the discussion topic Use https
    And that kind of attitude is why open source projects die.  People get afraid to ask questions or suggest input.  Thanks for your help though. view reply
  • adrew22a replied on the discussion topic Use https
    what if I don't want to go to https://www.mydomain.com?  I want to go to https://mydomain.com view reply
  • adrew22a added a new discussion topic Use https in the group Elgg Technical Support
    How do I redirect elgg to use https not http? When someone goes to http I would like to redirect to https instead.
    • And that kind of attitude is why open source projects die.  People get afraid to ask questions or suggest input.  Thanks for your help though.

    • And that kind of attitude is why open source projects die.

      All I am saying is that people like free buffet. All the solution just served to them on plates. A little curiosity is good. It help you learn new things (and sometimes also contribute to the open source projects, which will definitely keep the project alive). If you would have tried to understand what the piece of code does you could have easily found the solution on your own.

      Anyways, It was not to offend you. I am sorry if it was in-appropriate in any way. 

    • Imho Rohit Gupta has provided actual help with actual code. This is what helps a forum as well as open source run. While this will be out of topic : open source projects' deaths have got nothing to do ( or more or less nothing to do) with "attitudes" in general. During the past 10 years or so there has been no significant new open source project in php. No new open source web scripting language as successful as php too. Just think projects like Elgg, Wordpress, Drupal will never happen again. The world is now sheepishly slave to the trio Google-Apple-Facebook. Many entities now have only fb/ address in billboards and elsewhere and not www address. Apps are killing the open and interconnected net, and for Apps you have to be "slave" to Google or Apple ( and MS). Why Apps are something not like http html php websites - where you host your own either on free or paid servers or even your own server ?? No one complains, no lawsuits !!

      Opensource generation is a dying generation thus. Despite several ongoing projects, its not that the flourishing majority when Tim Lee "invented" www and Rasmus Lerdorf "created" Php. Its sad. Many "opensource" projects got sold to biggies. And many opensource projects made their own commercial firms like Wordpress and Drupal. Opensource and money earning has no conflict with each other as such ( without money you cannot survive) but the spirit ... I dont know. There will be no more "whiz kids" like Matt (Wordpress), Dries (Drupal) or for that matter Ben Werdmuller who started Elgg but has shifted to other priorities now ( I think so). Many opensource projects actually died as the young ones who started these needed money for survival ( or needed to be "more rich") and commercialization of open source was not that much success for most of them. So they had to devote more and more time to jobs ( or in some cases their own companies or in the companies which "purchased" them). Elgg 2x has many and many more plugins( and thus more adoption)  than Elgg 3x will ever have because of the same reason. The number of interested and talented youth who could have contributed are now in look out for actual jobs and money or are absorbed passively in the Apps world or rather than trying out php are chatting on Fb. The existing opensource projects do have some flaws which do not let them flourish, that is another issue.

  • adrew22a added a new discussion topic saveIconFromUploadedFile as PNG in the group Elgg Technical Support
    is their a way I can use saveIconFromUploadedFile and have it save as a png instead of a jpg?
    • Short answer: "no". The "jpg" extension is hard-coded and the Elgg core code is written to create jpg files.

      Longer (incomplete) answer. "maybe". The creation of the icon files is not done completely within saveIconFromUploadedFile() but there is a cascade of functions that are involved (the functions are split to be able to deal with different parts of the work separately to be able to reuse them depending on the requirements in different situations). The function saveIconFromUploadedFile() calls the functions saveIcon() and within this function the plugin hook "entity:<type>:save", "<entity_type>" is triggered (for example for creation of icons for entities of type object it would be "entity:icon:save", "object"). This seems the only point in the process where you could interrupt Elgg with dealing with the icon creation when registering a callback function for this plugin hook. But then you would have to implement your own code that creates the icon file within this callback function. Additionally, there might be other issues arise then if the icon files are saved as png and not jpg when Elgg tries to output the files expecting it to be jpg files and therefore might serving them with the wrong mimetype which could cause trouble with displaying the images in the browsers (I think Chrome is very sensible with regards to filetype/mimetype).

  • adrew22a added a new discussion topic Sort entities by recently commented in the group Elgg Technical Support
    Is it possible to sort entities by most recently commented?
    • Short answer: yes.

      Maybe a bit more details... For example Tidypics has a page that lists photos in order of most recent comments. The code (in mod/tidypics/views/default/resources/tidypics/lists/recentlycommented.php) used to get the entities in the corresponding order is

      $db_prefix = elgg_get_config('dbprefix');
      $options = array(
          'type' => 'object',
          'subtype' => 'image',
          'limit' => $limit,
          'offset' => $offset,
          'joins' => array(
              "JOIN {$db_prefix}entities ce ON ce.container_guid = e.guid",
              "JOIN {$db_prefix}entity_subtypes cs ON ce.subtype = cs.id AND cs.subtype = 'comment'"),
          'order_by' => "ce.time_created DESC",
          'full_view' => false,
          'list_type' => 'gallery',
          'gallery_class' => 'tidypics-gallery'
      );
      
      $result = elgg_list_entities($options);

      Of course, you would have to modify it a bit for other type of entities and implement it within a view that outputs it. For further reference you could take a look at the code of the Tidypics plugin.

  • adrew22a replied on the discussion topic List only latest entity of each user
    Im trying to use this example I found : SELECT max(id) as id, asker FROM questions GROUP by asker ORDER by id DESC Implemented in Elgg like the following: $content = elgg_list_entities(array(   ... view reply
  • adrew22a replied on the discussion topic List photos entities based on users metadata
    I received this error   An exception occurred while executing 'SELECT COUNT(DISTINCT e.guid) as total FROM elgg_entities e JOIN elgg_users_entity ue ON ue.guid = e.owner_guid JOIN elgg_metadata md4 ON (md4.owner_guid = e.owner_guid... view reply
  • adrew22a replied on the discussion topic List only latest entity of each user
    Ismayil this was so close and way easier then what I was trying to do!  The only issue is its show the oldest post not the newest post.  Any ideas? view reply
  • adrew22a replied on the discussion topic List only latest entity of each user
    I'm not trying to list a single owners entities of a subtype.  I want to list all entities of a subtype but only want to show the latest one entity of each user.  If someone posted 5 times to the entity "file" I... view reply
  • adrew22a added a new discussion topic List only latest entity of each user in the group Elgg Technical Support
    How can I list only the latest entity of each user? $options = array(     'type' => 'object',     'subtype' => 'file', ); $files = elgg_list_entities($options);
    • Ismayil this was so close and way easier then what I was trying to do!  The only issue is its show the oldest post not the newest post.  Any ideas?

    • Maybe some finetuning is necessary, e.g. additionally to 'group_by' also

      'order_by' => 'e.time_created DESC',

      Just try with appending either ASC or DESC to the `group_by` and `order_by ' options values to see how it changes the order.

    • Im trying to use this example I found :

      SELECT max(id) as id, 
         asker
      FROM questions 
      GROUP by asker 
      ORDER by id DESC
      

      Implemented in Elgg like the following:

      $content = elgg_list_entities(array(
          'type' => 'object',
          'subtype' => 'file',
          'selects' => array("max(e.time_created) AS createdtime"),
          'order_by' => 'createdtime ASC',
          'group_by' => 'e.owner_guid',
      ));

      But this doesn't seem to work still.  Any ideas?

  • adrew22a added a new discussion topic Show latest occurrence in get_entities in the group Elgg Technical Support
    I am trying to show the latest occurrence when I get entities.  Example would be a message inbox.  I only want to show the latest message from each user in the inbox. I asked the question...
  • adrew22a added a new discussion topic File plugin some images are rotated in the group Elgg Technical Support
    I noticed when I use the file plugin some of my images get rotated 90 deg.  Is their a way to fix this?  I don't want the images to be rotated when uploaded. Thanks
    • Images taken on mobile devices save the image orientation in their exif metadata. If the program used to view the images doesn't make use of the exif data, the images are displayed in their original orientation. Most browsers (all browsers?) don't make an image orientation correction.

      Tidypics does correct the orientation on image upload. For image files uploaded with the File plugin you can try out the Image Orientation plugin (https://elgg.org/plugins/1873029; maybe better try the latest release from https://github.com/arckinteractive/image_orientation).

      (If I'm not mistaken, the future Elgg 3 will come with image orientation correction already in core.)

  • adrew22a replied on the discussion topic Avatar upload white screen on some images
    Figured it out. Memory issues...  Is it bad to max you Memory_limit?  I set it too 512M which is my max.  Is their pros and cons to this? view reply
  • adrew22a added a new discussion topic Avatar upload white screen on some images in the group Elgg Technical Support
    I am having issues when users upload a profile avatar.  Some images cause a white screen when uploading and never upload while other images upload fine.  I have no clue on where to start with this issue. I tried modifying the upload avatar...
  • adrew22a has a new avatar
    adrew22a
  • adrew22a added a new discussion topic List photos entities based on users metadata in the group Elgg Technical Support
    How do I list all photos of users that have a certain metadata. So Lets say I have two entities: 'users' and 'images' some users have the following metadata saved to them like so: $user->status = 'active' so...
    • It might work with

      offset = (int)get_input('offset', 0);
      $limit = (int)get_input('limit', 16);
      $db_prefix = elgg_get_config('dbprefix');
      $meta_status_id = elgg_get_metastring_id('status');
      
      $entities = elgg_list_entities(array(
          'type' => 'object',
          'subtype' => 'image',
          'limit' => $limit,
          'offset' => $offset,
          'joins' => array(
              "JOIN {$db_prefix}users_entity ue ON ue.guid = e.owner_guid",
              "JOIN {$db_prefix}metadata md4 ON (md4.owner_guid = e.owner_guid AND md4.name_id = $meta_status_id)",
              "JOIN {$db_prefix}metastrings ms4 ON md4.value_id = ms4.id"
          ),
          'wheres' => array(
              "ms4.string = 'active'"
          ),
          'group_by' => 'e.guid',
          'order_by' => "views DESC",
          'full_view' => false,
          'list_type' => 'gallery',
          'gallery_class' => 'tidypics-gallery'
      ));

      I can't tell if this code is fully correct though (can't test your setup with the status metadata).

    • I received this error

       

      An exception occurred while executing 'SELECT COUNT(DISTINCT e.guid) as total FROM elgg_entities e JOIN elgg_users_entity ue ON ue.guid = e.owner_guid JOIN elgg_metadata md4 ON (md4.owner_guid = e.owner_guid AND md4.name_id = 283801) JOIN elgg_metastrings ms4 ON md4.value_id = ms4.id WHERE ms4.string = 'active' AND ((e.type = 'object' AND e.subtype IN (11))) AND (e.site_guid IN (1)) AND ((1 = 1) AND (e.enabled = 'yes'))':

      SQLSTATE[HY000]: General error: 2013 Lost connection to MySQL server during query

      QUERY: SELECT COUNT(DISTINCT e.guid) as total FROM elgg_entities e JOIN elgg_users_entity ue ON ue.guid = e.owner_guid JOIN elgg_metadata md4 ON (md4.owner_guid = e.owner_guid AND md4.name_id = 283801) JOIN elgg_metastrings ms4 ON md4.value_id = ms4.id WHERE ms4.string = 'active' AND ((e.type = 'object' AND e.subtype IN (11))) AND (e.site_guid IN (1)) AND ((1 = 1) AND (e.enabled = 'yes'))

    • Difficult to say what might be wrong. "Lost connection to MySQL server during query" could mean a timeout issue or a out-of-memory issue of the MySQL server during the query. This might be because the query I suggested is wrong (as I said I can't test it because I don't have the necessary data you require, i.e. the status metadata). Or it might be that the query is correct as such but so complex that your server can't handle it due the limits set in the MySQL server config (timeouts, memory, cache sizes etc.). Maybe the query could get modified to require less server resources. But I can't say how because that's beyond my MySQL knowledge. Or it might be necessary to adjust the MySQL server config to be able to handle this query. But server config support is a complex matter on its own and I have to say it's beyond the support I can provide here.

  • adrew22a added a new discussion topic How to get users from annotation? in the group Elgg Technical Support
    I use the code below to create a annotation for users. I would like to get all the users with this annotation.  How can I do that? create_annotation($entity->guid,               ...
  • adrew22a added a new discussion topic elgg_get_entities_from_relationship with metadata? in the group Elgg Technical Support
    How can I get entities from relationship and metadata at the same time?  I would like to combine the bottom two calls. $users = elgg_get_entities_from_metadata(array(     'type' => 'user',   ...
  • adrew22a added a new discussion topic Save user Icon from URL in the group Elgg Technical Support
    How can I save a user icon by a image url?  Before I did something like this but doesn't seem to work on egg 2.3 $photo_url = http://mysite.com/image; $icon_sizes = elgg_get_config('icon_sizes');   ...
  • adrew22a added a new discussion topic Hypelist infinite scroll in the group Elgg Technical Support
    How can I set hypelist to infinite scroll...  I am trying to get it to scroll automatically without having to click "Show Next 20"