Page Index Toggle Pages: [1] 2 
Topic Tools
Hot Topic (More than 10 Replies) topic from year 2001 (wreply) all over RecentPosts (Read 6,474 times)
Zoo
YaBB Legends (Inactive)
*
Offline



Posts: 400

YaBB 2
Re: topic from year 2001 (wreply) all over RecentP
Reply #21 - Dec 15th, 2006 at 2:25pm
Post Tools
AK108 wrote on Dec 10th, 2006 at 5:12pm:
But, is it worth considering a topic sort routine? I know a lot of the time I just use sort() to sort topics (in my own code and the RSS generator, I think), so having something that prevents this may be nice. What do you think?

Lot of time? recent, rss and ... done

Spikecity wrote on Dec 15th, 2006 at 12:38pm:
We used to have some sort of universal sorting routine in older Y2 beta's but as this was too difficult for coders to get working correctly due to many parameters which were too alien.
..

difficult? who cares? but it's slow.

this sort problem is extreme event: if have a new post in very old thread (sort by aggregate last x messages of last x topics)
  
Back to top
 
IP Logged
 
Spikecity
YaBB Legends (Inactive)
*
Offline



Posts: 7,981
Location: Third rock from the sun !
Re: topic from year 2001 (wreply) all over RecentP
Reply #20 - Dec 15th, 2006 at 12:38pm
Post Tools
AK108 wrote on Dec 10th, 2006 at 5:12pm:
Add one now, and I'll make a patch for YaBB 2.x in 2038 when the problem arises again.

Which is a long way off and perhaps we are not around to see this event happening Wink
AK108 wrote on Dec 10th, 2006 at 5:12pm:
But, is it worth considering a topic sort routine? I know a lot of the time I just use sort() to sort topics (in my own code and the RSS generator, I think), so having something that prevents this may be nice. What do you think?

We used to have some sort of universal sorting routine in older Y2 beta's but as this was too difficult for coders to get working correctly due to many parameters which were too alien.
I suggest that if you decide to make a sorting subroutine it should be simple like:

(@|%)result = &do_sort(<what>,<how>,<reverse>);

Where <how> is either "N" (numerical) or "A" for Alphabetical, <what> should either be a hash or and array and <reverse> is just a 1/0 switch for increasing/decreasing the output.

This means in case of the code line posted by you (the thread output) you need to prep it first to have the right sorting field and then push it through the sorting routine, after which you undo the preparations again to get the result back into usable format.
« Last Edit: Dec 15th, 2006 at 12:42pm by Spikecity »  

Back to top
 
IP Logged
 
AK108
YaBB Legends (Inactive)
*
Offline



Posts: 3,321
Re: topic from year 2001 (wreply) all over RecentP
Reply #19 - Dec 10th, 2006 at 5:12pm
Post Tools
Add one now, and I'll make a patch for YaBB 2.x in 2038 when the problem arises again.

But, is it worth considering a topic sort routine? I know a lot of the time I just use sort() to sort topics (in my own code and the RSS generator, I think), so having something that prevents this may be nice. What do you think?
  

Do not PM me for support.
Back to top
WWW  
IP Logged
 
Spikecity
YaBB Legends (Inactive)
*
Offline



Posts: 7,981
Location: Third rock from the sun !
Re: topic from year 2001 (wreply) all over RecentP
Reply #18 - Dec 10th, 2006 at 11:13am
Post Tools
AK108 wrote on Dec 9th, 2006 at 4:03am:
It'd be faster to add the zero in this case.

Just be careful in how many zero's you will ultimately need until the end of time in perl as we know it (2036 ??) or we get the same problem all over once the timestamp gets one more digit.
  

Back to top
 
IP Logged
 
AK108
YaBB Legends (Inactive)
*
Offline



Posts: 3,321
Re: topic from year 2001 (wreply) all over RecentP
Reply #17 - Dec 9th, 2006 at 4:03am
Post Tools
It'd be faster to add the zero in this case.
  

Do not PM me for support.
Back to top
WWW  
IP Logged
 
Zoo
YaBB Legends (Inactive)
*
Offline



Posts: 400

YaBB 2
Re: topic from year 2001 (wreply) all over RecentP
Reply #16 - Dec 8th, 2006 at 7:58pm
Post Tools
but each element of @data looks

"$mtime|$curboard|$tnum|$treplies|$tusername|$tname|$tstate"

Wink
  
Back to top
 
IP Logged
 
Spikecity
YaBB Legends (Inactive)
*
Offline



Posts: 7,981
Location: Third rock from the sun !
Re: topic from year 2001 (wreply) all over RecentP
Reply #15 - Dec 8th, 2006 at 3:11pm
Post Tools
I think making the sorting numerical instead of ASCII should sort this out too without adding a leading zero to the shorter timestamps Wink
  

Back to top
 
IP Logged
 
AK108
YaBB Legends (Inactive)
*
Offline



Posts: 3,321
Re: topic from year 2001 (wreply) all over RecentP
Reply #14 - Dec 6th, 2006 at 11:49pm
Post Tools
That could very well be. I'll try to test it later.
  

Do not PM me for support.
Back to top
WWW  
IP Logged
 
Zoo
YaBB Legends (Inactive)
*
Offline



Posts: 400

YaBB 2
Re: topic from year 2001 (wreply) all over RecentP
Reply #13 - Dec 6th, 2006 at 11:35pm
Post Tools
this is a simple ASCII-betical sort problem of time

in Recent.pl find
Code
Select All
$mtime = $mdate; 


and replace it with:
Code
Select All
$mtime = $mdate < 1000000000 ? "0$mdate" : $mdate 


  
Back to top
 
IP Logged
 
AK108
YaBB Legends (Inactive)
*
Offline



Posts: 3,321
Re: topic from year 2001 (wreply) all over RecentP
Reply #12 - Nov 16th, 2006 at 3:45am
Post Tools
This is a very odd event... and I don't know how to duplicate it.

If anyone could offer some insight into the problem, that'd be great, but until then, I'm moving this to needs-verify.
  

Do not PM me for support.
Back to top
WWW  
IP Logged
 
gape
Junior Member
**
Offline



Posts: 76
Re: topic from year 2001 (wreply) all over RecentP
Reply #11 - Jul 23rd, 2006 at 6:28am
Post Tools
Quote:
a very quick glance at your board shows that the post listed at the top of the recent list comes from a topic that was last replied to a couple of days ago, but the sequencing of the posts in the list is wrong.
If I can reproduce this at all, I'll see what can be done to sort it.


apreciate ...

dunno really why this happens - from time to time - allways on very old threads (topics) ... as old as they get ... from 2001 & ussually started in same month ...
  
Back to top
 
IP Logged
 
old goat
YaBB Legends (Inactive)
*
Offline



Posts: 2,488
Location: York, UK
Re: topic from year 2001 (wreply) all over RecentP
Reply #10 - Jul 23rd, 2006 at 12:40am
Post Tools
a very quick glance at your board shows that the post listed at the top of the recent list comes from a topic that was last replied to a couple of days ago, but the sequencing of the posts in the list is wrong.
If I can reproduce this at all, I'll see what can be done to sort it.
  

Please don't PM me for support - I'll only go and ignore it!
Back to top
AIM  
IP Logged
 
gape
Junior Member
**
Offline



Posts: 76
Re: topic from year 2001 (wreply) all over RecentP
Reply #9 - Jul 22nd, 2006 at 6:45pm
Post Tools
no ideas?
  
Back to top
 
IP Logged
 
gape
Junior Member
**
Offline



Posts: 76
Re: topic from year 2001 (wreply) all over RecentP
Reply #8 - Jul 22nd, 2006 at 10:34am
Post Tools
Quote:


& again

wtf?
  
Back to top
 
IP Logged
 
gape
Junior Member
**
Offline



Posts: 76
Re: topic from year 2001 (wreply) all over RecentP
Reply #7 - Mar 17th, 2006 at 9:06am
Post Tools
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: [1] 2 
Topic Tools
 
  « Board Index ‹ Board  ^Top