<?php
foreach($subjects as $subject) {
    $item = $feed->createItem();
    
$content = '
<div class="restaurantinfo">
  <h2>'.$subject->h('title').'</h2>
    <p><strong>Address:</strong> '.$subject->h('description').', '.$subject->my->h('city').', '.$subject->my->h('state').'</p>';
if (strlen(trim($subject->my->phone))) {
$content .= '<p><strong>Phone Number:</strong> '.$subject->my->h('phone').'</p>
    <p><strong>'.ucfirst(Config::$container).': 
'.$subject->my->h(Config::$container).'</strong></p>';
}
$content .= '
     <p class="posted">First reviewed on '.strftime('%m/%d/%y',strtotime($subject->createdDate)).' by 
        <a class="user"href="list.php?user='.urlencode($subject->contributorName).'">'.$subject->h('contributorName').'</a>
    <br />
    Popular tags: 
    ';
    $tags = XN_Query::create('Tag_ValueCount')
     ->filter('content.id','=',$subject->id)
     ->order('valuecount','desc')
     ->end(3)->execute();
     $content .=  HTMLHelper::tagLinkList($tags, 'list.php?tag=%s'); 
     $content .= '</p>
    
<p><strong>Average Rating:</strong>'.HTMLHelper::ratingImage($subject->my->avgRating).' </p><br />';
    $item->title($subject->title)->description($content)
         ->pubDate($subject->createdDate)
         ->link("http://".$_SERVER['HTTP_HOST']."/subject.php?SubjectID=" . $subject->id);
    $feed->items[] = $item;
}
