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 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...
    • 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?

  • 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"
  • adrew22a added a new discussion topic hypefeed list random in the group Elgg Technical Support
    Using hype feed how can display the entities listed in the activity random?  I've used 'order_by' => 'rand()'   but can't seem to get it to work with this.
  • adrew22a added a new discussion topic Class 'PDO' not found in the group Elgg Technical Support
    I was trying to change my upload_max_filesize from 5M to greater so I created two files php.ini and php5.ini php.ini: max_input_time = 60 memory_limit = 128M upload_max_filesize = 128M post_max_size =...
  • adrew22a added a new discussion topic Ajax Comments in the group Elgg Technical Support
    How can I set up Ajax for comments? using 2.3.1
  • adrew22a replied on the discussion topic How to upload file to custom folder?
    Current hosting supports up to 5.4 php and. Edited quite a few plugins... lack of time to move it and troubleshoot. view reply
  • adrew22a replied on the discussion topic How to upload file to custom folder?
    I was going to name the filenames as the entity guids, so I can easily link them to the entity. Then only allow mov or mp4 for uploads. What are the issues I can run into doing this using your method data directory? view reply