Ad doesn't appear in the block, but everything else runs fine...???

I've really tried to get this working but... I've been through all the support requests & bug fixes, but nothing makes sense & no solution has been reported.

I installed the module.
Created a group.
Gave permissions to show advertisements.
Created a block to show the ad group created.
Uploaded an image ad via file attachment in Create content > Advertisement > Image ad.

The block shows up, the page seems to "wait to load" at the block, then just carries on without showing the ad.

I've tried the whole debug thing, but that make no sense to me, & I've enabled cache, disabled it, then re-enabled it, & the output still shows that cache is not enabled:

ad_dir: '/mypath/modules/ad'
debug: '2'
cache: 'none'
nids: ''
tids: ''
hostid: ''
quantity: '1'
aid: '0'
Root drupal directory detected as '/mypath'.

/mypath/modules/ad/adserve.php: // $Id: adserve.php,v 1.2.2.15.2.22 2007/07/25 04:42:02 jeremy Exp $
/mypath/modules/ad/ad.module: // $Id: ad.module,v 1.2.2.29.2.42 2007/07/29 23:32:00 jeremy Exp $

No cache enabled.
Drupal bootstrap '7'.

Warning: session_start(): Cannot send session cache limiter - headers already sent (output started at /mypath/modules/ad/adserve.inc:232) in /mypath/includes/bootstrap.inc on line 862

Warning: Cannot modify header information - headers already sent by (output started at /mypath/modules/ad/adserve.inc:232) in /mypath/includes/bootstrap.inc on line 531

Warning: Cannot modify header information - headers already sent by (output started at /mypath/modules/ad/adserve.inc:232) in /mypath/includes/bootstrap.inc on line 532

Warning: Cannot modify header information - headers already sent by (output started at /mypath/modules/ad/adserve.inc:232) in /mypath/includes/bootstrap.inc on line 533

Warning: Cannot modify header information - headers already sent by (output started at /mypath/modules/ad/adserve.inc:232) in /mypath/includes/bootstrap.inc on line 534
Ads previously served: 0
Searching for ads with no tids.
Query: "SELECT a.aid, a.adtype, a.redirect, a.activated, a.maxviews, a.maxclicks FROM {ads} a LEFT JOIN {term_node} n ON a.aid = n.nid WHERE a.adstatus = 'active' AND n.tid IS NULL ORDER BY RAND() LIMIT 1;"
Ads displayed: 0
document.write('');

I don't know where to check if the image size is showing '0', but re-submitted the ad as described, but still nothing...

PLEASE HELP!

Comments

Jack_Sparrow’s picture

BTW: I'm using Drupal v5.2 on a Linux server & amadou theme

jeremy’s picture

Quick answer:
You've enabled the wrong block -- you need to enable the block that is for the ad group you created and added ads to.

Full answer:
From what you described, it seems that you've created an ad group, created one or more ads and placed them into this ad group, then enabled a block. The problem, which is apparent from your debug output, is that you're displaying the "default" block, which will only display ads that are not in any group. I can tell this for multiple reasons. One is:

nids: ''
tids: ''

You haven't specified any nids or tids, so it's using the default of no groups.

I can also tell from the SQL query:

Query: "SELECT a.aid, a.adtype, a.redirect, a.activated, a.maxviews, a.maxclicks FROM {ads} a LEFT JOIN {term_node} n ON a.aid = n.nid WHERE a.adstatus = 'active' AND n.tid IS NULL ORDER BY RAND() LIMIT 1;"

As it searches for where "n.tid IS NULL", which is how it searches for ads that haven't been assigned to any group.

Finally, it tells you that it found 0 ads:

Ads displayed: 0

Thus, your solution is to go to the block administration page and disable the default group block and enable the block for the group you created and placed your ads in.

BTW:

I've tried the whole debug thing, but that make no sense to me, & I've enabled cache, disabled it, then re-enabled it, & the output still shows that cache is not enabled:

Once you enable the cache, you need to re-get the "adserve.php" from your page HTML source, as it changes to reflect that the cache is enabled.

Jack_Sparrow’s picture

Hi Jeremy,

Thanks for your quick response.
Judging from other requests I knew you'd get on to this quickly!

I did have the correct ad group enabled in the block.
I created 150x150 group, then assigned the ads I made to that group, then enabled "All active 150x150 group ads" in the block region. I gave it a name "Ad" and set it's place, but no adverts appeared.

After reading your reply, I thought I'd go vice-versa - slightly.
So I enabled "All active image ads" (disabled "All active 150x150 group ads") in the blocks & now the ads are showing up...???

I don't know what this'll do to future groups I create, such as 460x80 banner type ads that I want to appear in the content and not in the sidebar...?
For now it works, but I may be back to ask about problem 2 (IF it does arise...)

Thank you

Jack_Sparrow’s picture

Sorry, just another quick one...
(Should I open a new support request?)

How do I make the external links on adverts open in a new window?
Should I add "target='_blank'" to the code somewhere?
I'm running External Links module, but that doesn't work on the ads...

I don't want visitors to leave my site if they click an advert.

Thanks again...

jeremy’s picture

Perhaps there is (another) bug in the views implementation. I've not played with the views-generated blocks much. I recommend instead that you instead use the default non-views block. They are named "ad group: ...". In your case, it sounds like the block you want is probably called "ad group: 150x150".

Please start new issues for unrelated questions, otherwise things get confusing quickly. In regards to your specific question, refer to the section titled "Global settings" in the README.txt file that comes with the ad module.

jeremy’s picture

Status: Active » Fixed

No further feedback, marking as fixed.

Anonymous’s picture

Status: Fixed » Closed (fixed)

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