Robert Koziol

Send private message

You must be logged in to send a private message.

Activity

  • Robert Koziol added a new discussion topic CONFIG modification in the group Elgg Technical Support
    Hi, What is the recommended way of extending the $CONFIG array? I need to add an url of my server with a static content to serve the images and other files for my elgg theme. I have prepared such a solution in the init function of my...
  • Hi,I would like to get all tidypics' images which belong to a particular group. I can get all photos of the particular album in an easy way:$params = array('types' => 'object', 'subtypes' => 'image', 'container_guid' => $album_guid);$photos...
    • Hey Rob, try grabbing all the of the albums belonging to a group ie: 

      $params = array('types' => 'object', 'subtypes' => 'album', 'container_guid' => $group_guid);

      Then you can grab the images within each album. There might be a more graceful way of doing the same with the wheres and joins, but I'm not a DB guru 

      - Jeff

    • Jeff, thanks for your reply. I will follow your advice temporarily - but it is rather a workaround not a real solution. I would like to know how to achieve this by using one function invocation :)

      Anyone?

    • Register for the create image event (or whatever it is called). In your callback, check if the album (container) has a container of group. If so, create a relationship betwen photo and group.

      Now all you need to do is pull all photos that belong to the group using the relationship.

  • Robert Koziol replied on the discussion topic htmlawed core plugin
    Something like that is working - if anybody's interested: function htmlawed_init() {    global $CONFIG;    $CONFIG->htmlawed_config = array(        'safe' => true,   ... view reply
  • Robert Koziol replied on the discussion topic Get entities without metadata
    Well the discussion is very interesting :) I was going to get entities without some metadata at all (not with metadata 'mimetype' != 'some value', but those without metadata 'mimetype' of any value). In other words (actually DhrupDeScoop's words) I... view reply
  • Robert Koziol added a new discussion topic Get entities without metadata in the group Elgg Technical Support
    Hi, I would like to get all object entities which do not have a metadata of some name (let's say mimetype). I guess I should use the function elgg_get_entities_from_metadata. I know how I can get entities with some metadata - for example with...
    • hmmmm, I think he wants to know how to get he entities if the metadata doesn't even exists..

      Like what if "name_initial" doesn't even exists in the system.. eg

      $entity = new ElggObject();
      /*some code here*/
      if($some_condition) {
      }else{
      $entity->name_initial = "A"

      So in this case only those entities how satisfy the condition will have the metadata other will now even have it.

    • LOLZ ;-)
      "name_initial" is metadata on my Groups AlphaSort customization ;-X
      and so.. it exists on my test site.
      I think he asked for "get all object entities which do not have a metadata of some name (let's say mimetype)..."
      -->
      wants to fetch entities by metadata where metadata value != "blahblah"...
      Which is exactly what I coded in the API call parms and.. it works LOLZ ;-)
      Elgg API has provision to specify <metadata> <operator> <value>
      read up in engine/lic/ metadata.php for the calling sequence -
      all I did was to code as the API allows.

      If he really want to fetch enbtities which do not have metadata named as such...
      Then he will have to copy the typical metadata query generated by metadata.php code and
      re-hash a new very custom call on the meta data/strings table probably using (L/R) outer  JOIN and work back to the entities that do not have that metadata as named -- a somewhat messy join, join, join...

      I do that believe he wants to fetch by metadata where entitiy's metadata value is not equal to "some-value" -- but **he needs to come back here and qualify his intent while we go on with out philosophicals on the Elgg API ;-P

    • Well the discussion is very interesting :)

      I was going to get entities without some metadata at all (not with metadata 'mimetype' != 'some value', but those without metadata 'mimetype' of any value). In other words (actually DhrupDeScoop's words) I was interested in fetching entities which do not have metadata named as'mimetype'.

      I have discovered a workaround of my problem. I will not place it here because it has nothing to do with fetching entities and it is rather 'a brutal force' solution.

      However it is good to hear that I should probably write my own query to achieve that. Maybe it will be useful in the future.

      Thanks for all your suggestions :)

  • Robert Koziol replied on the discussion topic Difference between page and view
    I got it. It is much more clear now. Thanks :) view reply
  • Robert Koziol added a new discussion topic Difference between page and view in the group Plugin Development
    Hi, My question is maybe silly but I can find the exact answer nowhere. I read documentation and can't find any information about the difference between pages and views. I can see that more advanced plugins (tidypics for example) have two...
    • A view is a component that can be used to create a page. The sidebar is a view. The header is a view.

      The "pages" are the controller in the MVC. The request for the page is routed through Elgg to a page handler (the first part of the controller). The page handler could pull in the views to create the page or it could include an extrenal page script. Most of the original Elgg plugins put most of the controller logic into these separate page scripts.

      Tidypics has a better code layout than most of those original plugins but putting the page controllers into a pages directory. (In the same way, action controller are in action directories.)

    • I would definitely encourage putting your pages into a separate pages directory and as well, isolating your model code into functions located in separate files (not embedded in action files for example). I usually put my model functions in a models directory (eg. models/model.php) although other plugins use a lib directory for the same purpose.

    • I got it. It is much more clear now. Thanks :)