Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
 Custom field date => sort threads by this date ?
ZiNgA BuRgA Offline
Fag
*******
Posts: 3,357
Joined: Jan 2008
Post: #4
RE: Custom field date => sort threads by this date ?
Now that I think about it, you can probably sort by text, but the date needs to be inputted differently.
If you want to do this, ignore what I said above, and use a custom text mask filter:

Code:
^((?:19|20)\d\d)/(0?[1-9]|1[012])/(0?[1-9]|[12]\d|3[01])$

This will allow "1983/11/04" - which makes it sortable.

Note that if you already have existing data, you'll need to convert it to the new format.
For the output format, try something like:

Code:
<?=date('d F Y', strtotime({VALUE}))?>


Sorting is explained in the supplied documentation (the "Documentation" folder in the XThreads download package).
Basically, just reuse MyBB's sortby parameter, eg "forumdisplay.php?fid=2&sortby=tf_myfield"


My Blog
04-14-2014 02:45 PM
Find all posts by this user Quote this message in a reply

« Next Oldest | Next Newest »

Messages In This Thread
RE: Custom field date => sort threads by this date ? - ZiNgA BuRgA - 04-14-2014 02:45 PM

 Standard Tools
Forum Jump: