Support » Fixing WordPress » wordpress and openX

  • Hello,

    I setup WordPress and OpenX on the same server but with different databases (named WPDB and OPENXDB).

    In my template I got his

    //<!--/* 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'];

    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;


    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).

Viewing 4 replies - 1 through 4 (of 4 total)
  • I have experienced this same problem, although in my case it was completely screwing up the display of my site whenever I would insert an OpenX local-mode code into the left sidebar.

    The above change to wp-db.php did the trick, but I will of course be looking for a better long-term solution. Perhaps that change can be made into a little plugin?

    I had the same error and it even occurs with the old phpAdsNew code base so its not unique to OpenX.

    Used your fix. Not sure who to report the bug to though. Seems to be a problem with OpenX though

    Thanks for that link, pixelgeek. The old fix stopped working for me after the 2.8 update (it broke posting and other things) but the fix you linked looks like a better solution.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘wordpress and openX’ is closed to new replies.