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).
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?
info@elgg.org
Security issues should be reported to security@elgg.org!
©2014 the Elgg Foundation
Elgg is a registered trademark of Thematic Networks.
Cover image by Raül Utrera is used under Creative Commons license.
Icons by Flaticon and FontAwesome.