I managed to temporarily fix this by using different hooks and code, but no I have to have 3 different hooks for what could be done with one (i think).
- ajax_complete
- newreply_post_complete
- newthread_post_complete
Can anyone fix the code below to work with userdata_postsave (or another 1 hook solution):
PHP Code:
if ($type == 'thread') {
$this->registry->db->query_write("UPDATE " . TABLE_PREFIX . "banners SET available = available + 100 WHERE userid = " . $this->registry->userinfo['userid']);
} else {
$this->registry->db->query_write("UPDATE " . TABLE_PREFIX . "banners SET available = available + 10 WHERE userid = " . $this->registry->userinfo['userid']);
}