VERSION 2.01 RELEASED ON DECEMBER 14, 2009 - DATE FIELDS REVISED - Aug 6th, 2010


The biggest changes are in the way Date fields are created:

Default date field values can now be: blank, current date, specified date, or values such as "+2 weeks" or "next
Thursday"

Short month names used in date pulldowns can now be updated in the language files in /lib/languages/

In addition, an advanced option 'addSelectExpr' has been added for generating pseudo-fields or calculated values.

A FEW THINGS TO KEEP IN MIND.
As of this writing, here are a few things that I found regarding the new Date Field modifications.
1) The display format of a "Date" type field shown in the ListPage Fields does not seem to follow the format set up in
General Settings. The format of a" Date" field within the record does, but the “Listpage Field” display doesn't.
2) Alpha characters seem to be allowed in a "Date" type field's "year range" field but give very strange results.
3) Blank publish_date and Remove_date fields can result in very unhappy consequences.
_____
addSelectExpr
According to Dave:
What it does is insert the addSelectExpr value into a SELECT query here:
SELECT *, addSelectExpr FROM Table name
So if you had:
'addSelectExpr' => ' NOW() as _currentDate ',

It would add a field _currentDate to your $records like $records['_currentDate']. That's because NOW() is a mysql
function:

http://dev.mysql.com/doc/refman/5.1/en/date-and-time-functions.html#function_now

Usually you'd use that when you had lots and lots of records and you wanted to sort them on a calculated value. Some
examples of this that I'm working on now are a custom search engine that returns records based on a "match score" from
0-100 that is calculated, and a distance search that returns results based on distance from the searching users location
and displayed that distance as well.

Some of the MySQL for this can be very complicated.

(see: http://www.zcentric.com/blog/2007/03/calculate_distance_in_mysql_wi.html )

But as we do it more and more ourselves we'll work on ways to make it simpler and build it into the software or plugins.

If you have say 10,000 or more records you need to do these calculations and the sorting in the database because it's
not possible to do it in the application without loading all the records and that takes too much memory.



The materials on this web site have been created for use with CMS Builder content management software. CMS Builder software is published and licensed for use by InteractiveTools.com. Please contact Interactive Tools for information on the downloading of the software or the purchasing of licenses.


Terms of Service