I love the module! I had just had two questions that I'm sorry to bother you with. The first is that I have my Drupal installation in a subdirectory instead of the main directory, like this:

www.mydomain.com/content/

The ad images are looking in:

www.mydomain.com/files/image.jpg

instead of the correct path:

www.mydomain.com/content/files/image.jpg

Did I miss something in installing or configuring or is there something I can edit in the code to fix that?

The second question is say I set up an ad group. Is there a way to show ads from just that group on a page? Like a tag or something?

Any help would be greatly appreciated, and again, love the module. Thanks!

Comments

willdashwood’s picture

Version: 4.7.x-1.0-beta7 » 5.x-1.x-dev
Component: installation » ad_image.module

I had the same issue. I changed line 17 in ad_image.module from

$prefix = variable_get('clean_url', 0) ? '/' : '';

to:

$prefix = variable_get('clean_url', 0) ? '' : '';

just to get it up and running but what it really needs is the full base path inserting and I'm not sure what the proper "Drupal" way is to do that. Anyone else know?

Clemens’s picture

With your solution:

$prefix = variable_get('clean_url', 0) ? '' : '';

I ended up with 'node' in the image path, however, by hard coding the sub directory 'content', as in:

$prefix = variable_get('clean_url', 0) ? '/content/' : '';

it worked every time...

Clemens’s picture

Sorry... Intermittently added /node/content/ in the path... :-(

jeremy’s picture

Assigned: Unassigned » jeremy
Status: Active » Fixed

The problem was in how the ad_image module was trying to construct urls to the images, difficult because sometimes images are served from the root Drupal directory, and sometimes from the modules/ad subdirectory (when being served from adserve.php). I have updated the logic to use file_create_url(), using a preg_replace to strip away the modules/ad path when present. Fix was applied to 4.7.x branch and 5.x branch. (You can see the source changes here.)

Anonymous’s picture

Status: Fixed » Closed (fixed)