In module simpleads we are only support 3 type default: text, image, flash. And in another module we don't have way to define a new type of simpleads. In this case, I thinks we need support another module define new simpleads type, and defined an template for this.
We need change small source code in function: _simpleads_render_ajax_template.

From:

if ($ad['type'] == 'graphic') {
      $result .= theme('simpleads_img_element', array('ad' => $ad, 'settings' => $ad_setting, 'css_class' => $css_class));
    }
    elseif ($ad['type'] == 'text') {
      $result .= theme('simpleads_text_element', array('ad' => $ad, 'settings' => $ad_setting, 'css_class' => $css_class));
    }
    else {
      $result .= theme('simpleads_flash_element', array('ad' => $ad, 'settings' => $ad_setting, 'css_class' => $css_class));
    }

To be changed

    if ($ad['type'] == 'graphic') {
      $result .= theme('simpleads_img_element', array('ad' => $ad, 'settings' => $ad_setting, 'css_class' => $css_class));
    }
    elseif ($ad['type'] == 'text') {
      $result .= theme('simpleads_text_element', array('ad' => $ad, 'settings' => $ad_setting, 'css_class' => $css_class));
    }
    else if ($ad['type'] == 'flash'){
      $result .= theme('simpleads_flash_element', array('ad' => $ad, 'settings' => $ad_setting, 'css_class' => $css_class));
    }
    else {
      $func = $ad['type'] . '_simpleads_display';
      if (function_exists($func)) {
        /// allow another module defined new ads type and render this.
        $result .= $func($ad, $ad_setting, $css_class);
      }
    }
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

zkday’s picture

Issue summary: View changes

change content.

zkday’s picture

FileSize
1.14 KB

This is an patch for this. ;)

zkday’s picture

Version: 7.x-1.8 » 7.x-1.x-dev
zkday’s picture

Status: Active » Needs review

change status,
(sorry because spam).

Status: Needs review » Needs work

The last submitted patch, 2044263.patch, failed testing.

Anonymous’s picture

Issue summary: View changes

change content.

SocialNicheGuru’s picture

this no longer applies

shevgeny’s picture

После применения патча, авторизованным пользователям HTML5-баннеры показываются, но анонимам — нет. В чем дело?

After applying the patch, authorized users HTML5-banners are displayed, but anonyms - no. What's the matter?

asrob’s picture

Attached a small patch to work with 7.x-1.x-dev.

Status: Needs review » Needs work
asrob’s picture

Status: Needs work » Needs review
minnur’s picture

Status: Needs review » Closed (won't fix)