function template_preprocess_aggregator_item in Drupal 6
Same name and namespace in other branches
- 8 core/modules/aggregator/aggregator.theme.inc \template_preprocess_aggregator_item()
- 7 modules/aggregator/aggregator.pages.inc \template_preprocess_aggregator_item()
- 9 core/modules/aggregator/aggregator.theme.inc \template_preprocess_aggregator_item()
Process variables for aggregator-item.tpl.php.
See also
File
- modules/
aggregator/ aggregator.pages.inc, line 246 - User page callbacks for the aggregator module.
Code
function template_preprocess_aggregator_item(&$variables) {
$item = $variables['item'];
$variables['feed_url'] = check_url($item->link);
$variables['feed_title'] = check_plain($item->title);
$variables['content'] = aggregator_filter_xss($item->description);
$variables['source_url'] = '';
$variables['source_title'] = '';
if (isset($item->ftitle) && isset($item->fid)) {
$variables['source_url'] = url("aggregator/sources/{$item->fid}");
$variables['source_title'] = check_plain($item->ftitle);
}
if (date('Ymd', $item->timestamp) == date('Ymd')) {
$variables['source_date'] = t('%ago ago', array(
'%ago' => format_interval(time() - $item->timestamp),
));
}
else {
$variables['source_date'] = format_date($item->timestamp, 'custom', variable_get('date_format_medium', 'D, m/d/Y - H:i'));
}
$variables['categories'] = array();
foreach ($item->categories as $category) {
$variables['categories'][$category->cid] = l($category->title, 'aggregator/categories/' . $category->cid);
}
}