18
The intention of the script is to inform only users with the right countries in their source and target profile fields.
See that debug is on.
We gonna have to test this in steps.
1 Revert the code.
2 Make a new category, for not bothering other users.
3 Make a new ordinary user with an email address that you can monitor.
4 Make a new ad and see if notification is received.
5 Add/modify to
$user_list = array('123');
$notification_handler->triggerEvent('global', 0, 'ads_submit', $tags, $user_list);
Replace 123 to the userid from step 3
6 Make a new ad and see no notification is received
7 Modify to
$sql = 'SELECT * FROM '.$this->db->prefix('xoopsnotifications').' WHERE not_uid = 123 LIMIT 1'
$result = $xoopsDB->query($sql);
$user_list = array();
while($row = $xoopsDB->fetchArray($result)){
$user_list[] = $row['not_uid'];
}
$notification_handler->triggerEvent('global', 0, 'ads_submit', $tags, $user_list);
Replace 123 to the userid from step 3
8 Make a new ad and see no notification is received