1 diff -urN roundcube-0.1~rc1~dfsg.old/program/include/rcube_db.inc roundcube-0.1~rc1~dfsg/program/include/rcube_db.inc
2 --- roundcube-0.1~rc1~dfsg.old/program/include/rcube_db.inc 2007-05-24 21:27:53.000000000 +0200
3 +++ roundcube-0.1~rc1~dfsg/program/include/rcube_db.inc 2007-05-24 21:29:36.000000000 +0200
6 require_once('DB.php');
8 +/* User function for getting timestamps under sqlite */
9 +function custom_date_to_timestamp($data) {
10 + $date = strptime($data,'%Y-%m-%d %H:%M:%S');
11 + return mktime($date['tm_hour'],$date['tm_min'],$date['tm_sec'],$date['tm_mon']+1,$date['tm_mday'],1900 + $date['tm_year']);
17 * Database independent query interface
19 $dsn = $this->db_dsnw;
21 $this->db_handle = $this->dsn_connect($dsn);
22 + if ($this->db_provider == "sqlite") {
23 + sqlite_create_function($this->db_handle->connection,'custom_date_to_timestamp','custom_date_to_timestamp',1);
25 $this->db_connected = $this->db_handle ? TRUE : FALSE;
30 return "datediff(s, '1970-01-01 00:00:00', $field)";
33 + return "custom_date_to_timestamp($field)";
36 return "UNIX_TIMESTAMP($field)";