MyBB Community Forums

Full Version: PHP code to show if there are new PM on custom script.
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Greetings. I was thinking of getting a PHP code to check if there was a new PM for the user.

I have integrated what I could.

Put I need a function to check if the user which is online have a new PM.

And if so it should show the the New PM box like in the MyBB Header.

I have those arrays in my script which works together with MyBB.
$mybbu->username = MyBB Username
$mybbu->uid = MyBB UserID

Also all arrays which starts with "$mybbu->" will go get the value from the user which is online right now. The content which we put after "$mybbu->" is which database row we are going to select the value of.

I really hope someone would be able to help me making a PHP function which could do this.
I believe the users table actually has a column for unread pms - I believe it's just 'unreadpms', so you could use $mybbu->unreadpms.

EDIT: I was right, you can just use the unreadpms column. To see the full structure of the table, check here: http://wiki.mybb.com/index.php/Database_...mybb_users