Ajax based new posts

vinkin

New Member
Messages
54
Reaction score
0
Points
0
The plugin is working very fine... thought it updates some time wrong timings but once refreshed its fine.
 

matthew88

New Member
Messages
9
Reaction score
1
Points
0
I worked with AJAX a bit before, what i would recommend you wouldnt like since ur not so great with javascript, but its awsome to pick up on after awhile.

Anyways the code you would have to write would be javascript to check for new post without refreshing ur page. To do this you tell the javascript to check a PHP page called, php_check_database.php if ur not checking the database for information but instead a FILE, well your going to be sorta screwed unless you addon the javascript HEADER request limit for information.

On ur current page the information you want must be set up DIV or some other BLOCK element. Blah Blah Blah, yes im boring you with all this crap. But anyways you grab a bit of code from the reading source. Afterwards you compare that information to the current information or last post made on you webpage. If the information is different it means a new post was made and it should fetch that information from the database.

If you using a database for information retrieve fetching a TIME-STAMP is the best least possible bandwidth consuming information fetch you can do. Lmao now that im done i hope you have some understanding of the back and forth requird information required between server and client. Client is the javascript request and server is the PHP asking for updated information/Time-stamp. Once the returned information is different than on the current page it sets another code to fetch the new information and add it onto the current DIV/BLOCK element.
Edit:
1 Thing i forgot, you have to set your HEADERS to not cache the page, if not AJAX might not load correctly.
 
Last edited:

vinkin

New Member
Messages
54
Reaction score
0
Points
0
Thanks for the good illustration of the working mechanism, but I have a question why did you explain it ? as I think admin knows it well and me too. So i would really appreciate it if you have a better code than the admin has provided.

But still never the less good description.
 

Christopher

Retired
Messages
14,659
Reaction score
8
Points
0
Sorry. I've been extremely busy with a ton of projects. I'll try to release the update sometime in February.
 

vinkin

New Member
Messages
54
Reaction score
0
Points
0
Admin, now again a problem :(
The plugin you gave is compatible for 1.4 but now as we upgraded to 1.6 its not installing :(

Any suggestions ?
 
Top