You are here

function ad_text_handler_field_text in Advertisement 5

Same name and namespace in other branches
  1. 5.2 text/ad_text_views.inc \ad_text_handler_field_text()
1 string reference to 'ad_text_handler_field_text'
ad_text_views_tables in text/ad_text_views.inc

File

text/ad_text_views.inc, line 38

Code

function ad_text_handler_field_text($fieldinfo, $fielddata, $value, $data) {
  $ad = db_fetch_object(db_query("SELECT a.redirect, t.adheader, t.adbody FROM {ads} a JOIN {ad_text} t ON a.aid = t.aid WHERE t.aid = %d AND a.adtype = 'text'", $value));
  if ($ad) {
    ad_statistics_increment($value, 'view');
    return "<a href=\"{$ad->redirect}\">{$ad->adheader}</a><br />{$ad->adbody}";
  }
}