MyBB Community Forums

Full Version: Check if user has posted in certain threads?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Just wondered how you would check if I user had posted in a thread.

Function to Check user has posted in certain threads
If so do the following
If not, do this instead.

Thanks.
You've to run a query then check if the end user has posted or not, something like this;
$query = $db->simple_select("posts", "pid", "tid='{$post['tid']}' AND uid='{$mybb->user['uid']}'");
$check = $db->fetch_field($query, "pid");

if (!$check)
{
  // Oh the user didn't posted.
}
else
{
   // yes he has posted ;)
}