8
Quote:
ghia wrote:
Quote:This will be used by notifications module as filter criteria
So, from all users that subscribed, only the users that match languages should receive the notification?
The code is:
if (!empty($user_list)) {
$user_criteria = new CriteriaCompo();
foreach ($user_list as $user) {
$user_criteria->add (new Criteria('not_uid', $user), 'OR');
}
$criteria->add($user_criteria);
}
So if $user_list is array('1','12','145')
it push to the query something like this:
AND (not_uid = '1' OR not_uid = '12' OR not_uid = '145')
Remember that the users that are on the table are just the ones who selected to be notified so this will force a filter.
If you pass other users that did not choosed to be notified it will not be a problem because they are not in the table and they wont return in a row.
Deka:
This is a good line for changes:
$notification_handler->triggerEvent('global', 0, 'ads_submit', $tags);
First you must get your user list(as an array) based on the ad language. Then you need to pass your user list as follows
$user_list = array('1','23','134');//do this your way
$notification_handler->triggerEvent('global', 0, 'ads_submit', $tags, $user_list);
Do this for the events you like (in this case we are dealing with the category 'global' event 'ads_submit')