Hello,
I use a cronjob to put some metadata of the users from another system into elgg. The cronjob runs every 10 minutes and it creates, updates and delete metadata. And everything is logged in the elgg systemLog. Now I have got 752,237 entries in the elgg_system_log table.
Can I turn off the system log for this action?
For setting the metadata I use $entity->metadata='value';
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.
- DhrupDeScoop@Dhrup2000
DhrupDeScoop - 0 likes
- tobi@telltarget
tobi - 0 likes
- DhrupDeScoop@Dhrup2000
DhrupDeScoop - 0 likes
You must log in to post replies.post that code here and we can then spend some time to study it to see what more code is needed to do what you're seeking.
OK, here is the code. It is a API function
/**
* Ratings and Votings into elgg
* ids is a string like that:
* VideoID:Rating:Count_of_Votes;VideoID2 ...
*
* @param string $ids
* @return string
*/
function apiSetRating($ids){
if(!empty($ids)){
$ignore = elgg_set_ignore_access(true);
$ids=explode(';',$ids);
$meldung='';
$error='';
while (list($er)=each($ids)) {
$idRat=explode(':',$ids[$er]);
//get video
$video=get_entity(intval($idRat[0]));
if(!is_object($video)){
$error .='Video '.$idRat[0].' not found
';
}else{
$meldung.='
Video: '.intval($idRat[0]).'
Rating: '.intval($idRat[1]).'
Voting: '.intval($idRat[2]);
//set Rating
$video->agvideoRating=intval($idRat[1]);
//count votings
$video->agvideoVotings=intval($idRat[2]);
}
}
elgg_set_ignore_access($ignore);
return array('succsess'=>'Ratings and Votigs ok','error'=>$error,'Meldung'=>$meldung);
}
return array('error'=>'no IDs');
}
i don't see any explicit ->save() !?;-)
try :-
elgg_unregister_event_handler('all', 'all', 'system_log_listener');
elgg_unregister_event_handler('log', 'systemlog', 'system_log_default_logger');
call.. apiSetRating($ids);
elgg_register_event_handler('all', 'all', 'system_log_listener');
elgg_register_event_handler('log', 'systemlog', 'system_log_default_logger');
-- but need to set it back after your call. - function code is core - not avail to you! how ?