adrew22a

Send private message

You must be logged in to send a private message.

Friends

No friends yet.

Group membership

Activity

  • adrew22a added a new discussion topic How do I add a php SDK to elgg now? in the group Elgg Technical Support
    for previous elgg version i added a php sdk like: require_once('shopi-php-sdk-master/autoload.php');   in the newest version of elgg it is using elgg-plugin.php   how would i add this reference now?
    • If you import your external SDK with Composer the autoload file of Composer will automatically be included during plugin boot.

      If you (for some reason) aren't using Composer you can simply include your

      require_once('shopi-php-sdk-master/autoload.php');

      in the elgg-plugin.php

  • adrew22a added a new discussion topic Get unique meta data from entities in the group Elgg Technical Support
    How can I get all the unique metadata in a list of entities? Example: I have entities with a subtype "posts" with a metadata "area" that the user inputs in a form. I want to get an array of all the unique metadata "area" from the entities...
  • adrew22a replied on the discussion topic Redirect to form
    Sorry, I'm looking to not give them access to any other pages until they feel out a form. view reply
  • adrew22a replied on the discussion topic Redirect to form
    So I have a mandatory form I want them to fill out before the access any other page on the site. view reply
  • adrew22a added a new discussion topic Redirect to form in the group Elgg Technical Support
    How would I redirect to a page with a form on it till the user feels out the form?  I dont want them accessing any other pages till the form is filled out. I know this is wrong but something along the lines of this: $user =...
    • So I have a mandatory form I want them to fill out before the access any other page on the site.

    • 1 - In the form:

      Add 'required' => true param to the mandatory field.

      2 - In the action:

      Check the value for the mandatory field:

      if(!$request->getParam('param')) {
            return elgg_redirect_response($url);
      }

      3 - Validate the field:

      You may want to validate all values in the form before sending them to server (via action).

      You can use some libs for this (google it).

      Look at this plugin also.

    • Sorry, I'm looking to not give them access to any other pages until they feel out a form.

  • adrew22a added a new discussion topic How to unregister login menu item? in the group Elgg Technical Support
    I want to unregister the login menu item but cant figure out how too.   Been trying this but it doesnt work: elgg_unregister_menu_item('topbar', 'login'); Does anyone know how i would do this?
  • adrew22a added a new discussion topic Order entities by meta data in the group Elgg Technical Support
    I have some entities with a unixtime stamp as a metadata value.  I would like to sort these entities based off that metadata value.  How would this be done? Example:  $entity->customtime = time();
  • adrew22a replied on the discussion topic Get entities by metadata in Elgg 3.X
    This works flawless, thank you iionly! view reply
  • adrew22a added a new discussion topic Get entities by metadata in Elgg 3.X in the group Elgg Technical Support
    In Elgg 3.X how do you get entites based on metadata values. Lets say my entitities are made like the following: $object = new ElggObject(); $object->subtype = "user_status"; $object->status =...
    • $matching_entities = elgg_get_entities([
          'type' => 'object',
          'subtype' => 'user_status',
          'metadata_name_value_pairs' => [
              [
                  'name' => 'status',
                  'value' => 'notactive',
                  'operand' => '=',
              ],
              [
                  'name' => 'approved',
                  'value' => 'yes',
                  'operand' => '=',
              ],
              [
                  'name' => 'count',
                  'value' => '3',
                  'operand' => '>',
              ],
          ],
      ]);
    • This works flawless, thank you iionly!

  • adrew22a added a new discussion topic How to endable Multidate in input/date in the group Elgg Technical Support
    I am trying to be able to select multiple dates with the input input/date but I can't seem to get it to work.This is what im using: echo elgg_view('input/date', array('name' => 'date','datepicker_options'...
  • adrew22a replied on the discussion topic Query two Entities
    what is $qb and $alias? view reply
  • adrew22a added a new discussion topic Query two Entities in the group Elgg Technical Support
    I would like to query two entities at the same time. Lets say I want to get all the entities "images" where (User Object) user->status = 'active'. I use to do this like the...
  • adrew22a added a new discussion topic Change the CSS in Elgg 3.3 in the group Elgg Technical Support
    How do I change the CSS in Elgg 3.3.   I'm trying to change the following background css: .elgg-page-topbar { background: #0078ac; }
  • 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