Closed (fixed)
Project:
Advertisement
Version:
5.x-1.x-dev
Component:
ad_image.module
Priority:
Normal
Category:
Support request
Assigned:
Reporter:
Created:
15 Mar 2007 at 06:35 UTC
Updated:
18 Apr 2007 at 16:01 UTC
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:
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
Comment #1
willdashwood commentedI 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?
Comment #2
Clemens commentedWith 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...
Comment #3
Clemens commentedSorry... Intermittently added /node/content/ in the path... :-(
Comment #4
jeremy commentedThe 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.)
Comment #5
(not verified) commented