form_set_data($entity, $data)
This function takes an array data, with the internal_data strings as array access keys, which has instantiated stdClass() objects per field definition (internal_data strings). The attribute "value" stores the value respective to it's internal data string.
$entity is the ElggEntity that allows metadata, for flexprofile, it's the ElggUser.
Looks like form_set_data() and flexprofile_set_data() are exactly the same function.
Looks like the metadata is being set using create_metadata(), so you can technically get the $user object and just use the regular metadata methods to set and retrieve values.
For example, if a form field internal_id is "flex_plugin" then $user->flex_plugin = "somevalue"; or echo $user->flex_plugin; would work
Yep, just confirmed it
$user->setMetaData(%internal_name%, %value%);
$user->getMetaData(%internal_name%);
works fine.
I think it would be wise, however, to use form_set_data() to control the access. You can always use access_id to override it.
Hope this helps someone:)
form_set_data($entity, $data)
This function takes an array data, with the internal_data strings as array access keys, which has instantiated stdClass() objects per field definition (internal_data strings). The attribute "value" stores the value respective to it's internal data string.
$entity is the ElggEntity that allows metadata, for flexprofile, it's the ElggUser.
Looks like form_set_data() and flexprofile_set_data() are exactly the same function.
Looks like the metadata is being set using create_metadata(), so you can technically get the $user object and just use the regular metadata methods to set and retrieve values.
For example, if a form field internal_id is "flex_plugin" then $user->flex_plugin = "somevalue"; or echo $user->flex_plugin; would work
Yep, just confirmed it
$user->setMetaData(%internal_name%, %value%);
$user->getMetaData(%internal_name%);
works fine.
I think it would be wise, however, to use form_set_data() to control the access. You can always use access_id to override it.
Hope this helps someone:)
form_set_data($entity, $data)
This function takes an array data, with the internal_data strings as array access keys, which has instantiated stdClass() objects per field definition (internal_data strings). The attribute "value" stores the value respective to it's internal data string.
$entity is the ElggEntity that allows metadata, for flexprofile, it's the ElggUser.
Looks like form_set_data() and flexprofile_set_data() are exactly the same function.
Looks like the metadata is being set using create_metadata(), so you can technically get the $user object and just use the regular metadata methods to set and retrieve values.
For example, if a form field internal_id is "flex_plugin" then $user->flex_plugin = "somevalue"; or echo $user->flex_plugin; would work
Yep, just confirmed it
$user->setMetaData(%internal_name%, %value%);
$user->getMetaData(%internal_name%);
works fine.
I think it would be wise, however, to use form_set_data() to control the access. You can always use access_id to override it.
Hope this helps someone:)
form_set_data($entity, $data)
This function takes an array data, with the internal_data strings as array access keys, which has instantiated stdClass() objects per field definition (internal_data strings). The attribute "value" stores the value respective to it's internal data string.
$entity is the ElggEntity that allows metadata, for flexprofile, it's the ElggUser.
Looks like form_set_data() and flexprofile_set_data() are exactly the same function.
Looks like the metadata is being set using create_metadata(), so you can technically get the $user object and just use the regular metadata methods to set and retrieve values.
For example, if a form field internal_id is "flex_plugin" then $user->flex_plugin = "somevalue"; or echo $user->flex_plugin; would work
Yep, just confirmed it
$user->setMetaData(%internal_name%, %value%);
$user->getMetaData(%internal_name%);
works fine.
I think it would be wise, however, to use form_set_data() to control the access. You can always use access_id to override it.
Hope this helps someone:)
form_set_data($entity, $data)
This function takes an array data, with the internal_data strings as array access keys, which has instantiated stdClass() objects per field definition (internal_data strings). The attribute "value" stores the value respective to it's internal data string.
$entity is the ElggEntity that allows metadata, for flexprofile, it's the ElggUser.
Looks like form_set_data() and flexprofile_set_data() are exactly the same function.
Looks like the metadata is being set using create_metadata(), so you can technically get the $user object and just use the regular metadata methods to set and retrieve values.
For example, if a form field internal_id is "flex_plugin" then $user->flex_plugin = "somevalue"; or echo $user->flex_plugin; would work
Yep, just confirmed it
$user->setMetaData(%internal_name%, %value%);
$user->getMetaData(%internal_name%);
works fine.
I think it would be wise, however, to use form_set_data() to control the access. You can always use access_id to override it.
Hope this helps someone:)
I agree, I see some extremely great uses for this.
A typo for Brett's query above:
$query = "INSERT INTO elggredirection (subdomain, guid) VALUES ('$escapedURL', '$id')";
Also, I would use insert_data() insert of execute_query()
Ints don't need to be quoted for MySQL ;) But it is probably good practice...
insert_data() is the better function to use! Good catch on that one.
Thanks very much everyone - just to update, execute_query() didn't seem to work at all, whereas insert_data() worked fine, so the code ended up like:
// Save the clean URL to the database with the GUID
$escapedURL = mysql_real_escape_string($page->cleanurl);
$id = mysql_real_escape_string($page->getGUID());
$query = "INSERT INTO elggredirection (subdomain, guid) VALUES ('$escapedURL', '$id')";
insert_data($query);
Now I've just got to make sure when a page is deleted the database entry is removed, which should be as simple as using delete_data(). I'll need to tidy it up before I release it as a plugin (currently I'm putting together an extranet using Elgg), so once I'm done with that I'll post it.
@Carlos this is why i said something where users are inputing the content, not unlike report content, but modified maybe to gather the offensive phrases and not just individuals who are making a nuisance
@Zak... I agree with your approach.. I think it is more SN compatible...
@all..
Guys... my friend and I joke all the time... and he sends me a message saying:
What??? I have to pay???? Fuck you... it aint gonna happen mate.... LMAO
So, what will interceptor do then???
oki ;-)
there are two packages...
Messages Interceptor (MI)
Interceptor (I)
"Interceptor"will be the "word grabber" code I'm trying to make smarter and more intelligent to try and grab obfuscated language where a human can recognize, but coded algorithms based on word lists will miss.
e.g
WTF@@K R U wasted OMG that F@@Kin itch jus said f?
a dictionary word based spam killer may have little hope to trap and block this while everyone know exactly what is being said..
I hope to make progress with the (algorithm) code and have something smart enough to serve a good purpose in "monitoring" content.
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.