function ad_report_bargraph in Advertisement 6
Same name and namespace in other branches
- 5.2 report/ad_report.module \ad_report_bargraph()
- 5 report/ad_report.module \ad_report_bargraph()
- 6.3 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 80 - Provides comprehensive charts and reports about advertising statistics.
Code
function ad_report_bargraph($node, $granularity = 'daily', $type = 'node') {
switch ($granularity) {
case 'hourly':
drupal_set_title(t('Past twelve hours'));
break;
case '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':
if ($node->aid) {
$output = '<img src="' . url("ad_report/{$node->nid}/bargraph/{$granularity}/node") . '" />';
$ad_link = module_invoke('ad_' . $node->adtype, 'display_ad', $node);
$output .= theme('box', $node->title, $ad_link);
}
break;
default:
$output = '<img src="' . url("ad_report/{$node->uid}/bargraph/{$granularity}/{$type}") . '" />';
break;
}
return $output;
}