BlazinFlizard

Send private message

You must be logged in to send a private message.

Friends

No friends yet.

Group membership

Activity

  • BlazinFlizard added a new discussion topic How to edit the Activity query in the group Beginning Developers
    I would love to know how to edit the query of the Activity page to sort out some events like "Friendships", or "Changing Avatar", among other stuff. So far I've got to the /vendor/elgg/elgg/river.php, but I don't know if...
  • BlazinFlizard replied on the discussion topic Remove images from query by tags
    Well I managed to remove the images from the query editing /tidypics/resources/tidypics/lists/siteimagesall.php eby doing this:   // grab the html to display the most recent images $result = elgg_list_entities(array(   ... view reply
  • BlazinFlizard added a new discussion topic Remove images from query by tags in the group Tidypics Photo Gallery Plugin
    Hello dear developers of Tidypics :) I was wondering if there is a way to filter out some images from the picture gallery query by the tags the picture has. For example if the picture has the tag "artistic nudes" I don't want it to...
    • Well I managed to remove the images from the query editing /tidypics/resources/tidypics/lists/siteimagesall.php eby doing this:

       

      // grab the html to display the most recent images
      $result = elgg_list_entities(array(
          'type' => 'object',
          'subtype' => 'image',
          'owner_guid' => NULL,
          'wheres'=>'e.guid NOT IN(SELECT entity_guid FROM elgg_metadata WHERE value_id IN(406))',
          'limit' => $limit,
          'offset' => $offset,
          'full_view' => false,
          'list_type' => 'gallery',
          'gallery_class' => 'tidypics-gallery'
      ));


      Where "406" is the ID of the tag I want picture to not have. Hope someone finds this useful =)

      Now I only need to figure out how to add the new tab with the query only showing these tags.

    • I can't provide you with the ready-to-use code for that (no time at the moment to full code that all) but only some hints that might be useful.

      If you haven't seen it yet you might want to check out http://reference.elgg.org/engine_2lib_2metadata_8php.html#aec4b6f0b9565e3554acb9b39ef34a2ac for an example of a where clause to exclude certain entries from a query (not containing a certain metadata). It's similar to what you have come up with but maybe it works even better.

      Regarding the additional tab you would have to add the page/view code to be used for this tab, add an entry to Tidypics' pagehandler for this new page and you will have to override the default filter (filter menu is the tabs selection) to add your additional tab. As an example for adding a tab you can take a look into the code of my izap_videos plugin that adds a "Favorite" tab in addition to the default tabs. For the other modifications I can only suggest to look into the code of the Tidypics plugin to understand what is necessary for the creation of the additional tab.

      For fetching the images with a specific tab you might need to add some custom join/where clauses. Maybe it helps to look into the code of the elgg_get_tabs() function in engine/lib/tags.php. Using elgg_get_tabs might also work to get an array of image entries that have the desired tag. Though you would have to deal with creating the html output on your own when using elgg_get_tags() whereas Elgg already deals with creating the ready-to-use output when using some elgg_list_*() function. I don't know if you can use elgg_list_entities_from_metadata() without some custom join/where clauses as the tags are not saved as separate metadata entries but instead all tags belonging to an entity are saved as a single metadata (comma separated string with the tag values).

  • BlazinFlizard replied on the discussion topic Filter out activity from the activity tabs based on tags
    Hmm ok I think I found where to do that thanks ura :) And Steve your class looks amazing, and with small modifications I'm sure that it can make what I want to =) However...where do I have to implement it? view reply
  • BlazinFlizard replied on the discussion topic Filter out activity from the activity tabs based on tags
    Ok amazing thanks a lot ura! :) Yeah this does half what I want, and as temporal solution I can add a link to the tag query page. Now I wonder how can I configure this system to work with the activity tabs so it displays in the format of the... view reply
  • BlazinFlizard has a new avatar
    BlazinFlizard
  • Hello dear developers of Elgg :) I came with an unreasonable question. I want to filter out some images that appear on the Elgg activity tabs based on the tags they have. In this case for example I want all images that has the "tag"...
    • ura welcome!

      to do that will require you to over-ride the pages that currently output the data for the relevant tabs on the activity page. i think the specific files to change will be different depending on which version of elgg you are using. in 1.12.x you would need to unregister the existing page handler for the activity pages and add your own one to point the server to your new custom php files for each of the tabs. in 2.x i think the pages are now views, so you could just over-ride them as you would over-ride any other view, without the need to add a plugin handler hook.

      once your custom code is being used to display the tab content, then you would need to change the database queries (using php and elgg's functions/arrays) to output the data you want. there is a metadata query that takes an operator of '<>' which would allow you to exclude items that have a specific tag attached to them.

    • Take a look at my TagUtil class. I see it's a lacking a way to exclude a particular tag, but you might be able to figure it out based on the 3 filtering methods there.

    • Hmm ok I think I found where to do that thanks ura :)

      And Steve your class looks amazing, and with small modifications I'm sure that it can make what I want to =)

      However...where do I have to implement it?