No ads are shown

mariuss - March 26, 2007 - 02:19
Project:Advertisement
Version:5.x-1.x-dev
Component:adserve.php
Category:bug report
Priority:critical
Assigned:Jeremy@kerneltrap.org
Status:closed
Description

I added both an image and a text ad, and none is showing up in the "All active ads" and "All active image ads" blocks. Both ads are active.

Also, these are the only two blocks I could get to show in a region. The other ones will always revert back to <none> on the blocks page.

#1

Jeremy@kerneltr... - April 4, 2007 - 17:20

What block have you enabled? Is this a custom block, or one of the auto-generated ad blocks? Are you sure you enabled the correct ad block for the correct ad group? (ie, if you enabled your ads in the 'default' group, then you need to display the 'default' ad block.)

I don't understand your other query regarding two blocks.

#2

laghalt - April 4, 2007 - 19:55

Got the same problem - used both "All active ads" block and "Ad group:..." - both default and with a own goup. The ad is viewable under "My ads" and if i chose the node. In "All active ads" - i get "No active ads found." and "Ad group:..." is just blank.

#3

mariuss - April 7, 2007 - 18:58

What block have you enabled? Is this a custom block, or one of the auto-generated ad blocks? Are you sure you enabled the correct ad block for the correct ad group? (ie, if you enabled your ads in the 'default' group, then you need to display the 'default' ad block.)

Auto generated. The second part of my report says that it is impossible to use the group specific blocks. But "All active ads" and "All active images ads" should show all ads regardless of group.

I don't understand your other query regarding two blocks.

It is impossible to activate any of the group specific blocks (to assign them to a region). Only the two generic ones, for which I listed the titles, can be activated. But they don't show anything.

Using PHP 5. Could be a PHP 5 specific bug.

#4

enboig - April 11, 2007 - 06:28

Are you using any language different from English? I discovered that in my database active ads are tagged as "actius" (the translated form of active).

If you aren't using English, check your {ads} table if the ads are really "active".

I have already submitted a bug regarding this.

#5

kevbryant - April 11, 2007 - 18:36

im having the same problems, ads don't show in the provided blocks at all.

#6

kevbryant - April 11, 2007 - 18:54

even tried creating a new block with views...still nothing shows

#7

laghalt - April 11, 2007 - 19:17

enboig has some point - i use swedish and the ads table adstatus read "aktiv" - i changed it to "active" and the "No active ads found." is gone - the block even starts using the title I set on it - but no ad is there - no image and no link.

#8

kevbryant - April 11, 2007 - 19:23

yeah i use english and the record states 'active' as it should. still nothing shows up in the block(s) is this a recent issue?

interesting, when im logged out, the output script tage has src="", but when logged in it shows up as below.

#9

kevbryant - April 11, 2007 - 19:25

src="http://mydomain.com/modules/ad/adserve.php?n=23&c=none&p=files&f=3&q=&k="

#10

kevbryant - April 11, 2007 - 19:27

nevermind that was just acces control settings but the issue remains.

#11

kevbryant - April 12, 2007 - 13:49

any other modules that do this for 5.x?

#12

laghalt - April 14, 2007 - 08:23

I have been debuging this - not realy knowing anything about drupal programing. It seems that adserve.php drops al settings when caling the bootsrap process. at line 74 $group has a value (perhaps 'default') - but returning from bootstrap its emty. Seems like the bootstrap script resets al variables.

#13

Jeremy@kerneltr... - April 14, 2007 - 11:32

I just checked in a fix to the translation bug that was causing causing this problem for some. Once the new development tarball is built you may want to download it and try again to see if this solves your problem.

Also, in the path you pasted into #9, it includes "n=23". This means you are limiting this block to only display the ad with a nid of 23. Is this your intention? How did you configure this block? Is nid 23 even an ad?

#14

laghalt - April 14, 2007 - 15:40

Thanks for the language fix. Just giving my fix - its not a pach since its a uggly hack - but it works (i starts on line 61 in adserve.php - my hack is line 68+) Seem to work with Ad group:X block - problems with All active ads:

switch ($cache) {
  case 'none':
    if ($debug) {
      echo "Using no cache.<br />\n";
    }

    adserve_bootstrap();
// ugglyhack
    $group = isset($_GET['g']) ? preg_replace('/[^0-9a-zA-Z]/', '', $_GET['g']): 'default';
    $quantity = isset($_GET['q']) ? (int)$_GET['q'] : 0;
    $cache = isset($_GET['c']) ? preg_replace('/[^a-zA-Z]/', '', $_GET['c']) : 'none';
    $nids = isset($_GET['n']) ? preg_replace('/[^0-9,]/', '', $_GET['n']) : '';
// hack done

    if ($nids) {
      // Build query to filter on just selected nids.
      $filter = '';
      foreach ($nids as $nid) {
        if ($filter) {
          $filter .= " OR aid = $nid";
        }

#15

kevbryant - April 16, 2007 - 18:31

thanks for that laghalt, that fixed my problem. i only need the one type of block so it works great for me.

#16

Jeremy@kerneltr... - April 18, 2007 - 08:44
Component:ad.module» adserve.php
Assigned to:Anonymous» Jeremy@kerneltrap.org
Status:active» fixed

The issue was in some PHP configurations the Drupal bootstrap was clearing out the globals set by adserve.php. I have moved all global variables into a local static to fix this problem. Fix applied to 4.7.x and 5.x development trees.

#17

unitec - April 19, 2007 - 14:23

Thank you for the very quick response.
Ok I found it. But it's a diff file and I don't know how to run a patch and won't do it manually.
I'll wait until the next sub release is available.

#18

unitec - April 20, 2007 - 10:44

Now I updated to the newest version.

The ad is not yet visible although the code is displayed on the page:

[script type="text/javascript" src="http://www.example.com/sites/all/modules/ad/adserve.php?g=group1t&c=none&p=files&f=3&q=1&k="]

I don't have any experiences with java.

Can someone lead me to the right direction?

#19

Jeremy@kerneltr... - April 20, 2007 - 23:36

Try and open the adserve.php link directly in your browser -- what do you see? An error? An ad? A blank white screen?

If you don't see an ad, then add &debug=2 to the URL and reload then post the output in this isse. Using your example, you'd load the following URL:

[http://www.example.com/sites/all/modules/ad/adserve.php?g=group1t&c=none&p=files&f=3&q=1&k=&debug=2]

#20

srlinuxx - April 21, 2007 - 02:30
Status:fixed» active

I'm still not able to see the images as well. The img src points to the path of the directory containing the image, but not the image file itself.

thanks.

#21

duntuk - April 23, 2007 - 04:10

same problem here... using php 5 ...

when debugging as noted:
http://YOURSITE.com/sites/all/modules/ad/adserve.php?g=group1t&c=none&p=...
i get this error:

Group: 'group1t'
Cache: 'none'
Quantity: '1'
Host: ''
Path: 'files'
Nids: ''
Files: '3'
Ad module installed in '/home/gnamxco/domains/gnamx.com/public_html/atwood/sites/all/modules/ad'.
Root drupal directory '/home/gnamxco/domains/gnamx.com/public_html/atwood'.
Using no cache.
Drupal bootstrap '7'.

Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /home/gnamxco/domains/gnamx.com/public_html/atwood/sites/all/modules/ad/adserve.php:365) in /home/gnamxco/domains/gnamx.com/public_html/atwood/includes/bootstrap.inc on line 811

Warning: Cannot modify header information - headers already sent by (output started at /home/gnamxco/domains/gnamx.com/public_html/atwood/sites/all/modules/ad/adserve.php:365) in /home/gnamxco/domains/gnamx.com/public_html/atwood/includes/bootstrap.inc on line 488

Warning: Cannot modify header information - headers already sent by (output started at /home/gnamxco/domains/gnamx.com/public_html/atwood/sites/all/modules/ad/adserve.php:365) in /home/gnamxco/domains/gnamx.com/public_html/atwood/includes/bootstrap.inc on line 489

Warning: Cannot modify header information - headers already sent by (output started at /home/gnamxco/domains/gnamx.com/public_html/atwood/sites/all/modules/ad/adserve.php:365) in /home/gnamxco/domains/gnamx.com/public_html/atwood/includes/bootstrap.inc on line 490

Warning: Cannot modify header information - headers already sent by (output started at /home/gnamxco/domains/gnamx.com/public_html/atwood/sites/all/modules/ad/adserve.php:365) in /home/gnamxco/domains/gnamx.com/public_html/atwood/includes/bootstrap.inc on line 491
document.write('')

#22

unitec - April 23, 2007 - 05:59

I get the same error message as duntuk.

#23

Jeremy@kerneltr... - April 24, 2007 - 01:22

You seem to be experiencing a problem after the bootstrap -- do you have the latest version of the module? I moved the various variables from being in global memory to local memory which should solve the problem you are reporting.

If upgrading to the latest version of the module doesn't solve this problem for you, switch to the file cache and send me debug output from that. All you need to do is update the adserve.php URL, changing 'none' to 'file'. For example:

[http://www.example.com/sites/all/modules/ad/adserve.php?g=group1t&c=file&p=files&f=3&q=1&k=&debug=2]

#24

unitec - April 24, 2007 - 06:03

I installed the latest version.
Here is the error message:

Group: 'group1'
Cache: 'file'
Quantity: '1'
Host: ''
Path: 'files'
Nids: ''
Files: '3'
Ad module installed in '/home/public_html/sites/all/modules/ad'.
Root drupal directory '/home/public_html'.
Using file cache.
Trying cache_file 'files/.1.ad.cache'.
Obtained lock.
0: cache_size(1)
Id: 0
Cache size: 1
Random ID: 0
Ad ID: 244
Last sync: 1177394378

Warning: Cannot modify header information - headers already sent by (output started at /home/public_html/sites/all/modules/ad/adserve.php:365) in /home/public_html/sites/all/modules/ad/adserve.php on line 327
document.write('Advertising Text')

#25

Jeremy@kerneltr... - April 24, 2007 - 08:26

Okay, so if you enable the file cache, ads display correctly?

If you go to the node on your site with nid 244, is that indeed your test ad, and is its status active?

Can you attach the output from phpinfo()?

#26

unitec - April 24, 2007 - 13:22

> ... if you enable the file cache, ads display correctly?
Which cache? In admin/performance or where?

The ad is active.

> Can you attach the output from phpinfo()?

How to do this?

#27

Jeremy@kerneltr... - April 25, 2007 - 14:42

I have moved all variables and logic out of global space which should now solve your problems. Once a new ad tarball is built you can reinstall the ad module and try again. If it still doesn't work, set "&debug=2" and load adserve.php, sending me the output again -- I've added extra debug.

#28

srlinuxx - April 26, 2007 - 04:27
Status:active» fixed

woohoo. the new tarball works here. thanks so much.

#29

unitec - April 26, 2007 - 09:13

I installed the newes version but it does not work for me.
Here is the error message:
Group: 'group1'
Cache: 'none'
Quantity: '1'
Host: ''
Path: 'files'
Nids: ''
Files: '3'

Ad module installed in '/home/public_html/sites/all/modules/ad'.
Root drupal directory '/home/public_html'.

/home/public_html/sites/all/modules/ad/adserve.php: // $Id: adserve.php,v 1.2.2.15.2.4 2007/04/25 14:38:14 jeremy Exp $
/home/public_html/sites/all/modules/ad/ad.module: // $Id: ad.module,v 1.2.2.29.2.13 2007/04/14 11:30:14 jeremy Exp $

Using no cache.
Drupal bootstrap '7'.

Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /home/public_html/sites/all/modules/ad/adserve.php:377) in /home/public_html/includes/bootstrap.inc on line 811

Warning: Cannot modify header information - headers already sent by (output started at /home/public_html/sites/all/modules/ad/adserve.php:377) in /home/public_html/includes/bootstrap.inc on line 488

Warning: Cannot modify header information - headers already sent by (output started at /home/public_html/sites/all/modules/ad/adserve.php:377) in /home/public_html/includes/bootstrap.inc on line 489

Warning: Cannot modify header information - headers already sent by (output started at /home/public_html/sites/all/modules/ad/adserve.php:377) in /home/public_html/includes/bootstrap.inc on line 490

Warning: Cannot modify header information - headers already sent by (output started at /home/public_html/sites/all/modules/ad/adserve.php:377) in /home/public_html/includes/bootstrap.inc on line 491
9 ad:
stdClass Object
(
[aid] => 244
[adtype] => text
[redirect] => /ad/redirect/244
[activated] => 1176964778
[maxviews] => 0
[maxclicks] => 0
)
Loading module 'sites/all/modules/ad/text/ad_text.module'.
Ads displayed: 1
document.write('Ad Text')

#30

Jeremy@kerneltr... - April 26, 2007 - 09:21

Actually, your debug shows it to be working fine. The "errors" are simply because you're running in debug mode and the headers are getting written multiple times -- based on what you've show me, I expect that ads should be displaying on your real pages.

#31

unitec - April 26, 2007 - 12:25

Thank your for your patient and your support.
Maybe that there are some problems with Javascript.
I'll look into this issue although I don't have any experience with Java.
Thanks again.

#32

Jeremy@kerneltr... - April 26, 2007 - 19:49

Sorry, there was a bug in that some debugging code was still in the path for when trying to display ads with no ad cache enabled. This is what was causing the #9 to appear just before your ad output, and the resulting javascript errors. I just checked in the fix, when the new tarball is built things should finally be working for you.

(Alternatively, without even upgrading you should be able to go to administer >> ads >> global settings and enable the file cache -- the typo was only when the file cache was disabled.)

#33

mariuss - April 28, 2007 - 18:25
Status:fixed» active

I still cannot see any ads, no text nor image. I have active ads of both kinds.

I can see only one block now, "Ad group: default", not more specific blocks for image and text ads.

#34

Jeremy@kerneltr... - April 28, 2007 - 18:28

Please post debug output as described earlier in this issue. To get the correct URL for your debug, view the source of a page on which you should be seeing ads. Search for the string "adserve.php" and point your browser to that full URL. Add &debug=2 at the end of the URL for debug output. For example:

[http://www.example.com/modules/ad/adserve.php?g=default&c=none&p=files&f=3&q=1&k=&debug=2]

#35

mariuss - April 28, 2007 - 18:55

Figured what the problem was in my case. I had the module installed to sites/all/moduels as a symlinc to a folder where I keep all my drupal 5 modules. As soon as I actually copied the modules there (sites/all/modules) instead of symlinking, it started working.

I use symlinks with every single third party module, and it works juts fine. With Advertisement the problem is adserve.php, the module folder is retrieved using getcwd(), and this is totally unreliable.

drupal_get_path should be probably used instead, like: drupal_get_path('module', 'ad')

#36

Jeremy@kerneltr... - April 28, 2007 - 20:02
Status:active» fixed

Unfortunately drupal_get_path() is not an option, as we need to obtain the paths before Drupal is bootstrapped. Using symbolic links as you've done will always be problematic for this module as it's very much tied to paths. This is unfortunately necessary to allow the use of caching that avoids the overhead of bootstrapping Drupal. If we didn't care about performance, none of this would matter. But performance is critical.

You might be able to work around this as follows. Restore your symbolic link to the ad module, however you had it before when it didn't work. Then, inside the ad module directory add a symbolic link to Drupal's include directory (naming it 'includes', the same as the actual directory). This should allow adserve.php to properly bootstrap Drupal, and thus should cause ads to display.

For example, let's say your Drupal is installed in /var/www/drupal, and /var/www/drupal/sites/all/modules/ad is a symbolic link to /var/drupal5/ad. Make /var/drupal5/ad/includes a symbolic link to /var/www/drupal/includes, at which point adserve.php should work fine.

Best of luck.

#37

mariuss - April 28, 2007 - 20:23

I see your point, you are right.

Tried setting the symlink as you suggested, moved things forward a bit, but it crashes somewhere else now. I'll just use a proper copy of the module instead of symlinking. Looked into both apache and php documentation, could not find a way to control how symlinks are followed.

You may want to add a note to the documentation about this.

Thanks for clarifying this issue.

#38

Jeremy@kerneltr... - April 28, 2007 - 20:49

Thanks. I have updated the instructions in INSTALL.txt.

#39

Gentoo7 - May 1, 2007 - 20:47

:)

Group: 'default'
Cache: 'none'
Quantity: '1'
Host: ''
Path: 'files'
Nids: ''
Files: '3'

Ad module installed in '/home/4938/domains/something.com/html/modules/ad'.
Root drupal directory '/home/4938/domains/something.com/html'.

/home/4938/domains/something.com/html/modules/ad/adserve.php: // $Id: adserve.php,v 1.2.2.15.2.6 2007/04/30 13:17:53 jeremy Exp $
/home/4938/domains/something.com/html/modules/ad/ad.module: // $Id: ad.module,v 1.2.2.29.2.17 2007/05/01 14:10:54 jeremy Exp $

Using no cache.
Drupal bootstrap '7'.

Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /home/4938/domains/something.com/html/modules/ad/adserve.php:376) in /home/4938/domains/something.com/html/includes/bootstrap.inc on line 811

Warning: Cannot modify header information - headers already sent by (output started at /home/4938/domains/something.com/html/modules/ad/adserve.php:376) in /home/4938/domains/something.com/html/includes/bootstrap.inc on line 488

Warning: Cannot modify header information - headers already sent by (output started at /home/4938/domains/something.com/html/modules/ad/adserve.php:376) in /home/4938/domains/something.com/html/includes/bootstrap.inc on line 489

Warning: Cannot modify header information - headers already sent by (output started at /home/4938/domains/something.com/html/modules/ad/adserve.php:376) in /home/4938/domains/something.com/html/includes/bootstrap.inc on line 490

Warning: Cannot modify header information - headers already sent by (output started at /home/4938/domains/something.com/html/modules/ad/adserve.php:376) in /home/4938/domains/something.com/html/includes/bootstrap.inc on line 491
Ads displayed: 0
document.write('No ad found.');

what do think

#40

Jeremy@kerneltr... - May 1, 2007 - 20:50

That is telling you there are no active ads in the default group.

#41

Gentoo7 - May 2, 2007 - 12:20

Every time I activate the ad its shows: "Unable to mark ad as active as you have not uploaded any valid images. Setting ad as pending."

The image uploaded is 500x150 px 44.6KB

thanks

#42

Jeremy@kerneltr... - May 2, 2007 - 12:38

Please open a new issue when you are having problems not described in existing issues. Adding followups to closed issues will tend to cause your queries to go unnoticed. Adding unrelated followups to existing issues will tend to cause your queries to be ignored.

As for your problem, be sure that there is a checkmark in the list checkbox for the image that you uploaded. The first "listed" file is the one used by the ad module. If that doesn't help, open a new issue.

#43

unitec - May 3, 2007 - 18:28

Now I had some time to look at this issue.

The code I get with the debug option seems to be correct but nevertheless it does not work.

I took the code and copied it in the body of a new created node.
But without success, no text ad is displayed.

Than I deleted the line breaks, replaced them with a BR tag (now all the code is in one line) and wow it works.

Finally I copied the code into the edit box of the ad module (all on one line) but again it does not work.

There seems to be a problem with converting the text ad into code.

#44

tbm - May 4, 2007 - 08:45
Title:no ads are shown» still... no ads are shown
Version:5.x-1.x-dev» 5.x-1.0-beta9
Component:adserve.php» ad_image.module
Status:fixed» active

I added an image, and none is showing up in the "All active ads" and "All active image ads" blocks. Ad is active.

When I used "http://www.mysite.pl/modules/ad/adserve.php?g=default&c=none&p=files&f=3&q=1&k=&debug=2" Ive got this report:

ad_dir: '/modules/ad'
debug: '2'
group: 'default'
cache: 'none'
nids: ''
hostid: ''
quantity: '1'
Root drupal directory detected as '/'.

/modules/ad/adserve.php: // $Id: adserve.php,v 1.2.2.15.2.8 2007/05/03 16:11:26 jeremy Exp $
/modules/ad/ad.module: // $Id: ad.module,v 1.2.2.29.2.21 2007/05/03 20:10:09 jeremy Exp $

No cache enabled.
Drupal bootstrap '7'.

Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /modules/ad/adserve.php:223) in /includes/bootstrap.inc on line 811

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

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

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

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

stdClass Object
(
[aid] => 15
[adtype] => image
[redirect] => /ad/redirect/15
[activated] => 1178264217
[maxviews] => 0
[maxclicks] => 0
)

Loading module 'modules/ad/image/ad_image.module'.
Ads displayed: 1

And.. no ad on page

rgds
TBM

ps
I can't switch cache "ON" - I have no option to do this, only "no cache" option exist.

#45

Jeremy@kerneltr... - May 4, 2007 - 08:56

It appears adserve.php is working fine as it is finding an ad properly. Do you have javascript enabled in your browser? The ad module uses javascript to display ads. Also, have you granted the 'show advertisements' permissions?

Go to a page that as the ad block enabled and view the source -- what do you see in the ad block section?

If using FireFox you can also try installing the FireFox Firebug add-on and looking for javascript errors.

Regarding the file-cache, you need to enable the ad_cache_file module if you wish to use the file cache. Caches are now implemented through hooks allowing for the creation of additional cache types without having to modify the core ad module.

#46

tbm - May 4, 2007 - 09:15

> Do you have javascript enabled in your browser?
Yes

>have you granted the 'show advertisements' permissions?
Yes

>Go to a page that as the ad block enabled and view the source -- what do you see in the ad block section?
You mean source of my page?

<h2>All active default group ads</h2>

  <div class="content"><div class='view view-active-default-group-ads'><div class='view-content view-content-active-default-group-ads'>
<div class="advertisement" id="group-14,15,16"><script type="text/javascript" src="http://www.mysite.pl/modules/ad/adserve.php?q=1&c=file&f=3&p=files&n=14,15,16"></script></div>
</div></div>

>Regarding the file-cache, you need to enable the ad_cache_file module if you wish to use the file cache.
Ups...
I enabled cache... still no ads

rgds
TBM

#47

Jeremy@kerneltr... - May 4, 2007 - 09:28

Oh, you are using views to try and display ads. Please open a new issue to focus on displaying ads with views, that is a different issue than was being addressed here.

I want to keep this issue focused on the core ad serving functionality. To be relevant to this issue try displaying ads with the default blocks provided by ad module -- do ads display from these blocks? (Based on your earlier debug output, I suspect they will.) Refer to INSTALL.txt and README.txt for instructions on enabling the default blocks.

#48

unitec - May 4, 2007 - 09:31

Image ads work fine but only with clean URL and image.
With a Javascript affiliate code as you need it for Commission Junction it does not work.

Text ads only work when all the text is on one single line. With a line break in the ad description it does not work.
You also cannot add any tags. The ad shows the tags as ascii text.
I tested it with all versions of input format for the ad body text and also for the node which displays the ad.

But you need tags to format the ads. Without formatting visitors are unable to distinguish between ad and content text.

#49

Jeremy@kerneltr... - May 4, 2007 - 09:41

Unitec, stop posting multiple issues as add-ons to the same issue. It just confuses things and means that problems will get lost in the confusion. For each new problem you find, open a new issue. You are not helping things by posting new unrelated issues here.

#50

tbm - May 4, 2007 - 09:41

>Oh, you are using views to try and display ads. Please open a new issue to focus on displaying ads with views, that is a different issue than was being addressed here

OK, but I use only module-generated views. "All active image ads" and "Ad group: default" bloks not working too.

regards
TBM

#51

Jeremy@kerneltr... - May 4, 2007 - 09:49

tbm, please enable the 'Ad group: default' block then view the html source for the block and post it here.

#52

tbm - May 4, 2007 - 10:03

>enable the 'Ad group: default' block then view the html source for the block and post it here

In this case i have nothing on page. No ads, no block title.

      <div id="block-ad-1" class="block block-ad">


  <div class="content">
<div class="advertisement" id="group-default"><script type="text/javascript" src="http://www.mysite.pl/modules/ad/adserve.php?q=1&c=file&f=3&p=files&g=default"></script></div>
</div>
</div>

when I used SRC adress in my browser I've got text: document.write('<div class="image-advertisement" id="ad-14"><a href="/ad/redirect/14/" target="_blank" title=""><img src="http://www.mysite.pl/system/files/" width="" height="" /></a></div>');

TBM

#53

Jeremy@kerneltr... - May 4, 2007 - 10:26

Okay, it looks like something is wrong with that ad_image table. Did you upload those images with -beta9 or an earlier -beta? If you've not already tried, please delete your images and re-upload them with -beta9 and see if that helps. I cleaned up the upload logic in ad_image in -beta9 and that may help you in this case.

If that doesn't help, please enable the file cache and then run the adserve.php string with &debug=2 enabled and post the output here. (That will include a dump of the ad array which may provide some insight into what is going wrong.)

#54

tbm - May 4, 2007 - 10:44

Incredible!

I enabled cache (I'm sure!)... but debugger reported this:

ad_dir: '/modules/ad'
debug: '2'
group: 'default'
cache: 'none'
nids: ''
hostid: ''
quantity: '1'
Root drupal directory detected as '/'.

/modules/ad/adserve.php: // $Id: adserve.php,v 1.2.2.15.2.8 2007/05/03 16:11:26 jeremy Exp $
/modules/ad/ad.module: // $Id: ad.module,v 1.2.2.29.2.21 2007/05/03 20:10:09 jeremy Exp $

No cache enabled.
Drupal bootstrap '7'.

Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /modules/ad/adserve.php:223) in /includes/bootstrap.inc on line 811

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

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

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

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

stdClass Object
(
    [aid] => 16
    [adtype] => image
    [redirect] => /ad/redirect/16
    [activated] => 1178265246
    [maxviews] => 0
    [maxclicks] => 0
)

Loading module 'modules/ad/image/ad_image.module'.
Ads displayed: 1
document.write('

system cache I have on "Normal".

On this (test) page I used only beta9. I had the same problems with beta8 and want to tried beta9 from beginning.

regards
TBM

#55

Jeremy@kerneltr... - May 4, 2007 - 10:58

The string you pass into adserve.php dictates what cache type is used -- I'm guessing you're still using your old url which included "&cache=none". You can get the new url by viewing source for a page that has the file cache enabled and search for "adserve.php". That's not your problem.

When you view the ad node, do you see the ad image there? Does it show your view counter incrementing?

Please connect to your database and post the output of the following two queries:

mysql> SELECT * FROM ad_image;
mysql> SELECT f.* FROM files f JOIN ad_image i ON f.fid = i.fid;

#56

tbm - May 4, 2007 - 11:01
Status:active» fixed

FIXED!

All works, when I add ad as a user. All earlier ads I add when I'm log as Admin. I'm ashamed.

Sorry for trouble, and very much thanks for your help.

regards
Bartek (TBM)

#57

Jeremy@kerneltr... - May 4, 2007 - 11:08

So you're saying it doesn't work when you upload ads with user id 1, but it does work when you upload ads with another user id?

#58

tbm - May 4, 2007 - 11:18

>it doesn't work when you upload ads with user id 1, but it does work when you upload ads with another user id

exactly! And in this case no one can see ad images (Admin as well) :-(

regards
TBM
ps
If Admin (user=1) add advertisement I have no image on page, but counters increment views (of course not cliks because of nothing to click on).

#59

Jeremy@kerneltr... - May 4, 2007 - 11:56

Interesting. It seems to be some sort of permissions issue, that having some permission enabled seems to break the logic the ad_image module uses to detect file uploads. Offhand I'm not sure what would be causing this.

If you want to debug it further, please upload an image ad as UID 1 and then run the earlier MySQL queries I posted. In addition, could you post the output of the following query:

mysql>SELECT name FROM system WHERE status = 1 AND type = 'module';

#60

tbm - May 4, 2007 - 12:31

Yoy are right, its something with access permisions - now I have troubles with ad image page (access denied) :-).. I hope it is nothing serious.

this table of your SQL query:

INSERT INTO `system` VALUES ('subscriptions');
INSERT INTO `system` VALUES ('system');
INSERT INTO `system` VALUES ('block');
INSERT INTO `system` VALUES ('color');
INSERT INTO `system` VALUES ('comment');
INSERT INTO `system` VALUES ('filter');
INSERT INTO `system` VALUES ('help');
INSERT INTO `system` VALUES ('locale');
INSERT INTO `system` VALUES ('menu');
INSERT INTO `system` VALUES ('node');
INSERT INTO `system` VALUES ('taxonomy');
INSERT INTO `system` VALUES ('upload');
INSERT INTO `system` VALUES ('user');
INSERT INTO `system` VALUES ('watchdog');
INSERT INTO `system` VALUES ('content');
INSERT INTO `system` VALUES ('email');
INSERT INTO `system` VALUES ('link');
INSERT INTO `system` VALUES ('optionwidgets');
INSERT INTO `system` VALUES ('text');
INSERT INTO `system` VALUES ('userreference');
INSERT INTO `system` VALUES ('views');
INSERT INTO `system` VALUES ('views_ui');
INSERT INTO `system` VALUES ('date');
INSERT INTO `system` VALUES ('node_images');
INSERT INTO `system` VALUES ('ad');
INSERT INTO `system` VALUES ('ad_cache_file');
INSERT INTO `system` VALUES ('ad_image');
INSERT INTO `system` VALUES ('ad_report');
INSERT INTO `system` VALUES ('image');
INSERT INTO `system` VALUES ('image_gallery');

regards
TBM

#61

Jeremy@kerneltr... - May 4, 2007 - 12:53

It seems you are experiencing a conflict with some other module. Unfortunately I don't have time to try enabling all the modules in your list and seeing which one breaks things. The best I can suggest is that you start with a clean Drupal installation with no contrib modules, enable the ad module and confirm things work. Then start adding in your other contrib modules one at a time until things break.

I was still hoping to see the output of the two other queries I mention in update #55.

#62

tbm - May 4, 2007 - 16:40

Ups...

fid nid filename filepath filemime filesize
1 14 logo1.JPG files/logo2.JPG image/jpeg 6633
2 15 logoXYZ.JPG files/logoXYZ.JPG image/jpeg 10996
3 16 logoXYZ-black.JPG files/logoXYZ-black.JPG image/jpeg 10934
4 17 logo1.JPG files/logo1_0.JPG image/jpeg 6633

INSERT INTO `ad_image` VALUES (14, 1, 'http://www.mysite.pl/uv-vis', '', 155, 108);
INSERT INTO `ad_image` VALUES (15, 2, 'http://www.mysite.pl/mankowie', '', 185, 120);
INSERT INTO `ad_image` VALUES (16, 3, 'http://www.mysite.pl', '', 185, 120);
INSERT INTO `ad_image` VALUES (17, 4, 'http://www.mysite.pl', '', 155, 108);

Many problems are generate by "upload module" and premisions access to upload files. Maybe yoy should write about this options in installation file?

For me now is OK. I can add ads as user=n>1 :-)

regards

TBM

#63

Jeremy@kerneltr... - May 4, 2007 - 16:45

What did you do to get it working with UID 1? What permissions issues have you had and fixed? Please provide more detail so this can be documented to help future people trying to install the ad module.

#64

peach - May 6, 2007 - 13:39
Title:still... no ads are shown» Internal Server Error
Version:5.x-1.0-beta9» 5.x-1.x-dev
Component:ad_image.module» adserve.php

Hi Jeremy,

I have created and activated several ads both in default and a custom ad group, and none of the auto-blocks show any ads.

This is the html that is output by the 'all active ads block':

  <h2>All active ads</h2>

  <div class="content">
<div class='view view-all-active-ads'><div class='view-content view-content-all-active-ads'>
<div class="advertisement" id="group-10,11,12,13">
<script type="text/javascript" src="http://www.domain.com/clearwinddev/modules/ad/adserve.php?q=1&n=10,11,12,13"></script>
</div>
</div>
</div>

When I access the source url directly, I only get a Internal Server Error. Same happens when I add &debug=2 to the url, or when I remove all of the query.

Am using the latest version and have just overwritten that with the latest development snapshop. (no change).

#65

Jeremy@kerneltr... - May 6, 2007 - 13:48
Title:Internal Server Error» No ads are shown

Peach, you need to review your webserver error logs to try and understand what is causing the Internal Server Error.

I'm restoring the issue title so people know to review this issue when they have trouble with ads not displaying.

#66

peach - May 6, 2007 - 15:19

Ahh thanks! The error log learned me that the problem was a CHMOD problem. I changed the folder + files all to 755 and now it's working :)

#67

Benjamin Melançon - May 6, 2007 - 17:50

May have had both these problems, and in the end still no ads are shown.

Did try posting ads not as user number one.

Did try the symlink workaround suggested in #36. This did not work. Using the direct url path seen in source and the &debug=2 information (attached), it appears to be looking for sites/default/settings.php. If this is the case it's not going to find it; should I try to tell it to look for sites/example.org/settings.php or am I on the wrong track?

AttachmentSize
adserve.php_.html2.3 KB

#68

Benjamin Melançon - May 6, 2007 - 17:55

(To clarify, unfortunately in our server setup both the modules and sites directories are symlinked in their entirety-- it seemed like a good idea at the time. We'll try to change that but the error message about bootstrap and sites/default give hope there might be another fix.)

#69

Jeremy@kerneltr... - May 6, 2007 - 18:04

Unfortunately as noted in INSTALL.txt it is not currently possible to use the ad module in a symlink'd environment. The ad module needs to actually live in the module/ directory or the sites/domain/modules directory. This limitation is imposed by the way the ad module serves ads without bootstrapping Drupal. Workarounds are possible but very low on my list of priorities. If you wish, open a new issue to track this.

#70

Anonymous - May 20, 2007 - 18:32
Status:fixed» closed

#71

GabiAPF - October 22, 2007 - 15:01

I'm getting a similar problem. Here's what I get when I run adserve.php with debug=2:

Attempting to include cache include file '/var/www/example/modules/ad/cache/file/ad_cache_file.inc'.
ad_dir: '/var/www/example/modules/ad'
debug: '2'
cache: 'file'
nids: '1,2,3,4,13,14,15,16,39637,39638,[...] (Removed some because they were 99.)'
tids: ''
hostid: ''
quantity: '1'
aid: '0'
path: 'files'
files: '3'
Root drupal directory detected as '/var/www/example'.

/var/www/example/modules/ad/adserve.php: // $Id: adserve.php,v 1.2.2.15.2.22 2007/07/25 04:42:02 jeremy Exp $
/var/www/example/modules/ad/ad.module: // $Id: ad.module,v 1.2.2.29.2.43 2007/08/03 14:06:15 jeremy Exp $

Using file cache.
Drupal bootstrap '7'.

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

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

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

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

Warning: Cannot modify header information - headers already sent by (output started at /var/www/example/modules/ad/adserve.inc:211) in /var/www/example/includes/bootstrap.inc on line 534
document.write('Configuration error, failed to lock cache file.');

The amount of nodes found is also wrong, there aren't that many ads. I don't know the cause for that either. I'd appreciate some help.

Using PHP 4.3.10-18 and Drupal 5.2.

#72

GabiAPF - October 22, 2007 - 15:05

By the way, I've checked the file's permissions. It's not a chmod problem.

#73

norio - May 28, 2008 - 13:46

I had the same symptoms as tbm and then eventually found that the "ad_image" and "ad_image_format" tables didn't exist in my database. I created them manually (using the SQL in the ad_image.install file), deleted my ads and recreated them and now my ads are working fine.

I sure hope this helps someone else out there because this was an incredibly frustrating problem to have.

If it helps, I'd had the ad module installed before. I tried to uninstall it and then re-install it which could have very-well created this problem. If anything, there may be a bug in the install or uninstall process worth looking into.

By the way, thanks for a KICK-ASS module. It works beautifully! Well done and thanks for contributing your code back to the community :)

 
 

Drupal is a registered trademark of Dries Buytaert.