Hi,
I'm trying to determine when the following objects are created by users on the elgg site that I have installed on localhost: Blog, Page, Bookmark, File and posts on The Wire.
I have:
elgg_register_event_handler('create', 'pages', 'created_A_Page');
function created_A_Page($event, $object_type, $object) {
error_log("created the page!");
error_log($event . " " . $object_type . " " . $object);
}
I just wanted to track when a user has created any of these objects on the site. The function isn't being called. Am I not understanding the ElggObject?
Any help would be appreciated.
Diana.
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.
- Steve Clay@steve_clay
Steve Clay - 1 like
- Diana@diana.ragbir
Diana - 0 likes
- Evan Winslow@ewinslow
Evan Winslow - 1 like
- Evan Winslow@ewinslow
Evan Winslow - 0 likes
You must log in to post replies.All these content have type "object" (they extend PHP class ElggObject) so you'd listen for the create, object event. Then you'd have to further analyze the object it gives you to see what it is. E.g. see what is $object->getSubtype()
Thanks,
I got this out.
The subtype for a page is page_top. How weird is that?
Actually there are two subtypes for pages: page and page_top. This is for historical reasons (pages can have subpages and we needed a way to distinguish between top-level pages and lower-level pages).
Yes, very weird.
Edited the title to be more explicit.