function ad_report_bargraph in Advertisement 5
Same name and namespace in other branches
- 5.2 report/ad_report.module \ad_report_bargraph()
- 6.3 report/ad_report.module \ad_report_bargraph()
- 6 report/ad_report.module \ad_report_bargraph()
- 6.2 report/ad_report.module \ad_report_bargraph()
- 7 report/ad_report.module \ad_report_bargraph()
Page to display ad with bargraph.
1 string reference to 'ad_report_bargraph'
- ad_report_menu in report/
ad_report.module - Implementation of hook_menu().
File
- report/
ad_report.module, line 78 - Provides comprehensive charts and reports about advertising statistics.
Code
function ad_report_bargraph($data, $granularity, $type = 'node') {
switch ($granularity) {
case 'hourly':
drupal_set_title(t('past twelve hours'));
break;
case 'daily':
default:
$granularity = 'daily';
drupal_set_title(t('past twelve days'));
break;
case 'weekly':
drupal_set_title(t('past twelve weeks'));
break;
case 'monthly':
drupal_set_title(t('past twelve months'));
break;
}
switch ($type) {
case 'node':
$ad = db_fetch_object(db_query('SELECT aid, redirect, adtype FROM {ads} WHERE aid = %d', $data->nid));
if ($ad->aid) {
$output = '<img src="' . url("ad_report/{$data->nid}/bargraph/{$granularity}/node") . '" />';
$output .= theme('box', $data->title, module_invoke("ad_{$data->adtype}", 'display_ad', $ad));
}
break;
default:
$output = '<img src="' . url("ad_report/{$data->uid}/bargraph/{$granularity}/{$type}") . '" />';
break;
}
return $output;
}