Early Bird Registration for DrupalCon Portland 2024 is open! Register by 23:59 PST on 31 March 2024, to get $100 off your ticket.
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);
}
}
Comment | File | Size | Author |
---|---|---|---|
#7 | allow-another-module-defined--new-simpleads-type-2044263-7.patch | 1.1 KB | asrob |
#1 | 2044263.patch | 1.14 KB | zkday |
Comments
Comment #0.0
zkday CreditAttribution: zkday commentedchange content.
Comment #1
zkday CreditAttribution: zkday commentedThis is an patch for this. ;)
Comment #2
zkday CreditAttribution: zkday commentedComment #3
zkday CreditAttribution: zkday commentedchange status,
(sorry because spam).
Comment #4.0
(not verified) CreditAttribution: commentedchange content.
Comment #5
SocialNicheGuru CreditAttribution: SocialNicheGuru commentedthis no longer applies
Comment #6
shevgenyПосле применения патча, авторизованным пользователям HTML5-баннеры показываются, но анонимам — нет. В чем дело?
After applying the patch, authorized users HTML5-banners are displayed, but anonyms - no. What's the matter?
Comment #7
asrobAttached a small patch to work with 7.x-1.x-dev.
Comment #9
asrobComment #10
minnur CreditAttribution: minnur as a volunteer commented