I'm going to assume by "entry" you mean new ElggObjects in a group, and by "new" you mean "things I haven't viewed".
This going to be difficult because Elgg doesn't keep track of things "viewed" by individual users; you'll have to record all that. When a group-contained entity is created, make a relationship called "unviewed{$group_guid}" between the entity and the group's members (you'll probably want to use a direct DB query for this). When a user "views" the entity (however you define that), you'll remove the relationship. And also make a cron job that deletes these relationships over N months old.
But that would give you a way to count unread for each group displayed.
Could be a useful plugin!
Hi @Steve Clay,
thanks for your support. Ok.. this looks like a bigger job...
So I will put that in the qeue..
But you are right .. could be usefull especially for people who don't show up evry day
Kind regards
Markus
Hi @RvR
first thank you for your fast response.
But. errm.... I think I don't get it. As far as I see in the example of topic you send here it is a solution how to add a "blog" or something else to the menu if a plugin like "blog" is installed. But it's not about the blog...
I would like to have the menu
- Pages
- Files
- Wire entries
stay all the time on my menu... even if the user is in groups or somewhere else.
I thought maybe there is some kind of function or hook that always renders this menu.
Of course it would be nice if the admin adds a plugin which adds a new menuentry to the "owner_block" that this menuentry will show automaticly up in my menu. But this is the the second step and could be managed by the soltion you provided.
Kind regards
Markus
An example for you.
1) Make your own page handler:
elgg_register_plugin_hook_handler('register', 'menu:owner_block', 'theme_owner_block_menu_handler');
2) Add items:
function theme_owner_block_menu_handler($hook, $type, $items, $params) {
$owner = elgg_get_page_owner_entity();
$items['profile'] = ElggMenuItem::factory(array(
'name' => 'profile',
'text' => elgg_echo('profile'),
'href' => "/profile/$owner->username/",
'priority' => 1,
));
if (elgg_is_active_plugin('thewire')) {
$items['thewire'] = ElggMenuItem::factory(array(
'name' => 'thewire',
'text' => elgg_echo('thewire'),
'href' => "/thewire/owner/$owner->username",
'priority' => 2,
));
}if (elgg_is_active_plugin('pages')) {
$items['pages'] = ElggMenuItem::factory(array(
'name' => 'pages',
'text' => elgg_echo('pages'),
'href' => "/pages/owner/$owner->username",
'priority' => 3,
));
}if (elgg_is_active_plugin('file')) {
$items['file'] = ElggMenuItem::factory(array(
'name' => 'file',
'text' => elgg_echo('file'),
'title' => elgg_echo('crewz:owner'),
'href' => "/file/owner/$owner->username",
'priority' => 4,
));
}
return $items;
}
etc
Hi @RvR
Thank you very very much for your help!
Ok it seems like there is only the "hard-coded" way and no hook from the elgg system.
Thanks it works!
Kind regards
Markus
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.