php - mybb - how to check for new private messages -
i'm trying build chrome app/extension website mybb forum. wondering if knows how check see if user has new pm's or maybe new posts on thread? maybe js, ajax, or php
as far events go, pm's there field in database called 'read', false if haven't opened it, , true if have. on page load, check see if there messages user 'unread', , if so, load them, , use jquery make pop saying short description of them. have small ajax script periodically check this.
as far new posts go, traditional way i've seen done (but no means best way) keep timestamp of when user last visited site. on page load, every new post/topic created after timestamp, serialize data , store in database, or in cookie (if serialized data exists, unserialize it, merge 2 , reserialize it). if user visits topic, data serialized entry matches (ie, in same topic, or post number) , remove serialized data. again on page load or using ajax script, check periodically if have 'unread' post on topic belong them (ie, created after last timestamp value), , use bit of jquery notify them.
Comments
Post a Comment