FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » FUDforum Development » Bug Reports » Sorting by join date
Show: Today's Messages :: Polls :: Message Navigator
Switch to threaded view of this topic Create a new topic Submit Reply
Sorting by join date [message #25826] Wed, 22 June 2005 23:12 Go to next message
enicholse is currently offline  enicholse   United States
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 Go to previous messageGo to next message
Ilia is currently offline  Ilia   Canada
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 #25828 is a reply to message #25827] Wed, 22 June 2005 23:34 Go to previous messageGo to next message
enicholse is currently offline  enicholse   United States
Messages: 30
Registered: May 2005
Karma: 0
Member
Running 2.6.13 with an updated tz.inc.t

http://cvs.prohost.org/c/index.cgi/FUDforum/getfile/install/forum_data/src/ tz.inc.t?v=1.12

I did a sql update of all users so their time zone in their profiles are all USA/Los Angeles. The fudforum global time zone setting is USA/Los Angeles also.

Still not working.

Aloha, Eric

[Updated on: Wed, 22 June 2005 23:44]

Report message to a moderator

Re: Sorting by join date [message #25829 is a reply to message #25828] Wed, 22 June 2005 23:41 Go to previous messageGo to next message
Ilia is currently offline  Ilia   Canada
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 Go to previous messageGo to next message
enicholse is currently offline  enicholse   United States
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 #25832 is a reply to message #25826] Thu, 23 June 2005 00:37 Go to previous messageGo to next message
enicholse is currently offline  enicholse   United States
Messages: 30
Registered: May 2005
Karma: 0
Member
I upgraded to 2.6.14rc1 and it works the same - broken.

In addition, the upgrade script did not import my theme correctly, it lost my logo and some other changes to templates.

Aloha, Eric
Re: Sorting by join date [message #25845 is a reply to message #25832] Thu, 23 June 2005 13:21 Go to previous messageGo to next message
Ilia is currently offline  Ilia   Canada
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 Go to previous messageGo to next message
enicholse is currently offline  enicholse   United States
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&amp;usr_login={VAR-URL: usr_login}&amp;{DEF: _rsid}&amp;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 #25891 is a reply to message #25826] Fri, 24 June 2005 08:14 Go to previous messageGo to next message
enicholse is currently offline  enicholse   United States
Messages: 30
Registered: May 2005
Karma: 0
Member
Looks like it only works on the first page of the returned results in the GUI. If you click on next page or 2 of the results, the date is sorted incorrectly.

Uh oh. What to do now?

Aloha, Eric
Re: Sorting by join date [message #25892 is a reply to message #25826] Fri, 24 June 2005 08:18 Go to previous messageGo to next message
enicholse is currently offline  enicholse   United States
Messages: 30
Registered: May 2005
Karma: 0
Member
Looks like &vd=1 needs to be in the urls of the navigation links.

Where does this take place?

We should move this posting to How To?

Aloha, Eric

[Updated on: Fri, 24 June 2005 08:19]

Report message to a moderator

Re: Sorting by join date [message #25902 is a reply to message #25892] Fri, 24 June 2005 13:19 Go to previous messageGo to next message
Ilia is currently offline  Ilia   Canada
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 #25921 is a reply to message #25902] Fri, 24 June 2005 20:05 Go to previous messageGo to next message
enicholse is currently offline  enicholse   United States
Messages: 30
Registered: May 2005
Karma: 0
Member
I had to edit draw_pager.inc.t and add

$page_first_url = $arg . $upfx . $suf . "&vd=1";
$page_prev_url = $arg . $upfx . $page_start . $suf . "&vd=1" ;

***and***

$page_next_url = $arg . $upfx . $page_start . $suf . "&vd=1";
$page_last_url = $arg . $upfx . $page_start_2 . $suf ."&vd=1";


Is there one spot I can add this instaed of how I added it in two places?

Aloha, Eric
Re: Sorting by join date [message #25922 is a reply to message #25826] Fri, 24 June 2005 20:10 Go to previous messageGo to next message
enicholse is currently offline  enicholse   United States
Messages: 30
Registered: May 2005
Karma: 0
Member
The only column I am using in my custom theme is Last Visit Date in place of Join Date. Now a question as to why Join Date didnt sort properly in the default theme? Because it is sorted first by ID then Join_Date?

Aloha, Eric
Re: Sorting by join date [message #25923 is a reply to message #25922] Fri, 24 June 2005 20:20 Go to previous messageGo to next message
Ilia is currently offline  Ilia   Canada
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 #25928 is a reply to message #25923] Sat, 25 June 2005 01:59 Go to previous messageGo to next message
enicholse is currently offline  enicholse   United States
Messages: 30
Registered: May 2005
Karma: 0
Member
In the begining I added my users with sql insert statements then made table wide update statements. Some users were already existing. Existing users had join_dates previous to inserted users some had the same. This is why the sort order for Join Date in the gui didnt work. If I ever need to use Join Date in my GUI I'll remove ID from the sort Im not too concerned about speed.

Found where you were talking about in finduser.php.t

$pager = tmpl_create_pager($start, $count, $total, $pg, "&vd=1");

So will these changes make it through an upgrade.php?

Will an image in /fuddata/thm/customtheme/images like logo.png and logo.gif make it through an upgrade.php?

Thanks for all your help!

Aloha, Eric
Re: Sorting by join date [message #25929 is a reply to message #25928] Sat, 25 June 2005 02:06 Go to previous message
Ilia is currently offline  Ilia   Canada
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
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Compatcting Database: Fatal disk space error
Next Topic: Images don't attach right
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Wed Nov 27 22:46:40 GMT 2024

Total time taken to generate the page: 0.02593 seconds