MyBB Community Forums
How do you get user info from a post? - Printable Version

+- MyBB Community Forums (https://community.mybb.com)
+-- Forum: Extensions (https://community.mybb.com/forum-201.html)
+--- Forum: Plugins (https://community.mybb.com/forum-73.html)
+---- Forum: Plugin Development (https://community.mybb.com/forum-68.html)
+---- Thread: How do you get user info from a post? (/thread-93968.html)



How do you get user info from a post? - Tom K. - 2011-05-10

I'm modifying the postbit and I want to get the user who posted's GID and postcount, so I can use it in a custom function I am hooking into the postbit. Smile


RE: How do you get user info from a post? - Yaldaram - 2011-05-10

You want to get Poster's Usergroup ID ?
$post['usergroup'] // Poster's Usergroup

$post['postnum'] // Poster's Number of Posts



RE: How do you get user info from a post? - Tom K. - 2011-05-10

So I just put that in my function?

function check() {
    Echo $post['usergroup'];
    echo $post'postnum'];
    }



RE: How do you get user info from a post? - Euan T - 2011-05-10

Should be

function check($post) {
   echo $post['foobar'];
}

if you're using the postbit hook Smile


RE: How do you get user info from a post? - Yaldaram - 2011-05-10

Yes, you can use these. But let me know what exactly you want with these variables ?


RE: How do you get user info from a post? - Tom K. - 2011-05-10

(2011-05-10, 11:36 AM)euantor Wrote: Should be

function check($post) {
   echo $post['foobar'];
}

if you're using the postbit hook Smile

I thought so Smile

Thanks guys Big Grin