When setting a "Maximum clicks" value to make an add auto-expire nothing happens. The add is still there, clickable and clicks are still counted.

Status info like:
_______________________________________
Status

This advertisement is actively being displayed.

This advertisement will expire after -2 more clicks.
________________________________________

is presented in the Ad.

Comments

jeremy’s picture

Status: Active » Postponed (maintainer needs more info)

Are you using the ad_cache_file module? Does the ad expire after cron runs?

majdi’s picture

I have same problem
the ad don't switch status when its reach maximum clicks or impressions

No I dont use ad_cache_file

and also it's don't expired after cron run
thanks

majdi’s picture

Status: Postponed (maintainer needs more info) » Needs review
Uvedale’s picture

I experienced this problem too.

I needed a quick fix for click expiry, so I added this code to the ad_redirect function in the ad.module file after the new click had been added:


     $maxclicks = db_result(db_query("SELECT maxclicks FROM {ads} WHERE aid = %d", $aid));
  if ($maxclicks > 0) {
          $totalclicks = db_result(db_query("SELECT COUNT(*) FROM ad_clicks WHERE aid = %d AND status = %d", $aid, 1));
          if ($totalclicks >= $maxclicks) {
                db_query("UPDATE {ads} SET adstatus = 'expired', autoexpire = 0, autoexpired = %d, expired = %d WHERE aid = %d", time(), time(), $aid);
          }
  }

majdi’s picture

I have the same Issue

osopolar’s picture

Status: Needs review » Needs work

I set expire after 3 clicks, now I have 9. The statistic says: "This advertisement will expire after -6 more clicks."

Any news on this. Is this working in most cases?

mèche’s picture

subscribe

mattwmc’s picture

Issue summary: View changes

Ditto.

lrwebks’s picture

Status: Needs work » Closed (outdated)

Drupal 6 is EOL and no longer supported. Closing this as outdated for that reason. Thanks for your contribution!