Welcome Guest ( Log In | Click here to Register a free account now! )
Welcome to Bleeping Computer, a free community where people like yourself come together to discuss and learn how to use their computers. Using the site is easy and fun. As a guest, you can browse and view the various discussions in the forums, but can not create a new topic or reply to an existing one unless you are logged in. Other benefits of registering an account are subscribing to topics and forums, creating a blog, and having no ads shown anywhere on the site.![]() ![]() |
May 29 2009, 09:15 PM
Post
#1
|
|
|
Senior Member ![]() ![]() ![]() ![]() Group: HJT Sophomore Classmen Posts: 440 Joined: 26-August 08 From: Victoria Member No.: 233,642 |
i want to have php check the number of rows when the page is loaded, then display the rows in descending order, wait 10 seconds, check to see if the number of rows has changed (if there are new messages) then have it either display a pop-up with javascript or refresh the <ul id="wall"></ul> bit... is this even possible? i got the code for the page from here -------------------- If I am helping you and don't reply in 24 hours please send me a PM
Currently in training... There's no place like 127.0.0.1 There are 10 types of people in the world, those that can read binary, and those who can't. |
|
|
|
May 30 2009, 08:33 AM
Post
#2
|
|
![]() Hail Groovicus! ![]() ![]() ![]() ![]() ![]() ![]() Group: Site Admin Posts: 7,961 Joined: 5-June 04 From: Centerville, SD Member No.: 689 |
Yes, it is possible. You need to store the number of messages within the user's session. If the number of threads change, then the server needs to push out the updated page.
-------------------- |
|
|
|
May 30 2009, 08:40 AM
Post
#3
|
|
|
Senior Member ![]() ![]() ![]() ![]() Group: HJT Sophomore Classmen Posts: 440 Joined: 26-August 08 From: Victoria Member No.: 233,642 |
how would i accomplish this?
i have been looking into javascript and AJAX combined with php. still is very very tricky and would love any help you could give! -------------------- If I am helping you and don't reply in 24 hours please send me a PM
Currently in training... There's no place like 127.0.0.1 There are 10 types of people in the world, those that can read binary, and those who can't. |
|
|
|
May 30 2009, 11:52 AM
Post
#4
|
|
![]() Hail Groovicus! ![]() ![]() ![]() ![]() ![]() ![]() Group: Site Admin Posts: 7,961 Joined: 5-June 04 From: Centerville, SD Member No.: 689 |
What I would recommend is looking at web pages that auto-update and figure out what they are doing. It is not something that anyone can sit down and tell you how to do in 3 minutes. Besides, this sort of functionality should not be part of the core features anyway. This should be considered an enhancement. Get the basic stuff working first.
-------------------- |
|
|
|
Jun 8 2009, 12:10 PM
Post
#5
|
|
|
Member ![]() ![]() Group: Members Posts: 20 Joined: 2-January 09 Member No.: 277,127 |
just to help you anyway even though groovicus is right about it being an enhancement, to do it you could use an iframe with a page which loads the messages and in that page just put in a piece of javascript to refresh the page every 10 secs
|
|
|
|
Jun 18 2009, 12:46 PM
Post
#6
|
|
|
Member ![]() ![]() Group: Members Posts: 134 Joined: 23-January 09 Member No.: 286,225 |
You could try looking at how Shoutboxes are created as it seems your using the same sort of functionality..
|
|
|
|
![]() ![]() |
| Lo-Fi Version | Time is now: 21st November 2009 - 08:35 PM |