@shillo
The second parameter is "subtype" which is not applicable for entities of type "user" (first parameter), The third parameter is owner_guid, and the 4th parameter is the limit (of items you want on this call).
Which brings up a coding issue that has bothered me in all of the elgg engine calls regarding "limit". If you set the limit to 9999, then if you happen to have more than that number of users, you will miss the rest. In general the way I get around this is to have two loops as follows:
$total = 0;
for ( ; ; )
{
$newcount = 0;
$users = get_entities("user", "", 0, "", 9999);
foreach($users as $user)
{
// check to make sure relationship does not already exist then add it
add_entity_relationship();
$newcount++;
}
if ( $newcount == 0 )
break;
$total += $newcount;
}
That's wonderful, ChungNg.
I had the intution is that "9999" is the member limit, but don't worry, my site will never hit that barrier. There are not that many intelligent people on the planet :) hahaha.
Ok, thanks for this. I understand what is going on with code I can see the function referenced in elgg/lib/relationships.php but how best to go about running this. Sorry, I am a newbie!
@shillo
The second parameter is "subtype" which is not applicable for entities of type "user" (first parameter), The third parameter is owner_guid, and the 4th parameter is the limit (of items you want on this call).
Which brings up a coding issue that has bothered me in all of the elgg engine calls regarding "limit". If you set the limit to 9999, then if you happen to have more than that number of users, you will miss the rest. In general the way I get around this is to have two loops as follows:
$total = 0;
for ( ; ; )
{
$newcount = 0;
$users = get_entities("user", "", 0, "", 9999);
foreach($users as $user)
{
// check to make sure relationship does not already exist then add it
add_entity_relationship();
$newcount++;
}
if ( $newcount == 0 )
break;
$total += $newcount;
}
That's wonderful, ChungNg.
I had the intution is that "9999" is the member limit, but don't worry, my site will never hit that barrier. There are not that many intelligent people on the planet :) hahaha.
Ok, thanks for this. I understand what is going on with code I can see the function referenced in elgg/lib/relationships.php but how best to go about running this. Sorry, I am a newbie!
mucho problemo ;-) u fixed the datalists data root ? but elgg Objects still point to older data folder. sooooo you see "broken" file object @ download time.
When I move a site, I export the database and then do sed search and replace's on the dump file before importing it. I've never had a problem and have done it a few times. I think it is more robust than the instructions on the wiki site.
To your specific problem, you should be able to do a search through your database for entries related to your old data path. I think there are just 2 entries that need to be changed, the dataroot in the datalists table and in the metastrings/metadata tables, look for filestore::dir_root
@Cash, thanks a lot - easy when you know how.
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.