English 中文(简体)
Ibb - 如何检查新的私人信息
原标题:mybb - how to check for new private messages

I m trying to build an chrome app/extension for my website which is mostly a mybb forum. I am wondering if anybody knows how would I check to see if a user has new Pm s or maybe new posts on his thread? Maybe by JS, AJAX, or PHP

最佳回答

就事件而言,一般说来,在被称为“......”的数据库中有一个领域,如果它们开立,那是假的,如果是真的。 在一页的负荷上,检查是否向用户发出过任何信息,如果是的话,则装上这些信息,并用JQuery作简短描述。 你还可以定期检查AJAX的小型文字。

As far as new posts go, the traditional way that I ve seen it done (but by no means the best way) is to keep a timestamp of when a user last visited the site. On page load, get every new post/topic that was created after that timestamp, then serialize this data and store it in the database, or in a cookie (if this serialized data already exists, unserialize it, merge the two and reserialize it). If a user visits a topic, get all data from the serialized entry that matches (IE, in the same topic, or the post number) and remove it from the serialized data. Then again on page load or by using an AJAX script, check periodically if they have an unread post on a topic that belong to them (IE, created after their last timestamp value), and use a bit of JQuery to notify them.

问题回答
  • Learn JQuery. It is a very friendly javascript framework and you will be up and running in no time. Coding in JQuery is fun!
  • Do periodic AJAX request.
  • inject data into DOM or maybe if you are creating a Google Chrome Extension like your tag is telling use the awesome Desktop Notifications System.




相关问题
selected text in iframe

How to get a selected text inside a iframe. I my page i m having a iframe which is editable true. So how can i get the selected text in that iframe.

How to fire event handlers on the link using javascript

I would like to click a link in my page using javascript. I would like to Fire event handlers on the link without navigating. How can this be done? This has to work both in firefox and Internet ...

How to Add script codes before the </body> tag ASP.NET

Heres the problem, In Masterpage, the google analytics code were pasted before the end of body tag. In ASPX page, I need to generate a script (google addItem tracker) using codebehind ClientScript ...

Clipboard access using Javascript - sans Flash?

Is there a reliable way to access the client machine s clipboard using Javascript? I continue to run into permissions issues when attempting to do this. How does Google Docs do this? Do they use ...

javascript debugging question

I have a large javascript which I didn t write but I need to use it and I m slowely going trough it trying to figure out what does it do and how, I m using alert to print out what it does but now I ...

Parsing date like twitter

I ve made a little forum and I want parse the date on newest posts like twitter, you know "posted 40 minutes ago ","posted 1 hour ago"... What s the best way ? Thanx.

热门标签