Advanced search  

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Pages: [1]   Go Down

Author Topic: Sorting Sub-categories (user galleries) by date  (Read 3399 times)

0 Members and 1 Guest are viewing this topic.

turtleboy

  • Coppermine novice
  • *
  • Offline Offline
  • Gender: Male
  • Posts: 36
    • SkylineDesigns
Sorting Sub-categories (user galleries) by date
« on: April 07, 2004, 04:28:35 pm »

I searched, tried the things I found in search, nothing worked.

How do you sort the user categories in order of date created with the earliest album first in each category? (sorting the list of users galleries)

photoman13

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Posts: 96
Sorting Sub-categories (user galleries) by date
« Reply #1 on: April 07, 2004, 04:33:31 pm »

do a search for albums AND order and this is what ya find :)
Logged

Casper

  • VIP
  • Coppermine addict
  • ***
  • Country: 00
  • Offline Offline
  • Gender: Male
  • Posts: 5231
Sorting Sub-categories (user galleries) by date
« Reply #2 on: April 07, 2004, 06:14:04 pm »

See if this thread helps, http://forum.coppermine-gallery.net/index.php?topic=1379&postdays=0&postorder=asc&highlight=order+date&start=0

It is not straight forward, as the user galleries page is actually showing sub-categories, and the albums are on the sub-cat page.
Logged
It has been a long time now since I did my little bit here, and have done no coding or any other such stuff since. I'm back to being a noob here

turtleboy

  • Coppermine novice
  • *
  • Offline Offline
  • Gender: Male
  • Posts: 36
    • SkylineDesigns
Sorting Sub-categories (user galleries) by date
« Reply #3 on: April 08, 2004, 06:23:08 am »

Yea already tried all that out, seems like it only orders the albums in the categories.. not the sub categories.

Anyone else have a solution? The default is alphabetic.

turtleboy

  • Coppermine novice
  • *
  • Offline Offline
  • Gender: Male
  • Posts: 36
    • SkylineDesigns
Sorting Sub-categories (user galleries) by date
« Reply #4 on: April 09, 2004, 10:38:12 pm »

Ok I did some database browsing and tried my hand at php, and finally got the sub cats (user galleries) to sort in different orders, I can post what I did if anyone wants to know.

Casper

  • VIP
  • Coppermine addict
  • ***
  • Country: 00
  • Offline Offline
  • Gender: Male
  • Posts: 5231
Sorting Sub-categories (user galleries) by date
« Reply #5 on: April 09, 2004, 10:40:01 pm »

Please do, all tips and tricks are welcome, and will no doubt be just what someone else will also want.  :wink:
Logged
It has been a long time now since I did my little bit here, and have done no coding or any other such stuff since. I'm back to being a noob here

turtleboy

  • Coppermine novice
  • *
  • Offline Offline
  • Gender: Male
  • Posts: 36
    • SkylineDesigns
Sorting Sub-categories (user galleries) by date
« Reply #6 on: April 09, 2004, 11:18:04 pm »

Alright here's what I did:

On line 216 of index.php:
        $sql = "SELECT user_id," . "                user_name," . "                COUNT(DISTINCT a.aid) as alb_count," . "                COUNT(DISTINCT pid) as pic_count," . "                MAX(pid) as thumb_pid " . "FROM {$CONFIG['TABLE_USERS']} AS u " . "INNER JOIN {$CONFIG['TABLE_ALBUMS']} AS a ON category = " . FIRST_USER_CAT . " + user_id " . "INNER JOIN {$CONFIG['TABLE_PICTURES']} AS p ON p.aid = a.aid " . "WHERE approved = 'YES' " . "$FORBIDDEN_SET " . "GROUP BY user_id " . "ORDER BY user_name ";

The red part is what you edit.
The values you can change it to are:
  • user_name (alphabetically by user name)
  • user_id (the ID of the user, the first user (you) is 1 , and every one after that is numbered sequentially according to when they registered, sorts numerically)
  • user_lastvisit (order them by last visit date (although some users in my db are all 00:00:00 so I don't know how well this one will work)
  • user_regdate (orders them by their registration date, i think this is pretty much the same as user_id)[/list:u]
    There are other values you can use, but none of them would seem to be very useful.

turtleboy

  • Coppermine novice
  • *
  • Offline Offline
  • Gender: Male
  • Posts: 36
    • SkylineDesigns
Re: Sorting Sub-categories (user galleries) by date
« Reply #7 on: June 11, 2004, 11:00:58 pm »

Just a quick update, if anyone wants to do this on 1.3.0 the code is one line 295 of index.php
Pages: [1]   Go Up
 

Page created in 0.019 seconds with 14 queries.