From bd2a5978df2d8c1368b4e6d2d9f6c397701669a5 Mon Sep 17 00:00:00 2001 From: hawk__ Date: Mon, 15 Aug 2011 15:58:27 +0000 Subject: [PATCH] Disabled all ZdMultilang support Hacks git-svn-id: https://plugins.svn.wordpress.org/postgresql-for-wordpress/trunk@423850 b8457f37-d9ea-0310-8a92-e5e31aec5664 --- pg4wp/driver_pgsql.php | 8 ++++++++ pg4wp/driver_pgsql_install.php | 2 ++ 2 files changed, 10 insertions(+) diff --git a/pg4wp/driver_pgsql.php b/pg4wp/driver_pgsql.php index 7559985..dc1cadc 100644 --- a/pg4wp/driver_pgsql.php +++ b/pg4wp/driver_pgsql.php @@ -186,11 +186,13 @@ // HB : timestamp fix for permalinks $sql = str_replace( 'post_date_gmt > 1970', 'post_date_gmt > to_timestamp (\'1970\')', $sql); +/**** // ZdMultiLang support hacks $sql = preg_replace( '/post_type="([^"]+)"/', 'post_type=\'$1\'', $sql); $sql = str_replace( 'link_url o_url', 'link_url AS o_url', $sql); $sql = str_replace( 'link_name o_name', 'link_name AS o_name', $sql); $sql = str_replace( 'link_description o_desc', 'link_description AS o_desc', $sql); +****/ } // SELECT elseif( 0 === strpos($sql, 'UPDATE')) { @@ -219,12 +221,14 @@ $sql = str_replace('(0,',"('0',", $sql); $sql = str_replace('(1,',"('1',", $sql); +/**** // ZdMultiLang support hack if( $GLOBALS['pg4wp_ins_table'] == $wpdb->prefix.'zd_ml_trans') { preg_match( '/VALUES \([^\d]*(\d+)', $sql, $matches); $GLOBALS['pg4wp_insid'] = $matches[1]; } +****/ // Fix inserts into wp_categories if( false !== strpos($sql, 'INSERT INTO '.$wpdb->prefix.'categories')) @@ -343,6 +347,7 @@ $sql = str_replace( 'IN ( \'\' )', 'IN (NULL)', $sql); $sql = str_replace( 'IN ()', 'IN (NULL)', $sql); +/**** // ZdMultiLang 1.2.4 uses a lowercase 'in' $sql = str_replace( 'in ()', 'IN (NULL)', $sql); @@ -357,6 +362,7 @@ ); $sql = str_replace( array_keys($zdml_conv), array_values($zdml_conv), $sql); } +****/ // For insert ID catching if( $logto == 'INSERT') @@ -405,9 +411,11 @@ $tbls = split("\n", $GLOBALS['pg4wp_ins_table']); // Workaround for bad tablename $t = $tbls[0] . '_seq'; +/**** // ZdMultiLang support hack if( $tbls[0] == $wpdb->prefix.'zd_ml_trans') return $GLOBALS['pg4wp_insid']; +****/ if( in_array( $t, array( '_seq', $wpdb->prefix.'term_relationships_seq'))) return 0; diff --git a/pg4wp/driver_pgsql_install.php b/pg4wp/driver_pgsql_install.php index 75b2fe2..dd84da1 100644 --- a/pg4wp/driver_pgsql_install.php +++ b/pg4wp/driver_pgsql_install.php @@ -26,12 +26,14 @@ // WP 2.7.1 compatibility 'int(4)' => 'smallint', +/**** // ZdMultiLang support hack 'term_id varchar(5)' => 'term_id int', 'BIGINT(20)' => 'int', 'character set utf8' => '', 'CHARACTER SET utf8' => '', 'UNSIGNED' => '', // ZdMultilang 1.2.5 +****/ ); function pg4wp_installing( $sql, &$logto)