Hi Guys,
at the moment I am working on a plugin that connects to a external database and updates it when a user posts in a thread or creates a new thread.
This is my first plugin, so I have some questions and it would be really great if you could help me with this questions.
I try to get the username with the $user_data variable, but I cant get it to work. This is how I tried it:
Can you please tell me what I have done wrong.
If i would like to trigger a function when a new reply is made, are this two hook-points correctly ? newthread_end, newreply_end
Thanks alot for your help
at the moment I am working on a plugin that connects to a external database and updates it when a user posts in a thread or creates a new thread.
This is my first plugin, so I have some questions and it would be really great if you could help me with this questions.
I try to get the username with the $user_data variable, but I cant get it to work. This is how I tried it:
//taken from the email admin on new email plugin
function storeconnecter_global_start() {
global $mybb, $user_info, $db;
if ($mybb->settings['storeconnecter_enable'] == 1) {
// query user information
$query = $db->simple_select(
"users",
"uid, username, email, regip, regdate, referrer",
"uid=" . (int)$user_info['uid'] . ""
);
$userInfo = $db->fetch_array($query);
echo "My first plugin works! Username: ".$userInfo['username'];
}
}
and this is what I have got: http://d.pr/i/5S3VCan you please tell me what I have done wrong.
If i would like to trigger a function when a new reply is made, are this two hook-points correctly ? newthread_end, newreply_end
Thanks alot for your help