Hi,

I'm rather confused about what has replaced _phptemplate_callback in Drupal 6. I'm in the midst of converting an old theme that I have from version 5. I've tried a few things and I can't seem to get it to work.

In the old version I had the following in template.php:

function phptemplate_aggregator_page_item($item) {
  static $last;
  $date = date('l, jS F Y', $item->timestamp);
  if ($date != $last) {
    $newdate = TRUE;
    $last = $date;
  } else {
    $newdate = FALSE;
  }
  $result = db_query('SELECT c.title, c.cid FROM {aggregator_category_item} ci LEFT JOIN {aggregator_category} c ON ci.cid = c.cid WHERE ci.iid = %d ORDER BY c.title', $item->iid);
  $categories = array();
  while ($category = db_fetch_object($result)) {
    $categories[] = l($category->title, 'aggregator/categories/'. $category->cid);
  }
  return _phptemplate_callback('aggregator_page_item', array('newdate' => $newdate, 'date' => $date, 'categories' => $categories, 'item' => $item));
}

And the following in aggregator_page_item.tpl.php:

<div id="news-item">
  <?php if ($newdate) { ?>
    <h3><?php print $date ?></h3>
  <?php } ?>
  <div>
    <span class="news-item-title"><a href="<?php print $item->link ?>"><?php print $item->title ?></a></span>
    <span class="news-item-date">(<?php print date('H:i', $item->timestamp); ?>)</span>
  </div>
</div>

Comments

odsamuels’s picture

Help! I'm having the same problem over here... does anyone have any idea how to rectify this?