Improved date functions handling

git-svn-id: https://plugins.svn.wordpress.org/postgresql-for-wordpress/trunk@214733 b8457f37-d9ea-0310-8a92-e5e31aec5664
This commit is contained in:
hawk__
2010-03-07 22:52:38 +00:00
parent 4baf57dca8
commit 65b683b42b
3 changed files with 5 additions and 1 deletions

View File

@@ -21,7 +21,7 @@ define( 'PG4WP_ROOT', dirname( __FILE__).'/plugins/pg4wp');
define( 'PG4WP_DEBUG', false); define( 'PG4WP_DEBUG', false);
// If you just want to log queries that generate errors, leave PG4WP_DEBUG to "false" // If you just want to log queries that generate errors, leave PG4WP_DEBUG to "false"
// and set this to true // and set this to true
define( 'PG4WP_LOG_ERRORS', false); define( 'PG4WP_LOG_ERRORS', true);
// Logs are put in the pg4wp directory // Logs are put in the pg4wp directory
define( 'PG4WP_LOG', PG4WP_ROOT.'/logs/'); define( 'PG4WP_LOG', PG4WP_ROOT.'/logs/');

View File

@@ -141,7 +141,10 @@
); );
$sql = str_replace( 'ORDER BY post_date DESC', 'ORDER BY YEAR(post_date) DESC, MONTH(post_date) DESC', $sql); $sql = str_replace( 'ORDER BY post_date DESC', 'ORDER BY YEAR(post_date) DESC, MONTH(post_date) DESC', $sql);
$sql = str_replace( 'ORDER BY post_date ASC', 'ORDER BY YEAR(post_date) ASC, MONTH(post_date) ASC', $sql);
$sql = str_replace( array_keys($date_funcs), array_values($date_funcs), $sql); $sql = str_replace( array_keys($date_funcs), array_values($date_funcs), $sql);
$curryear = date( 'Y');
$sql = str_replace( 'FROM \''.$curryear, 'FROM TIMESTAMP \''.$curryear, $sql);
// MySQL 'IF' conversion // MySQL 'IF' conversion
$pattern = '/IF[ ]*\(([^,]+),([^,]+),([^\)]+)\)/'; $pattern = '/IF[ ]*\(([^,]+),([^,]+),([^\)]+)\)/';

View File

@@ -50,6 +50,7 @@ There is no screenshot for this plugin
== Changelog == == Changelog ==
* Improved dates functions handling
* PG4WP now appears in WordPress control panel and can be enabled/disabled but this has no real effect * PG4WP now appears in WordPress control panel and can be enabled/disabled but this has no real effect
* Added a correct plugin header into db.php to have correct informations shown in WordPress plugin Directory * Added a correct plugin header into db.php to have correct informations shown in WordPress plugin Directory