merylvingien Posted January 17, 2010 Share Posted January 17, 2010 Hi guys, i have built a sort of blog for my site and i am using the simple pagination script that can be found in the interesting articles on the homepage of this site. Everything is working perfectly at the moment. The way i have it set up is to show only one post per page and it is ordered by DESC. so it shows the last entry on the first page. What i would like to do, is on the right hand side of the page, is show all the blog titles or at least the last 10 blog entries and have these titles link to the page that these entries are on. This of course varies at any one time as people make new entries. I know it would be easier to have it pull the info from the databse in ascending order, and then all the links would remain the same, but anyone coming back to look would see the same old post on the first page and COULD think that nothing is new here. Be great if someone could help out here. Quote Link to comment https://forums.phpfreaks.com/topic/188785-simple-pagination/ Share on other sites More sharing options...
deansatch Posted January 17, 2010 Share Posted January 17, 2010 Since you have one article per page, just duplicate whatever you have done for the page numbers but use <a href="blahblah...">$title</a> instead of <a href="blahblah...">$page_number + 1 </a> (or whatever it is...you get my meaning though?) and use LIMIT 10 for the DB query. Pretty much impossible to say more than that without seeing your code. Quote Link to comment https://forums.phpfreaks.com/topic/188785-simple-pagination/#findComment-996709 Share on other sites More sharing options...
merylvingien Posted January 17, 2010 Author Share Posted January 17, 2010 Thanks for the reply, but its not as simple as that As the pagination builds the links on the fly. Hmmm i think to be able to do this would need a serious rebuild of the page. Unless someone has a miraculous idea! I am all ears. Quote Link to comment https://forums.phpfreaks.com/topic/188785-simple-pagination/#findComment-996728 Share on other sites More sharing options...
wildteen88 Posted January 17, 2010 Share Posted January 17, 2010 If I'm not mistaken but the code for displaying the next 10 blog entries will be completely separate to your current code. Quote Link to comment https://forums.phpfreaks.com/topic/188785-simple-pagination/#findComment-996755 Share on other sites More sharing options...
merylvingien Posted January 17, 2010 Author Share Posted January 17, 2010 Yea i am finding that out LOL I have built a seperate page that will take the topic titles and build each individual page out based on the titles. Not as pretty as having it all combined into one page, but at least people can link to each blog post with the links remaining correct. Quote Link to comment https://forums.phpfreaks.com/topic/188785-simple-pagination/#findComment-996772 Share on other sites More sharing options...
laffin Posted January 18, 2010 Share Posted January 18, 2010 Dont understand, why just not use 2 queries? one for the pagination and one for the last 10 posts. Quote Link to comment https://forums.phpfreaks.com/topic/188785-simple-pagination/#findComment-996881 Share on other sites More sharing options...
deansatch Posted January 18, 2010 Share Posted January 18, 2010 Dont understand, why just not use 2 queries? one for the pagination and one for the last 10 posts. That's what I said - if it can't be done the way I said, I am starting to imagine some messy code. This is usually why it's best to post your current code. Quote Link to comment https://forums.phpfreaks.com/topic/188785-simple-pagination/#findComment-997277 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.