MyBB Community Forums

Full Version: Querying if a user has posted in a specific thread
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
What I want to be able to accomplish is a bit complicated, but I THINK it can be done with some tweaking. I'm pretty new to php and mysql, but I pick up things quickly so I've been able to get a lot of what I need done with some online searching and experimenting.

A little background: I'm using myBB as part of an online research community with tasks put up every week. For participants, I want to be able to show them a checklist of what they have and have not done. I have the checklist structure in place, but with a couple hundred people, this is a pain to update manually.

I'm using myBB Integrator to have an external login page (necessary because users must also be directed elsewhere and I'm appending their email address to the end of the address using their email from the mybb_user table), so I have that infrastructure in place.

a) IF uid has posted in fid=n and tid=n, then echo $mybb->posts['message'] or echo a message that says they have posted (and potentially have a link to their post if they want to review it)

Additionally, in the mybb_userfields, I created the fields for each exercise that they will be completing, which will be filled out with complete, incomplete, or null.

Can I get the table to automatically update if the above condition is true? e.g. If uid has posted in fid=n and tid=n, then $mybb->user['fid10']=complete, if uid has not posted in fid=n and tid=n, then $mybb->user['fid']=incomplete


Second question (probably easier, too): If someone tries to access the forum, but they are not logged in, can I redirect them to the main login page?


Thanks for any and all help!