I'm trying to add registration fields to the account/register page and I eventually would like to access these fields from a modified profile plugin and other plugins. I see how I can override the action and view associated with user registration but the action calls a function register_user() to actually complete the registration. It looks like this function is defined in engine/lib/users.php. I'm not sure if I should be editing users.php. What is the cleanest, most logical way for me to do this?
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.
Bump !?!
google "elgg add registration fields" ;-)
So when I change profile fields (http://docs.elgg.org/wiki/Changing_profile_fields), the user's data is saved as metadata, right?
google "elgg profile fields metadata" ;-)
cool. This page (http://groups.google.com/group/elgg-development/browse_thread/thread/2d30eeaf4c6b528e) helps a good bit.
So then, if I add a profile field "State / Province" and then enter a value at my user page, what will the metadata name be? For instance, would it be $_SESSION['user']->state_province or something?
i think so ( i am not verifying this from code ) just check how the original profile fields are coded.. should work.
I'm having trouble understanding the code on the replace profile fields page. I've found that I can access default profile fields ok but I can't figure out how to call the new ones that I added.
I'm having a related issue.
I want to initialize metadata related to a user account DURING REGISTRATION. I want to assign a number of "credits" to each user's account.
So I'm editing /actions/register.php
$new_user = get_entity($guid);
$new_user->credits = 5;
But no metadata is added.
Is there somewhere else I should be initializing the metadata? I have no idea why it doesn't work during registration. I tried calling the save() function too but that made no difference.
And yes I Googled but none of the results seemed to help.
Hmm... I do this sort of customization for my $$ Paid paid clients all the time.. Easy with knowledge of Elgg internals.. More difficult without...
- Previous
- 1
- 2
- Next
You must log in to post replies.