Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Re-Sort 1.0 (Read 2489 times)
Eddy
New Member
*
Offline



Posts: 17
Joined: Jan 11th, 2005
Re-Sort 1.0
Feb 3rd, 2005 at 5:18pm
Print Post  
Because of various moves, splices, and splits, the chronological order of individual posts within a thread can become mis-ordered: Older posts aren't always before the newer ones. This mod adds a "Re-sort" link (visible to admins) that allows you to re-order a thread so that all posts in a thread are re-sorted in chronological order from oldest to newest.

In addition, you can also re-sort at the board level, to put posts that were placed at "the top of the list" (because they were moved, for example) in their proper chronological order.

Files modified:
  Sources/Subs.pl
  Sources/SubList.pl
  Sources/Display.pl
  Sources/MessageIndex.pl
  english.lng

Also, place 'resort.gif' in your YaBBimages directory.

Tested with YaBB 1 Gold - SP 1.3.1
« Last Edit: Feb 3rd, 2005 at 11:03pm by Eddy »  

resort-1.0.zip ( 2 KB | Downloads )
Back to top
 
IP Logged
 
Valtiel
God Member
*****
Offline


Copy & paste coder

Posts: 873
Joined: Sep 5th, 2003
Gender: Male
Re: Re-Sort 1.0
Reply #1 - Feb 9th, 2005 at 3:07pm
Print Post  
Anyone tested that besides the author? Don't want my posts or threads to be messed up, lol.
  

Proud copy & paste coder Grin
Admin @ Silent Hill Forum
Back to top
WWW  
IP Logged
 
DelaMn
Full Member
***
Offline


I love boardmod.org

Posts: 136
Joined: Nov 13th, 2004
Re: Re-Sort 1.0
Reply #2 - Feb 26th, 2005 at 4:28pm
Print Post  
Silence from Michael ... I guess it works!  Wink
  
Back to top
 
IP Logged
 
DelaMn
Full Member
***
Offline


I love boardmod.org

Posts: 136
Joined: Nov 13th, 2004
Re: Re-Sort 1.0
Reply #3 - Feb 26th, 2005 at 8:08pm
Print Post  
This mod just makes home page on user profile to dissapear (forget that part) --- nothing else.

It installs 100% OK but does not work.
  
Back to top
 
IP Logged
 
DelaMn
Full Member
***
Offline


I love boardmod.org

Posts: 136
Joined: Nov 13th, 2004
Re: Re-Sort 1.0
Reply #4 - Feb 26th, 2005 at 8:09pm
Print Post  
quote to michael...  ???

+

Well.. the new resort button appears at the bottom. And this is what appears when trying to use it

Untrapped Error:
Month '-1' out of range 0..11 at ./Sources/Subs.pl line 1341


or

Untrapped Error:
Month '-1' out of range 0..11 at ./Sources/Subs.pl line 1255


Cry
  
Back to top
 
IP Logged
 
Eddy
New Member
*
Offline



Posts: 17
Joined: Jan 11th, 2005
Re: Re-Sort 1.0
Reply #5 - Feb 26th, 2005 at 10:59pm
Print Post  
Sorry that you're having problems with this mod. I've seen it used on a YaBB install that had a thread with over 300 replies, and it re-sorted the thread and the board just fine.

Based on the error, it looks to me like you may have an invalid date that is causing an error in the code where it extracts the date from each topic or post.

Specifically, these lines:

     ($m,$d,$y,$h,$mn,$s) = ($mdate =~ m~(\d+)/(\d+)/(\d+) at (\d+):(\d+):(\d+)~);
     $dt = timelocal($s, $mn, $h, $d, $m - 1, $y);

I didn't do any error checking (oops) to see if the parsing of the date into individual elements (month, day, year, hour, minute, second) succeeds. I also just realized that if the dates happen to be stored in anything but the default "MM/DD/YYYY at HH:MM:SS" format, the above parsing code would fail 100% of the time. In either case, the mostly likely cause of the problem is the call to timelocal() with bogus arguments.

It might be worthwhile to go through the appropriate "Boards/[i]<boardid>[/i].txt" file and look at the date field in each line, and see if any are "suspect"...
  
Back to top
 
IP Logged
 
Carsten
God Member
*****
Offline


...to much YaMS

Posts: 3281
Location: Langå
Joined: Aug 2nd, 2002
Gender: Male
Re: Re-Sort 1.0
Reply #6 - Feb 26th, 2005 at 11:47pm
Print Post  
Using 'at' in the regex will most likely fail unless the forum uses the english.lng

Try using something like .+? instead - or even more fault-proof:

Code
Select All
(\d{2})\/(\d{2})\/(\d{2}).*?(\d{2})\:(\d{2})\:(\d{2}) 

  

If you knock your head against a brick wall and hear a hollow sound, it's not necessarily coming from the wall.
Back to top
 
IP Logged
 
DelaMn
Full Member
***
Offline


I love boardmod.org

Posts: 136
Joined: Nov 13th, 2004
Re: Re-Sort 1.0
Reply #7 - Feb 27th, 2005 at 6:53pm
Print Post  
I don´t understand Carsten  Undecided
Any other (more explicit) help?  Embarrassed

+ Eddy:
My date format is: DD. Month YYYY at HH:MM:SS

Example:

01. January 2005 at 12:34:22


--------

I finally put out the mod and my board again runs OK.  Roll Eyes

Anyway... I´d like to use it if working in the right way, cause could be very usefull when organizing boards.

THANKS IN ADVANCE ANYONE COULD HELP
  
Back to top
 
IP Logged
 
Valtiel
God Member
*****
Offline


Copy & paste coder

Posts: 873
Joined: Sep 5th, 2003
Gender: Male
Re: Re-Sort 1.0
Reply #8 - Aug 25th, 2005 at 9:58am
Print Post  
Hm, is this mod dead now? I would like to use it, but only when it REALLY works.
  

Proud copy & paste coder Grin
Admin @ Silent Hill Forum
Back to top
WWW  
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint