Hello,
I setup WordPress and OpenX on the same server but with different databases (named WPDB and OPENXDB).
In my template I got his
functionX_plugin1WP()
//<!--/* OpenX Local Mode Tag v2.6.0 */-->
// The MAX_PATH below should point to the base of your OpenX installation
define('MAX_PATH', '/home/xxx/yyyy');
if (@include_once(MAX_PATH . '/www/delivery/alocal.php')) {
if (!isset($phpAds_context)) {
$phpAds_context = array();
}
// function view_local($what, $zoneid=0, $campaignid=0, $bannerid=0, $target='', $source='', $withtext='', $context='', $charset='')
$phpAds_raw = view_local('', 1, 0, 0, '_blank', '', '0', $phpAds_context, '');
}
echo $phpAds_raw['html'];
functionX_pluginWP2()
functionX_plugin3WP()
On the last 2 functions called I got in the error_log file several error messages like "database error table doesn't exist" with reference like OPENXDB.wp_terms etc ...
I think it's because the OpenX code switch the current database and the two last functions got the wrong db "link" ? But the users see no errors on the page and the functions seems to render proper content.
I've changed in the wp-db.php script the init loop of the table names from
foreach ( $this->tables as $table )
$this->$table = $this->prefix . $table;
to
foreach ( $this->tables as $table )
$this->$table = 'WPDB .'.$this->prefix . $table;
And now the errors never got in the log file. I knwo it's not a perfect solution because I modified the WP code but I don't see any workaround (or I can use the client mode to deliver ads with JS but it 's not what I want).