Sorting by join date [message #25826] |
Wed, 22 June 2005 23:12 |
enicholse
Messages: 30 Registered: May 2005
Karma: 0
|
Member |
|
|
It appears that finduser does not sort properly by join date.
Here is an example.
0 Mon, 30 May 2005
0 Sat, 28 May 2005
0 Sat, 28 May 2005
0 Sat, 28 May 2005
0 Sat, 28 May 2005
0 Sat, 28 May 2005
1 Mon, 30 May 2005
1 Mon, 30 May 2005
2 Mon, 30 May 2005
4 Sun, 29 May 2005
I added last_visit column to finduser also, it will not sort properly either.
This is OSX, there was a problem with setting the globals Server Time Zone when I set up this fudforum, I had to manually set time zones in the database. Could this be the problem?
Aloha, Eric
[Updated on: Wed, 22 June 2005 23:56] Report message to a moderator
|
|
|
Re: Sorting by join date [message #25827 is a reply to message #25826] |
Wed, 22 June 2005 23:33 |
Ilia
Messages: 13241 Registered: January 2002
Karma: 0
|
Senior Member Administrator Core Developer |
|
|
It could be a timezone issue, are you running 2.6.13 by any chance?
FUDforum Core Developer
|
|
|
|
Re: Sorting by join date [message #25829 is a reply to message #25828] |
Wed, 22 June 2005 23:41 |
Ilia
Messages: 13241 Registered: January 2002
Karma: 0
|
Senior Member Administrator Core Developer |
|
|
Try running the query manually, see if the unix timestamps are in the proper order.
FUDforum Core Developer
|
|
|
Re: Sorting by join date [message #25830 is a reply to message #25829] |
Wed, 22 June 2005 23:54 |
enicholse
Messages: 30 Registered: May 2005
Karma: 0
|
Member |
|
|
Manually in the sql database?
SELECT `last_visit` FROM `fud2613_users` ORDER BY `last_visit`
looks like oldest to newest
Database fudforum - Table fud2613_users running on localhost
"1117321876"
"1117490375"
"1117559687"
"1118265023"
"1118940635"
"1118949923"
"1118950637"
"1118951345"
"1118951354"
"1118951374"
"1118952288"
"1118952804"
"1118952808"
"1118953218"
"1118953313"
"1118954157"
"1118954357"
"1118954445"
"1118956086"
"1118956229"
"1118963992"
"1118968373"
"1118978723"
"1118986442"
"1119015061"
"1119020877"
"1119051591"
"1119131507"
"1119143183"
"1119233025"
"1119240875"
"1119280770"
"1119293461"
"1119298774"
"1119302374"
"1119313142"
"1119373040"
"1119377583"
"1119378263"
"1119378509"
"1119378722"
"1119379023"
"1119379407"
"1119379578"
"1119380070"
"1119380117"
"1119380240"
"1119380565"
"1119380994"
"1119381015"
"1119381542"
"1119382088"
"1119382793"
"1119383871"
"1119384000"
"1119385000"
"1119385835"
"1119385898"
"1119389342"
"1119389830"
"1119389859"
"1119389982"
"1119391263"
"1119391874"
"1119393034"
"1119398433"
"1119403107"
"1119406676"
"1119408073"
"1119412247"
"1119412276"
"1119412847"
"1119415064"
"1119415300"
"1119416665"
"1119421119"
"1119446899"
"1119447087"
"1119447289"
"1119449067"
"1119451731"
"1119454721"
"1119460749"
"1119461837"
"1119467037"
"1119469470"
"1119476494"
"1119476745"
"1119479643"
"1119482113"
"1119482159"
"1119482941"
"1119483854"
[Updated on: Fri, 24 June 2005 08:08] Report message to a moderator
|
|
|
|
Re: Sorting by join date [message #25845 is a reply to message #25832] |
Thu, 23 June 2005 13:21 |
Ilia
Messages: 13241 Registered: January 2002
Karma: 0
|
Senior Member Administrator Core Developer |
|
|
The upgrade script does not convert templates, if the template has been modified between versions, your old copy is backed up by the forum and new variant written.
As far as the sort bug, the "natural" or registration date order is based on the id field, which usually will correspond with registration time. If that is not the case on your forum, modify finduser.php.t and change
$ord = 'id DESC';
to
$ord = 'join_date DESC';
FUDforum Core Developer
|
|
|
Re: Sorting by join date [message #25889 is a reply to message #25826] |
Fri, 24 June 2005 07:57 |
enicholse
Messages: 30 Registered: May 2005
Karma: 0
|
Member |
|
|
Here are my edits. They are not working. The date is ordered displayed as in my original posting.
The column "Join Date" in the finduser.tmpl GUI has been modified to "Last Visit Date" a click takes you to index.php?t=finduser&usr_login=&S=e8c73e310c865aff5a2567c28b69dccd& amp; amp; amp;vd=1&btn_submit=Find
Here, the Last Visit Date wont sort quite right.
notice the vd=1 in the url, this corresponds to the $ord in *finduser.php.t
finduser.php.t
if (isset($_GET['pc'])) {
$ord = 'posted_msg_count DESC';
} else if (isset($_GET['us'])) {
$ord = 'alias';
} else if (isset($_GET['vd'])) {
$ord = 'last_visit';
} else {
$ord = 'id DESC';
}
********and********
$find_user_data = '';
$c = uq('SELECT /*!40000 SQL_CALC_FOUND_ROWS */ home_page, users_opt, al
ias, name, last_visit, join_date, posted_msg_count, id FROM {SQL_TABLE_PREFIX}us
ers WHERE ' . $qry . ' id>1 ORDER BY ' . $ord . ' ' . $lmt);
**message
finduser_joindate: = Last Visit Date
**
*finduser.tmpl
<th nowrap><div align=
"center"><a href="{TEMPLATE: FINDUSER_PAGE_lnk4}" class="thLnk">{MSG: finduser_j
oindate}</a></div></th>
********and********
{SECTION: FINDUSER_PAGE_lnk4}
{ROOT}?t=finduser&usr_login={VAR-URL: usr_login}&{DEF: _rsid}&vd=1&a
mp;btn_submit=Find
{SECTION: END}
*date_formats.tmpl
{SECTION: finduser_join_date}
{DATE: r->join_date %a, %d %B %Y}
{SECTION: END}
Are you saying "$ord = 'last_visit';" should be "$ord = 'last_visit DESC';" would this really make a difference? Yes, it did. Just a little DESC. Thanks for the help! Of these changes, will they make it through the upgrade.php ?
Aloha, Eric
[Updated on: Fri, 24 June 2005 08:07] Report message to a moderator
|
|
|
|
|
Re: Sorting by join date [message #25902 is a reply to message #25892] |
Fri, 24 June 2005 13:19 |
Ilia
Messages: 13241 Registered: January 2002
Karma: 0
|
Senior Member Administrator Core Developer |
|
|
At the bottom of the script there is code generating pager links, you need to add your parameter there.
FUDforum Core Developer
|
|
|
|
|
Re: Sorting by join date [message #25923 is a reply to message #25922] |
Fri, 24 June 2005 20:20 |
Ilia
Messages: 13241 Registered: January 2002
Karma: 0
|
Senior Member Administrator Core Developer |
|
|
Wrong page, you should've edited finduser.php.t, the bottom of the script. The normal sorts by ID since ID field is indexed but the date field is not, which means ordering by id field is faster. As far as data order, unless you are adding users through some other tool, join date order will correspond with id order.
FUDforum Core Developer
|
|
|
|
Re: Sorting by join date [message #25929 is a reply to message #25928] |
Sat, 25 June 2005 02:06 |
Ilia
Messages: 13241 Registered: January 2002
Karma: 0
|
Senior Member Administrator Core Developer |
|
|
If it is not modifed since the release you are using then yes, otherwise old files will be backed up and overwritten by the upgrade script.
FUDforum Core Developer
|
|
|