Skip to content
This repository has been archived by the owner on Nov 20, 2023. It is now read-only.

MyAlerts compatibility issues #4

Open
Sama34 opened this issue Dec 26, 2018 · 2 comments
Open

MyAlerts compatibility issues #4

Sama34 opened this issue Dec 26, 2018 · 2 comments
Assignees
Milestone

Comments

@Sama34
Copy link

Sama34 commented Dec 26, 2018

Hi, the upcoming version of OUGC Awards allows for MyAlerts integration, while testing your plugin I found that you insert the award directly into the DB.

I'd recommend to use the provided method so that all awards are inserted equally, for any insert hooks to run, and to ignite the alert code within the plugin.

The following change did it for me and should work even for the current official released package. From:

$db->insert_query('ougc_awards_users', [
'uid' => (int) $mybb->user['uid'],
'aid' => $aid,
'reason' => $db->escape_string($award['reason']),
'date' => TIME_NOW
]);

To:

			global $awards;
			$awards->give_award($awards->get_award($aid), $mybb->user, $award['reason']);
@Sama34
Copy link
Author

Sama34 commented Dec 26, 2018

Oh, I also found that the plugin doesn't allows for more than 1 award per user. I can't recall if this is forced within the current package, but for the coming update the plugin allows multiple granting. You might want to look into it.

@chack1172
Copy link
Owner

Thank you for reporting it. I'll check it and fix these problems in the next version.

@chack1172 chack1172 self-assigned this Jan 23, 2022
@chack1172 chack1172 added this to the Release 1.1 milestone Jan 23, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants