Sort Orders/Field Filtering

All notes and input on 2.0 Development are herein. <ul><li>Feature requests</li>
<li>Bug Reports</li>
<li>Beta Testing Feedback</li>
<li>Open Dev Discussion</li></ul>

Moderator: Coranto Moderator Team

Sort Orders/Field Filtering

Postby bozoka45 » Sat Oct 01, 2005 7:22 am

I think one of the advances that needs to be made with the next version/update is an updated Sortin and Filtering section. At the moment, news items can only be limited on number by time and PerlCode needs to be used to arrive at the desired effect. I believe we need a MySQL-like filtering and sorting system. I don't mean using MySQL, but I meaning using their methods. With SQL, you can specify multiple fields meeting multiple requirements, and then order them by any number of fiends, and limit the results to a certain amount.

If anyone requires any examples, I'll be happy to supply some.
User avatar
bozoka45
 
Posts: 1159
Joined: Sun Mar 23, 2003 8:38 pm
Location: New Orleans

Postby bozoka45 » Sun Oct 02, 2005 10:22 am

Just had a really, really cool idea that came to mind and wanted to write it down somewhere before going to sleep for the night. This is more of an addon that I'll most probably be developing rather than a core request, but it's interesting. I want to allow users to enter an SQL command and use that in place of the normal filterting and sorting done by Coranto.

Unfortunately only advanced users might be able to benefit, but SQL is well documented and explained around the web, which hopefully make it more beneficial to people.
User avatar
bozoka45
 
Posts: 1159
Joined: Sun Mar 23, 2003 8:38 pm
Location: New Orleans

Postby SrNupsen » Sun Oct 02, 2005 4:48 pm

Hm. I agree to the benfit of flexibility, but you might just as well present users with a dropdown list of possible commands. Reason? If you allow users to enter their own SQL commands you will have to do MAJOR security checking.

SrNupsen
-----------------------------------------------------------------------------------------------------
Coranto is free software. I am available for custom work or troubleshooting.

http://www.sundaune.no - transkripsjon, webdesign, nettsider, tekstbyrå
http://www.vagbladet.no - satire, politikk, kultur, sport, nettavis
-----------------------------------------------------------------------------------------------------
SrNupsen
 
Posts: 2229
Joined: Tue Jan 09, 2007 6:46 pm
Location: Nesodden, outside Oslo, Norway

Re: Sort Orders/Field Filtering

Postby Parahead » Sun Oct 02, 2005 7:43 pm

bozoka45 wrote:I think one of the advances that needs to be made with the next version/update is an updated Sortin and Filtering section. At the moment, news items can only be limited on number by time and PerlCode needs to be used to arrive at the desired effect.
The Profile Numeric Filter addon was created to allow users to do Filter -> Sorting as well as Sorting -> Filtering. For more demanding sorting needs you have the SortOrders addon (could be improved though, as mentioned here) and the FilterByField addon for filtering... Using these addons together you should be able to do what you want?

Sidenote: the Profile Numeric Filter addon is modifing the core to some extent to do its stuff, so I have thought about integrating that functionality into the 1.31.x core instead.
Yes, I am still around...
www.parahead.com/coranto/
User avatar
Parahead
 
Posts: 4837
Joined: Fri Jan 12, 2007 8:54 pm
Location: Stockholm - Sweden

Postby bozoka45 » Sun Oct 02, 2005 7:56 pm

SrNupsen wrote:Hm. I agree to the benfit of flexibility, but you might just as well present users with a dropdown list of possible commands. Reason? If you allow users to enter their own SQL commands you will have to do MAJOR security checking.

SrNupsen


As with my SQLSearch addon, users would only be able to start a query with

Code: Select all
SELECT * FROM CORANTO_DB


It's hard coded into the addon so there's really not a way around it. Also, if the SQL entry box appears on a profile page, then it will only be available to administrators. Do you think that would cover most security?

Code: Select all
The Profile Numeric Filter addon was created to allow users to do Filter -> Sorting as well as Sorting -> Filtering. For more demanding sorting needs you have the SortOrders addon (could be improved though, as mentioned here) and the FilterByField addon for filtering... Using these addons together you should be able to do what you want?


Ah..I knew there was an addon that allowed to change the order of sort vs filter, I just couldn't find it (Even after looking at your site). I am using SortOrders and FilterByField already. One thing to mention is that this would expand both addons, as you could filter by an unlimited amount of fields and sort by an unlimited amount of fields.
User avatar
bozoka45
 
Posts: 1159
Joined: Sun Mar 23, 2003 8:38 pm
Location: New Orleans

Postby Parahead » Sun Oct 02, 2005 8:31 pm

bozoka45 wrote:Ah..I knew there was an addon that allowed to change the order of sort vs filter, I just couldn't find it (Even after looking at your site). I am using SortOrders and FilterByField already.
Sorry. And I agree, the name of that addon isn't that good. Well, if the functionality is incorporated into the core, it doesn't matter any more... ;-)

bozoka45 wrote:One thing to mention is that this would expand both addons, as you could filter by an unlimited amount of fields and sort by an unlimited amount of fields.
True. But is the demand for this that big? To my knowledge there has been no requests to be able to sort by or filter on more than two fields? Extending the SortOrders and FilterByField addons to add new input fields dynamically when the first ones has been filled would achive the same effect and would be much simpler than creating a "SELECT * FROM CORANTO_DB"-addon? How often do you you create SELECT-statements that uses SORT BY with more than two fields?
Yes, I am still around...
www.parahead.com/coranto/
User avatar
Parahead
 
Posts: 4837
Joined: Fri Jan 12, 2007 8:54 pm
Location: Stockholm - Sweden

Postby bozoka45 » Mon Oct 03, 2005 12:14 am

Parahead wrote:True. But is the demand for this that big? To my knowledge there has been no requests to be able to sort by or filter on more than two fields? Extending the SortOrders and FilterByField addons to add new input fields dynamically when the first ones has been filled would achive the same effect and would be much simpler than creating a "SELECT * FROM CORANTO_DB"-addon? How often do you you create SELECT-statements that uses SORT BY with more than two fields?


There's not alot of demand for alot of the addons I write, I mostly write them for myself. This is something that would be much easier on me. Anyway, looking at the code for build news I'm not quite sure how possible it will be.
User avatar
bozoka45
 
Posts: 1159
Joined: Sun Mar 23, 2003 8:38 pm
Location: New Orleans

Postby Parahead » Mon Oct 03, 2005 7:33 am

bozoka45 wrote:There's not alot of demand for alot of the addons I write, I mostly write them for myself. This is something that would be much easier on me. Anyway, looking at the code for build news I'm not quite sure how possible it will be.
Aha, OK... Sorry, I thought this was a more general request and discussion. Still, I think that the three addons I mentioned above do fulfill your request, however slightly limited at the moment with only being able to filter/sort on two fields (maybe coverring ~95% of most users need?), but improving them to allow more fields would basically cover even your needs, right?

I just feel that using those addons are a little more userfriendly than having to specify a SQL query? Also, you would need to extend the SQL syntax slightly to let you specify if numeric, alphabetical or true alphabetical sorting should be performed on each individual field (as well has handling Ascending/Descending sorting).
Yes, I am still around...
www.parahead.com/coranto/
User avatar
Parahead
 
Posts: 4837
Joined: Fri Jan 12, 2007 8:54 pm
Location: Stockholm - Sweden

Postby bozoka45 » Mon Oct 03, 2005 7:46 am

I like the idea, if you've seen my SQLSearch I'd like to base it on that, except have it build news rather than use it to search through news.
User avatar
bozoka45
 
Posts: 1159
Joined: Sun Mar 23, 2003 8:38 pm
Location: New Orleans


Return to Coranto 2.0 Development

Who is online

Users browsing this forum: No registered users and 0 guests