PDA

View Full Version : List by most viewed


MikeCaine
17th of April 2006 (Mon), 09:43
If you set up a gallery view as follows -

Display = All In One Page
Category = All
List Type =Counter Graphs
Gallery = All Gallereis Combined

- you then get a list of all your photos and the views for each photo

Is is, or would it be, possible to order this veiw in either ascending or descending order?

Pekka
17th of April 2006 (Mon), 14:13
Yes, there is sorting direction like in http://photography-on-the.net/gallery/list.php?exhibition=all&u=9450-0

cruaux
17th of April 2006 (Mon), 15:34
[yourserverhere]/gallery/list.php?exhibition=all&pass=public&select_output=graph&perpage=1000&sort_row=ee_counter.ee_counter_value&order=ASC

Will give you ascending graphs by view, change the last argument to DESC and you'll get descending. I use this URL for a "most popular" link on my index page, and a form where the sort row is "&sort_row=ee_photo.ee_photo_id" for the "latest additions" search at www.ruaux.net/gallery/

Pekka
17th of April 2006 (Mon), 15:52
Better not to use table names but sort_row=counter , see http://photography-on-the.net/forum/showthread.php?t=17826 and http://photography-on-the.net/forum/showthread.php?t=21082

HMetal
17th of April 2006 (Mon), 19:36
[yourserverhere]/gallery/list.php?exhibition=all&pass=public&select_output=graph&perpage=1000&sort_row=ee_counter.ee_counter_value&order=ASC


I would hope that this doesn't work at all and if it does, eE needs to filter user input so that it does not work. User input should never be passed directly to a database query in this way.

Pekka
17th of April 2006 (Mon), 20:26
I would hope that this doesn't work at all and if it does, eE needs to filter user input so that it does not work. User input should never be passed directly to a database query in this way.

In EE 1.5 "hostile" input attempts may give SQL error (which should be suppressed as said in http://photography-on-the.net/forum/showthread.php?t=76923) but EE injection attacks can not do anything. In EE 2 all input data is filtered for problems, error gets you zero output (logged though) and above style of parameters are used only if legal.

MikeCaine
18th of April 2006 (Tue), 04:24
Yes, there is sorting direction like in http://photography-on-the.net/gallery/list.php?exhibition=all&u=9450-0

I don't have those extra input boxes, only the four that I listed. Is there some option in 1.5 that I've missed turning on or is it one of the extra features in 2.0?

MikeCaine
18th of April 2006 (Tue), 04:29
[yourserverhere]/gallery/list.php?exhibition=all&pass=public&select_output=graph&perpage=1000&sort_row=ee_counter.ee_counter_value&order=ASC


I get the following error when I try that

Exhibit Engine MySQL error!
ERROR FROM QUERY fetchlist_lang in page 'list':

MikeCaine
18th of April 2006 (Tue), 04:35
I don't have those extra input boxes, only the four that I listed. Is there some option in 1.5 that I've missed turning on

Yup, I've just found the tick boxes that I'd missed and can now sort any way I like :D