I made an update for OpenX 2.6.1 compatibility.

Here's the changes:

openads.module hook_footer becomes:

<?php
/**
 * Implement hook_footer to inject our JavaScript
 * UPDATED FOR OPENX 2.6.1
 */
function openads_footer($main = 0) {

$delivery_url = _openads_trim_path(variable_get('openads_delivery_url', ''));
$js_file = variable_get('openads_js_delivery_filename', '');
$pub_id = variable_get('openads_id', 1);

//add main openx javascript call to page header
$channel = '<script type="text/javascript" src="http://'.$delivery_url.$js_file.'?id='.$pub_id.'&amp;target=_blank"></script>';
drupal_set_html_head($channel);
}
?>

and openads.module theme_openads_invoke becomes:

<?php
/**
 * Theme function for openads_invoke().
 */
function theme_openads_invoke($zoneid, $code) {
  global $user;
  $delivery_method = variable_get('openads_delivery_method', 'js');

  if (_openads_is_cache_page() || $delivery_method == 'js') {
    // Add new OpenX 2.6.1 style javascript invocation
    $out = "
    <script type=\"text/javascript\"><!--
      OA_show($zoneid);
    --></script>";
    return $out;
  }

  switch ($delivery_method) {
    case 'remote':
      return theme('openads_remote', $zoneid, $code);
      break;
    case 'local':
      return theme('openads_local', $zoneid);
      break;
    case 'xmlrpc':
      return theme('openads_xmlrpc', $zoneid);
      break;
  }
  return $out;
}
?>

Note: this is only tested with using the javascript invocation method and doesn't add the noscript stuff at this stage

But it's working and may help someone out there :-)

DT

Comments

jaydub’s picture

I'm not sure what you needed to change. I just setup a fresh install
of OpenX 2.6 and this Drupal module for openads/openx continues
to work w/o modification.

Is there something I am missing regarding the changes you posted?

Shai’s picture

DT,

Thanks so much for writing the patch. Unfortunately, it's not working on my site. But I'm new to OpenX and Drupal's module for it, so I may have the configuration wrong.

What I can tell you is that if I abandon the module altogether and create a custom block in Drupal and paste in the invocation code I get from OpenX 2.6.1 and select PHP as the input format... It works. So this, at least, isolates my problem with the module and rules out my OpenX install as the source of the problem.

Can you recommend what the next debugging step would be. In the OpenX module, I'm totally clueless about what is supposed to go in the "Code" field at the bottom -- where you put your adzone ID.

Thanks,

Shai

jaydub’s picture

StatusFileSize
new7.95 KB
new17.2 KB
new9.56 KB

When you are setting up the Drupal OpenX module the first
important ID number is the 'Publisher ID'. The attached image
drupal-openx-settings.jpg shows this.

In OpenX if you goto 'Websites & Zones' (OpenX 2.6) you should
see something like the attached image openx-settings-zones.jpg

Use the ID number in the 'ID' column from here and put this
in the Drupal OpenX Publisher ID field.

If you've already done that then let me know....

Shai’s picture

jaydub,

Thank you so much for your help.

Okay, I filled out the form according to your screenshots. I've got the correct Publisher ID and also I'm certain I have the zone id correct as well. That "code" field where you had "a9522ecc" is empty.

I'll try to anticipate your next question...

Here is what the the page source shows for the block that is failing to deliver the ad:

<h2 class="title"> Advertising </h2>
    <div class="content">
      
    <script type="text/javascript"><!--
      OA_show(1);
    --></script>    </div>

I really appreciate your help!

Shai

jaydub’s picture

If you are using the Openx drupal module created by the OpenX
team then please go there for support. The Openads
module that this project covers does not have the code
you mentioned above.

http://forum.openx.org/index.php?showforum=71
http://www.openx.org/openx-module-for-drupal

hound’s picture

I have a local installation of OpenX 2.6.1 (but in a different domain, so I can't use the local delivery option)

I do not see where my version of OpenX dashboard displays an invocation code. There is someplace in the actual invocation code where the string 'n=aad64ee2' appears, and I am guessing that's it, but could you post a jpg of the screen where this is displayed for less geeky folks? Thanks!

jaydub’s picture

Project: Openads » OpenX
Version: 5.x-1.1 » 6.x-1.0
brmassa’s picture

Status: Needs review » Fixed

Guys,

OpenX module already works with OX 2.6.1 or later.

regards,

massa

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.