never_rain Posted August 9, 2010 Share Posted August 9, 2010 I am working on a website where I have comments posted by users. I want to display 25 comments and if there are more, it will show a linke Older Posts similar to Facebook. Once I click on that, it will list down the next 25 comments and so on. This is something we can see in Facebook. Do you have any idea where I can find this script. I did search on google but couldn't find it. Probably bad keyword selection. any ideas for the resource. Thanks, Faisal Link to comment https://forums.phpfreaks.com/topic/210186-facebook-like-older-post-script/ Share on other sites More sharing options...
trq Posted August 9, 2010 Share Posted August 9, 2010 The idea is simple. Just LIMIT your first query to the top 25 results ordered by timestamp. Then, once a user clicks on 'more', execute another query to find the rest of the results. Link to comment https://forums.phpfreaks.com/topic/210186-facebook-like-older-post-script/#findComment-1096878 Share on other sites More sharing options...
never_rain Posted August 9, 2010 Author Share Posted August 9, 2010 Hi, thanks for the tip.. I am not sure how to do this as don't know too much of it. If you can do some code here.. that'll help Link to comment https://forums.phpfreaks.com/topic/210186-facebook-like-older-post-script/#findComment-1096885 Share on other sites More sharing options...
trq Posted August 9, 2010 Share Posted August 9, 2010 So, the link in your signature is what? Link to comment https://forums.phpfreaks.com/topic/210186-facebook-like-older-post-script/#findComment-1096907 Share on other sites More sharing options...
onlyican Posted August 9, 2010 Share Posted August 9, 2010 Do you mean a JavaScript script, where you click "more" and more comments just show up, expanding the box? Link to comment https://forums.phpfreaks.com/topic/210186-facebook-like-older-post-script/#findComment-1097029 Share on other sites More sharing options...
xangelo Posted August 9, 2010 Share Posted August 9, 2010 What you're essentially looking for is to couple thorpe's idea with onlyican. You'll need to run an asynchronous javascript request which would run the query and output the results as either xml or json. Your javascript can then deal with it as you want. I'd advise you to look at a javascript library such as jQuery, Dojo or MooTools. Their implementations of AJAX are cross browser. They also have tutorials on how to use them in their documentation. Link to comment https://forums.phpfreaks.com/topic/210186-facebook-like-older-post-script/#findComment-1097033 Share on other sites More sharing options...
Destructiva Posted November 10, 2010 Share Posted November 10, 2010 Hi there! I want to do the same principle of the Facebook's "Older Post Script", but I want to load pictures when click, can anyone point me to the code to do this? Thanks! Link to comment https://forums.phpfreaks.com/topic/210186-facebook-like-older-post-script/#findComment-1132750 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.