I have a forum which should have a new thread generated each time a new member is created. Sort of a "look who just joined" message with the new member's name and a link to their profile.
I can do this just fine when the user registers by adding a plugin at the register_addmember_complete hook.
But: sometimes (quite often in fact), a new member is added manually in the AdminCP using Add New User. In THAT case, register_addmember_complete isn't called. The closest I can find is useradmin_update_save (...and then I have to make sure the user is adding not editing).
The problem is, I can't seem to actually get the thread created using the same code which I used at the register_addmember_complete hook. No error message, just no thread.
Is there some special environment situation which I'm overlooking in the area around useradmin_update_save which doesn't apply around register_addmember_complete or vice-versa?
I'm trying to use:
PHP Code:
...
require_once('./global.php');
require_once('./includes/class_dm.php');
require_once('./includes/class_dm_threadpost.php');
...
$dmthread = new vB_DataManager_Thread_FirstPost($vbulletin, ERRTYPE_STANDARD);
...
$dmthread->do_set ('visible', $visible); // ... imagine various do_set's here
...
$tid = $dmthread->save();
...
The plugin is called at useradmin_update_save but... no thread created.
...any tips?