jreed2132 Posted April 23, 2010 Share Posted April 23, 2010 I've written a Content Manage System for a web site that will allow users to post entries through the system, then have the items show up on a web site. The data is being stored in a MYSQL database Right now, on the web site, I'm just displaying them in a Newest at the top, oldest at the bottom format. How could I give the users access to control the order the way the entries are displayed on the page. Rather than just the standard order. Quote Link to comment https://forums.phpfreaks.com/topic/199497-how-to-let-users-control-order-records-display/ Share on other sites More sharing options...
Ken2k7 Posted April 23, 2010 Share Posted April 23, 2010 By order, you mean oldest at top and newest at bottom? It's not exactly clear. But you can do it by columns, assuming the database types are as they should be. Just have a link for each column that links to the same page, passing some query strings specifying what column to sort and in what order. If the user clicks on that same link again, it should go in the reverse order. I'm sure you've seen something like this before on teh web. Quote Link to comment https://forums.phpfreaks.com/topic/199497-how-to-let-users-control-order-records-display/#findComment-1047040 Share on other sites More sharing options...
jreed2132 Posted June 4, 2010 Author Share Posted June 4, 2010 Sorry for the delayed reply. I actually want to do it so that I see a list of all the records, but lets say I want to only take the 3rd record and move that to the top. I want to create a way so that the users using the system can easily do it. Quote Link to comment https://forums.phpfreaks.com/topic/199497-how-to-let-users-control-order-records-display/#findComment-1067664 Share on other sites More sharing options...
ignace Posted June 4, 2010 Share Posted June 4, 2010 Are these changes visible for all users? Or only for the current user? Quote Link to comment https://forums.phpfreaks.com/topic/199497-how-to-let-users-control-order-records-display/#findComment-1067678 Share on other sites More sharing options...
syed Posted June 4, 2010 Share Posted June 4, 2010 There are a few javascript libraries that can help you do this as a drag and drop feature, which would be better than having an up/ down arrow to bring the record to the top. If you want to save the changes per user, you will need a table to store the order of the records for each user. Quote Link to comment https://forums.phpfreaks.com/topic/199497-how-to-let-users-control-order-records-display/#findComment-1067684 Share on other sites More sharing options...
jreed2132 Posted June 4, 2010 Author Share Posted June 4, 2010 it would be a change that all users could see Quote Link to comment https://forums.phpfreaks.com/topic/199497-how-to-let-users-control-order-records-display/#findComment-1067724 Share on other sites More sharing options...
ignace Posted June 4, 2010 Share Posted June 4, 2010 There are a few javascript libraries that can help you do this as a drag and drop feature, which would be better than having an up/ down arrow to bring the record to the top. Just don't forget about Graceful Degradation so that people that have JS disabled (home or corporate) can fall-back to the up/down-system. Quote Link to comment https://forums.phpfreaks.com/topic/199497-how-to-let-users-control-order-records-display/#findComment-1067725 Share on other sites More sharing options...
ignace Posted June 4, 2010 Share Posted June 4, 2010 it would be a change that all users could see Then it will act as some sort of vote-count. Just add it as a field to the post so that on each click the total value is incremented. You would display them sorted based on this field. Quote Link to comment https://forums.phpfreaks.com/topic/199497-how-to-let-users-control-order-records-display/#findComment-1067727 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.