* @license Apache License, Version 2.0 */ if ( ! $this->_pzdxMerchant ) return; $captions = array( 'tags' => 'Tags', 'favorers' => 'favorers', 'praizers' => 'praizers', 'comments' => 'comments' ); $merchant = $this->_pzdxMerchant; $config = $this->_pzdxConfig; $link = $this->_permalink($merchant); $location = $merchant->location; if ( isset($config['translations']) && is_array($config['translations']) ) $captions = array_merge($captions, $config['translations']); // Format address markup $address = ''; if ( isset($location->street_address) ) $address .= ''.$location->street_address.''; if ( isset($location->city->name) ) { if ( ! empty($address) ) $address .= '
'; $address .= ''.$location->city->name.''; } if ( isset($location->regions->state) ) { if ( ! empty($address) ) $address .= ', '; $address .= ''.$location->regions->state.''; } elseif ( isset($location->regions->province) ) { if ( ! empty($address) ) $address .= ', '; $address .= ''.$location->regions->province.''; } if ( isset($location->postal_code) ) { if ( ! empty($address) ) $address .= ', '; $address .= ''.$location->postal_code.''; } if ( isset($location->country->name) ) { if ( ! empty($address) ) $address .= ', '; $address .= ''.$location->country->name.''; } if ( isset($location->latitude) && isset($location->longitude) ) { if ( ! empty($address) ) $address .= ' '; $address .= ''; } // Format tag list $tagList = ''; if ( ! $config['hide_tags'] ) { if ( is_array($merchant->tags) && count($merchant->tags) > 0 ) { foreach ( $merchant->tags as $tag ) { if ( ! empty($tagList) ) $tagList .= ', '; $tagLink = rtrim($this->_pzdxCommunity->base_url, '/') . '/merchants/tag/' . $tag->name; $tagList .= "{$tag->name}"; } } } // Format hCard markup $xhtml .= "
pid}-hcard\">\n"; if ( $link ) $xhtml .= "

{$merchant->name}

\n"; else $xhtml .= "

{$merchant->name}

\n"; if ( ! $config['hide_vote'] ) { $xhtml .= $this->_fragment('vote_button'); $xhtml .= "\n
\n"; } if ( ! empty($address) ) $xhtml .= "{$address}\n"; if ( ! empty($merchant->phone) ) $xhtml .= "
{$merchant->phone}\n"; if ( ! empty($merchant->email) ) $xhtml .= "
email}\" class=\"email\">{$merchant->email}\n"; if ( ! empty($merchant->url) ) $xhtml .= "
url}\" class=\"url\">{$merchant->url}\n"; if ( ! $config['hide_vote'] ) $xhtml .= "
\n"; if ( ! empty($tagList) ) $xhtml .= "

{$captions['tags']}: {$tagList}

\n"; else $xhtml .= "
\n"; if ( ! $config['hide_stats'] && $link ) { $xhtml .= <<<____EOS {$captions['favorers']} ({$merchant->favorite_count}) | {$captions['praizers']} ({$merchant->votes->count}) | {$captions['comments']} ({$merchant->comment_count}) ____EOS; } $xhtml .= "
\n"; /** * Special blog-level var added to the 1st merchant by the blog * platforms when the data to be displayed has been saved statically. */ if ( isset($merchant->static_timestamp) ) $xhtml .= '

' . $merchant->static_timestamp . '

'; ?>