friendica-directory/src/templates/sub/profile.phtml

86 lines
4.6 KiB
PHTML

<?php
$parts = [];
if (!empty($profile['locality'])) {
$parts[] = $this->escapeHtml($profile['locality']) . ' <a href="' . $this->escapeHtmlAttr($this->r('search', [], ['field' => 'locality', 'q' => $profile['locality']])) . '">
<span class="fa fa-filter" title="' . $this->__('Filter by locality') . '" aria-hidden="true"></span>
</a>';
}
if (!empty($profile['region'])
&& strtolower($profile['locality']) != strtolower($profile['region'])) {
$parts[] = $this->escapeHtml($profile['region']) . ' <a href="' . $this->escapeHtmlAttr($this->r('search', [], ['field' => 'region', 'q' => $profile['region']])) . '">
<span class="fa fa-filter" title="' . $this->__('Filter by region') . '" aria-hidden="true"></span>
</a>';
}
if (!empty($profile['country'])) {
$parts[] = $this->escapeHtml($profile['country']) . ' <a href="' . $this->escapeHtmlAttr($this->r('search', [], ['field' => 'country', 'q' => $profile['country']])) . '">
<span class="fa fa-filter" title="' . $this->__('Filter by country') . '" aria-hidden="true"></span>
</a>';
}
?>
<figure id="profile-<?php echo $this->escapeHtmlAttr($profile['id']) ?>" class="bg-light p-3 rounded">
<div class="media">
<a href="<?php echo $this->escapeHtmlAttr($this->u($profile['profile_url'])) ?>">
<img class="mr-3 rounded" src="photo/<?php echo $profile['id'] ?>.jpg">
</a>
<div class="media-body">
<h5 class="name">
<?php if ($profile['subscribe']): ?>
<a href="<?php echo $this->escapeHtmlAttr($profile['subscribe']); ?>" class="card-link btn btn-primary float-right" target="_blank" rel="noopener noreferrer">
<i class="fa fa-external-link-alt"></i> <?php echo $this->p__('verb', 'Follow')?>
</a>
<?php elseif ($profile['remote_follow']): ?>
<a href="<?php echo $this->escapeHtmlAttr($this->u($profile['remote_follow'])); ?>" class="card-link btn btn-primary float-right" target="_blank" rel="noopener noreferrer">
<i class="fa fa-external-link-alt"></i> <?php echo $this->p__('verb', 'Follow')?>
</a>
<?php else: ?>
<a href="<?php echo $this->escapeHtmlAttr($this->u($profile['profile_url'])); ?>" class="card-link btn btn-primary float-right" target="_blank" rel="noopener noreferrer">
<i class="fa fa-external-link-alt"></i> <?php echo $this->p__('verb', 'Follow')?>
</a>
<?php endif; ?>
<a href="<?php echo $this->escapeHtmlAttr($profile['profile_url']) ?>">
<?php echo $this->escapeHtml($profile['name']) ?>
</a>
</h5>
<p class="url">
<a href="<?php echo $this->escapeHtmlAttr($this->u($profile['profile_url'])) ?>">
<?php echo $this->escapeHtml($profile['addr']) ?>
</a>
</p>
<p class="description d-none d-md-block"><?php echo $this->escapeHtml($profile['pdesc']) ?></p>
</div>
</div>
<p class="description d-md-none"><?php echo $this->escapeHtml($profile['pdesc']) ?></p>
<?php if ($profile['language']):?>
<div class="language">
<i class="fa fa-language" alt="<?php echo $this->__('Language')?>" title="<?php echo $this->__('Language')?>"></i>
<?php echo $this->e(Friendica\Directory\Utils\L10n::localeToLanguageString($profile['language'])) ?>
<a href="<?php echo $this->escapeHtmlAttr($this->r('search', [], ['field' => 'language', 'q' => $profile['language']])) ?>">
<i class="fa fa-filter" title="<?php echo $this->__('Filter by language')?>"></i>
</a>
</div>
<?php endif;?>
<div class="location">
<?php if (count($parts)): ?>
<i class="fa fa-globe" alt="<?php echo $this->__('Location')?>" title="<?php echo $this->__('Location')?>"></i>
<?php echo implode(', ', $parts); ?>
<?php endif ?>
</div>
<?php if ($profile['tags']): ?>
<div class="tags">
<?php
$tags = array_map('trim', explode(' ', $profile['tags']));
foreach ($tags as $tag):?>
<span class="badge">
<?php echo $this->escapeHtml($tag) ?>
<a href="<?php echo $this->escapeHtmlAttr($this->r('search', [], ['q' => $tag])) ?>">
<i class="fa fa-tag" title="<?php echo $this->__('Search Tag')?>"></i>
</a>
</span>
<?php endforeach; ?>
</div>
<?php endif; ?>
</figure>