Hi everybody,
I've been working on customising the profile plugin and can't seem to make those functions work.
Basically I set up an extra area to the profile that declares a menu linked to several "sections" and "subsections".
here is how things are organized right now:
Each section is within a separate plugin and adds its own ElggMenuItem to the section menu as well as the subsection menu during plugin initialisation.
mysite/profile/username links to the user profile, my plugin uses a page handler where elgg_set_page_owner_guid() is called.
the same page handler accepts url formatted as : mysite/profile/username/section/subsection
and add relevant section and subsection to the profile page by calling elgg_view().
I need to retrieve the owner of the profile to customize the views (edit buttons, retrieve entities from the database etc...)
I tried to get this with elgg_get_page_owner_guid() but it keeps returning 0.
I managed to make it work by parsing the current_url() but it feels hacky to me, is there a better way to accomplish this? or to make elgg_get_page_owner_guid() work?
I come from software development and I might be missing something pretty basic, I hope someone can help me here.
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.
- Tom@Thomasondiba

Tom - 0 likes
You must log in to post replies.For your elgg_get_page_owner_guid() handdler to work you have to force it to return 1 by writting it like this... otherwise, it will always return 0 or kick the user out or load logout contents to a logged in user
<?php
elgg_get_page_owner_guid(1);
?>
hope this will help.
Tom