Compare commits

..

7 Commits

11 changed files with 112 additions and 266 deletions

@ -21,30 +21,22 @@ class Download
$tag = (int)$_GET['tag']; $tag = (int)$_GET['tag'];
$album = Tag::fromId($tag); $album = Tag::fromId($tag);
if (isset($_GET['by']) && ($user = Member::fromSlug($_GET['by'])) !== false)
$id_user_uploaded = $user->getUserId();
else
$id_user_uploaded = null;
if (isset($_SESSION['current_export'])) if (isset($_SESSION['current_export']))
throw new UserFacingException('You can only export one album at the same time. Please wait until the other download finishes, or try again later.'); throw new UserFacingException('You can only export one album at the same time. Please wait until the other download finishes, or try again later.');
// So far so good? // So far so good?
$this->exportAlbum($album, $id_user_uploaded); $this->exportAlbum($album);
exit; exit;
} }
private function exportAlbum(Tag $album, $id_user_uploaded) private function exportAlbum(Tag $album)
{ {
$files = []; $files = [];
$album_ids = array_merge([$album->id_tag], $this->getChildAlbumIds($album->id_tag)); $album_ids = array_merge([$album->id_tag], $this->getChildAlbumIds($album->id_tag));
foreach ($album_ids as $album_id) foreach ($album_ids as $album_id)
{ {
$iterator = AssetIterator::getByOptions([ $iterator = AssetIterator::getByOptions(['id_tag' => $album_id]);
'id_tag' => $album_id,
'id_user_uploaded' => $id_user_uploaded,
]);
while ($asset = $iterator->next()) while ($asset = $iterator->next())
$files[] = join(DIRECTORY_SEPARATOR, [$asset->getSubdir(), $asset->getFilename()]); $files[] = join(DIRECTORY_SEPARATOR, [$asset->getSubdir(), $asset->getFilename()]);
} }
@ -79,9 +71,6 @@ class Download
// STDOUT should not block. // STDOUT should not block.
stream_set_blocking($pipes[1], 0); stream_set_blocking($pipes[1], 0);
// Allow this the download to take its time...
set_time_limit(0);
header('Pragma: no-cache'); header('Pragma: no-cache');
header('Content-Description: File Download'); header('Content-Description: File Download');
header('Content-disposition: attachment; filename="' . $album->tag . '.tar"'); header('Content-disposition: attachment; filename="' . $album->tag . '.tar"');

@ -46,18 +46,6 @@ class ViewPhoto extends HTMLController
if (isset($tag)) if (isset($tag))
$page->setTag($tag); $page->setTag($tag);
// Keeping tabs on a filter?
if (isset($_GET['by']))
{
// Let's first verify that the filter is valid
$user = Member::fromSlug($_GET['by']);
if (!$user)
throw new UnexpectedValueException('Invalid filter for this album or tag.');
// Alright, let's run with it then
$page->setActiveFilter($user->getSlug());
}
$this->page->adopt($page); $this->page->adopt($page);
$this->page->setCanonicalUrl($this->photo->getPageUrl()); $this->page->setCanonicalUrl($this->photo->getPageUrl());
} }

@ -26,88 +26,59 @@ class ViewPhotoAlbum extends HTMLController
$tag = Tag::fromSlug($_GET['tag']); $tag = Tag::fromSlug($_GET['tag']);
$id_tag = $tag->id_tag; $id_tag = $tag->id_tag;
$title = $tag->tag; $title = $tag->tag;
$header_box = $this->getHeaderBox($tag); $description = !empty($tag->description) ? $tag->description : '';
// Can we go up a level?
if ($tag->id_parent != 0)
{
$ptag = Tag::fromId($tag->id_parent);
$back_link = BASEURL . '/' . (!empty($ptag->slug) ? $ptag->slug . '/' : '');
$back_link_title = 'Back to "' . $ptag->tag . '"';
}
elseif ($tag->kind === 'Person')
{
$back_link = BASEURL . '/people/';
$back_link_title = 'Back to "People"';
$is_person = true;
}
$header_box = new AlbumHeaderBox($title, $description, $back_link, $back_link_title);
} }
// View the album root. // View the album root.
else else
{ {
$id_tag = 1; $id_tag = 1;
$tag = Tag::fromId($id_tag);
$title = 'Albums'; $title = 'Albums';
} }
// What page are we at? // What page are we at?
$current_page = isset($_GET['page']) ? (int) $_GET['page'] : 1; $page = isset($_GET['page']) ? (int) $_GET['page'] : 1;
parent::__construct($title . ' - Page ' . $current_page . ' - ' . SITE_TITLE); parent::__construct($title . ' - Page ' . $page . ' - ' . SITE_TITLE);
if (isset($header_box)) if (isset($header_box))
$this->page->adopt($header_box); $this->page->adopt($header_box);
// Who contributed to this album? // Can we do fancy things here?
$contributors = $tag->getContributorList(); $buttons = $this->getAlbumButtons($id_tag, $tag ?? null);
if (!empty($buttons))
// Enumerate possible filters $this->page->adopt(new AlbumButtonBox($buttons));
$filters = [];
if (!empty($contributors))
{
$filters[''] = ['id_user' => null, 'label' => '', 'caption' => 'All photos',
'link' => $tag->getUrl()];
foreach ($contributors as $contributor)
{
$filters[$contributor['slug']] = [
'id_user' => $contributor['id_user'],
'label' => $contributor['first_name'],
'caption' => sprintf('By %s (%s photos)',
$contributor['first_name'], $contributor['num_assets']),
'link' => $tag->getUrl() . '?by=' . $contributor['slug'],
];
}
}
// Limit to a particular uploader?
$active_filter = '';
$id_user_uploaded = null;
if (!empty($_GET['by']))
{
if (!isset($filters[$_GET['by']]))
throw new UnexpectedValueException('Invalid filter for this album or tag.');
$active_filter = $_GET['by'];
$id_user_uploaded = $filters[$active_filter]['id_user'];
$filters[$active_filter]['is_active'] = true;
}
// Add an interface to query and modify the album/tag
$buttons = $this->getAlbumButtons($tag, $active_filter);
$button_strip = new AlbumButtonBox($buttons, $filters, $active_filter);
$this->page->adopt($button_strip);
// Fetch subalbums, but only if we're on the first page. // Fetch subalbums, but only if we're on the first page.
if ($current_page === 1) if ($page === 1)
{ {
$albums = $this->getAlbums($id_tag); $albums = $this->getAlbums($id_tag);
$index = new AlbumIndex($albums); $index = new AlbumIndex($albums);
$this->page->adopt($index); $this->page->adopt($index);
} }
// Are we viewing a person tag?
$is_person = $tag->kind === 'Person';
// Load a photo mosaic for the current tag. // Load a photo mosaic for the current tag.
list($mosaic, $total_count) = $this->getPhotoMosaic($id_tag, $id_user_uploaded, $current_page, !$is_person); list($mosaic, $total_count) = $this->getPhotoMosaic($id_tag, $page, !isset($is_person));
if (isset($mosaic)) if (isset($mosaic))
{ {
$index = new PhotosIndex($mosaic, Registry::get('user')->isAdmin()); $index = new PhotosIndex($mosaic, Registry::get('user')->isAdmin());
$this->page->adopt($index); $this->page->adopt($index);
$url_params = []; $url_suffix = $id_tag > 1 ? 'in=' . $id_tag : '';
if (isset($tag) && $tag->id_parent != 0)
$url_params['in'] = $tag->id_tag;
if (!empty($active_filter))
$url_params['by'] = $active_filter;
$url_suffix = http_build_query($url_params);
$index->setUrlSuffix('?' . $url_suffix); $index->setUrlSuffix('?' . $url_suffix);
$menu_items = $this->getEditMenuItems('&' . $url_suffix); $menu_items = $this->getEditMenuItems('&' . $url_suffix);
@ -120,24 +91,24 @@ class ViewPhotoAlbum extends HTMLController
$index = new PageIndex([ $index = new PageIndex([
'recordCount' => $total_count, 'recordCount' => $total_count,
'items_per_page' => self::PER_PAGE, 'items_per_page' => self::PER_PAGE,
'start' => ($current_page - 1) * self::PER_PAGE, 'start' => (isset($_GET['page']) ? $_GET['page'] - 1 : 0) * self::PER_PAGE,
'base_url' => $tag->getUrl(), 'base_url' => BASEURL . '/' . (isset($_GET['tag']) ? $_GET['tag'] . '/' : ''),
'page_slug' => 'page/%PAGE%/' . (!empty($active_filter) ? '?by=' . $active_filter : ''), 'page_slug' => 'page/%PAGE%/',
'index_class' => 'pagination-lg justify-content-around justify-content-lg-center', 'index_class' => 'pagination-lg justify-content-around justify-content-lg-center',
]); ]);
$this->page->adopt(new PageIndexWidget($index)); $this->page->adopt(new PageIndexWidget($index));
} }
// Set the canonical url. // Set the canonical url.
$this->page->setCanonicalUrl($tag->getUrl() . ($current_page > 1 ? 'page/' . $current_page . '/' : '')); $this->page->setCanonicalUrl(BASEURL . '/' . (isset($_GET['tag']) ? $_GET['tag'] . '/' : '') .
($page > 1 ? 'page/' . $page . '/' : ''));
} }
public function getPhotoMosaic($id_tag, $id_user_uploaded, $page, $sort_linear) public function getPhotoMosaic($id_tag, $page, $sort_linear)
{ {
// Create an iterator. // Create an iterator.
list($this->iterator, $total_count) = AssetIterator::getByOptions([ list($this->iterator, $total_count) = AssetIterator::getByOptions([
'id_tag' => $id_tag, 'id_tag' => $id_tag,
'id_user_uploaded' => $id_user_uploaded,
'order' => 'date_captured', 'order' => 'date_captured',
'direction' => $sort_linear ? 'asc' : 'desc', 'direction' => $sort_linear ? 'asc' : 'desc',
'limit' => self::PER_PAGE, 'limit' => self::PER_PAGE,
@ -177,26 +148,25 @@ class ViewPhotoAlbum extends HTMLController
return $albums; return $albums;
} }
private function getAlbumButtons(Tag $tag, $active_filter) private function getAlbumButtons($id_tag, $tag)
{ {
$buttons = []; $buttons = [];
$user = Registry::get('user'); $user = Registry::get('user');
if ($user->isLoggedIn()) if ($user->isLoggedIn())
{ {
$suffix = !empty($active_filter) ? '&by=' . $active_filter : '';
$buttons[] = [ $buttons[] = [
'url' => BASEURL . '/download/?tag=' . $tag->id_tag . $suffix, 'url' => BASEURL . '/download/?tag=' . $id_tag,
'caption' => 'Download album', 'caption' => 'Download album',
]; ];
} }
if ($tag->id_parent != 0) if (isset($tag))
{ {
if ($tag->kind === 'Album') if ($tag->kind === 'Album')
{ {
$buttons[] = [ $buttons[] = [
'url' => BASEURL . '/uploadmedia/?tag=' . $tag->id_tag, 'url' => BASEURL . '/uploadmedia/?tag=' . $id_tag,
'caption' => 'Upload photos here', 'caption' => 'Upload photos here',
]; ];
} }
@ -206,14 +176,14 @@ class ViewPhotoAlbum extends HTMLController
if ($tag->kind === 'Album') if ($tag->kind === 'Album')
{ {
$buttons[] = [ $buttons[] = [
'url' => BASEURL . '/editalbum/?id=' . $tag->id_tag, 'url' => BASEURL . '/editalbum/?id=' . $id_tag,
'caption' => 'Edit album', 'caption' => 'Edit album',
]; ];
} }
elseif ($tag->kind === 'Person') elseif ($tag->kind === 'Person')
{ {
$buttons[] = [ $buttons[] = [
'url' => BASEURL . '/edittag/?id=' . $tag->id_tag, 'url' => BASEURL . '/edittag/?id=' . $id_tag,
'caption' => 'Edit tag', 'caption' => 'Edit tag',
]; ];
} }
@ -223,7 +193,7 @@ class ViewPhotoAlbum extends HTMLController
if ($user->isAdmin() && (!isset($tag) || $tag->kind === 'Album')) if ($user->isAdmin() && (!isset($tag) || $tag->kind === 'Album'))
{ {
$buttons[] = [ $buttons[] = [
'url' => BASEURL . '/addalbum/?tag=' . $tag->id_tag, 'url' => BASEURL . '/addalbum/?tag=' . $id_tag,
'caption' => 'Create subalbum', 'caption' => 'Create subalbum',
]; ];
} }
@ -271,25 +241,6 @@ class ViewPhotoAlbum extends HTMLController
return $items; return $items;
} }
private function getHeaderBox(Tag $tag)
{
// Can we go up a level?
if ($tag->id_parent != 0)
{
$ptag = Tag::fromId($tag->id_parent);
$back_link = BASEURL . '/' . (!empty($ptag->slug) ? $ptag->slug . '/' : '');
$back_link_title = 'Back to "' . $ptag->tag . '"';
}
elseif ($tag->kind === 'Person')
{
$back_link = BASEURL . '/people/';
$back_link_title = 'Back to "People"';
}
$description = !empty($tag->description) ? $tag->description : '';
return new AlbumHeaderBox($tag->tag, $description, $back_link, $back_link_title);
}
public function __destruct() public function __destruct()
{ {
if (isset($this->iterator)) if (isset($this->iterator))

@ -702,79 +702,65 @@ class Asset
get_object_vars($this)); get_object_vars($this));
} }
protected function getUrlForAdjacentInSet($prevNext, ?Tag $tag, $activeFilter) public function getUrlForPreviousInSet(?Tag $tag)
{ {
$next = $prevNext === 'next';
$previous = !$next;
$where = [];
$params = [
'id_asset' => $this->id_asset,
'date_captured' => $this->date_captured,
];
// Direction depends on whether we're browsing a tag or timeline
if (isset($tag))
{
$where[] = 't.id_tag = {int:id_tag}';
$params['id_tag'] = $tag->id_tag;
$params['where_op'] = $previous ? '<' : '>';
$params['order_dir'] = $previous ? 'DESC' : 'ASC';
}
else
{
$params['where_op'] = $previous ? '>' : '<';
$params['order_dir'] = $previous ? 'ASC' : 'DESC';
}
// Take active filter into account as well
if (!empty($activeFilter) && ($user = Member::fromSlug($activeFilter)) !== false)
{
$where[] = 'id_user_uploaded = {int:id_user_uploaded}';
$params['id_user_uploaded'] = $user->getUserId();
}
// Use complete ordering when sorting the set
$where[] = '(a.date_captured, a.id_asset) {raw:where_op} ' .
'({datetime:date_captured}, {int:id_asset})';
// Stringify conditions together
$where = '(' . implode(') AND (', $where) . ')';
// Run query, leaving out tags table if not required
$row = Registry::get('db')->queryAssoc(' $row = Registry::get('db')->queryAssoc('
SELECT a.* SELECT a.*
FROM assets AS a
' . (isset($tag) ? ' ' . (isset($tag) ? '
INNER JOIN assets_tags AS t ON a.id_asset = t.id_asset' : '') . ' FROM assets_tags AS t
WHERE ' . $where . ' INNER JOIN assets AS a ON a.id_asset = t.id_asset
ORDER BY a.date_captured {raw:order_dir}, a.id_asset {raw:order_dir} WHERE t.id_tag = {int:id_tag} AND
(a.date_captured, a.id_asset) < ({datetime:date_captured}, {int:id_asset})
ORDER BY a.date_captured DESC, a.id_asset DESC'
: '
FROM assets AS a
WHERE (a.date_captured, a.id_asset) > ({datetime:date_captured}, {int:id_asset})
ORDER BY date_captured ASC, a.id_asset ASC')
. '
LIMIT 1', LIMIT 1',
$params); [
'id_asset' => $this->id_asset,
'id_tag' => isset($tag) ? $tag->id_tag : null,
'date_captured' => $this->date_captured,
]);
if (!$row) if ($row)
{
$obj = self::byRow($row, 'object');
return $obj->getPageUrl() . ($tag ? '?in=' . $tag->id_tag : '');
}
else
return false; return false;
$obj = self::byRow($row, 'object');
$urlParams = [];
if (isset($tag))
$urlParams['in'] = $tag->id_tag;
if (!empty($activeFilter))
$urlParams['by'] = $activeFilter;
$queryString = !empty($urlParams) ? '?' . http_build_query($urlParams) : '';
return $obj->getPageUrl() . $queryString;
} }
public function getUrlForPreviousInSet(?Tag $tag, $activeFilter) public function getUrlForNextInSet(?Tag $tag)
{ {
return $this->getUrlForAdjacentInSet('previous', $tag, $activeFilter); $row = Registry::get('db')->queryAssoc('
} SELECT a.*
' . (isset($tag) ? '
FROM assets_tags AS t
INNER JOIN assets AS a ON a.id_asset = t.id_asset
WHERE t.id_tag = {int:id_tag} AND
(a.date_captured, a.id_asset) > ({datetime:date_captured}, {int:id_asset})
ORDER BY a.date_captured ASC, a.id_asset ASC'
: '
FROM assets AS a
WHERE (a.date_captured, a.id_asset) < ({datetime:date_captured}, {int:id_asset})
ORDER BY date_captured DESC, a.id_asset DESC')
. '
LIMIT 1',
[
'id_asset' => $this->id_asset,
'id_tag' => isset($tag) ? $tag->id_tag : null,
'date_captured' => $this->date_captured,
]);
public function getUrlForNextInSet(?Tag $tag, $activeFilter) if ($row)
{ {
return $this->getUrlForAdjacentInSet('next', $tag, $activeFilter); $obj = self::byRow($row, 'object');
return $obj->getPageUrl() . ($tag ? '?in=' . $tag->id_tag : '');
}
else
return false;
} }
} }

@ -118,11 +118,6 @@ class AssetIterator extends Asset
else else
$where[] = 'a.mimetype = {string:mime_type}'; $where[] = 'a.mimetype = {string:mime_type}';
} }
if (isset($options['id_user_uploaded']))
{
$params['id_user_uploaded'] = $options['id_user_uploaded'];
$where[] = 'id_user_uploaded = {int:id_user_uploaded}';
}
if (isset($options['id_tag'])) if (isset($options['id_tag']))
{ {
$params['id_tag'] = $options['id_tag']; $params['id_tag'] = $options['id_tag'];

@ -155,20 +155,24 @@ class PageIndex
public function getLink($start = null, $order = null, $dir = null) public function getLink($start = null, $order = null, $dir = null)
{ {
$page = !is_string($start) ? ($start / $this->items_per_page) + 1 : $start; $url = $this->base_url;
$url = $this->base_url . str_replace('%PAGE%', $page, $this->page_slug); $amp = strpos($this->base_url, '?') ? '&' : '?';
$urlParams = []; if (!empty($start))
if (!empty($order))
$urlParams['order'] = $order;
if (!empty($dir))
$urlParams['dir'] = $dir;
if (!empty($urlParams))
{ {
$queryString = (strpos($uri, '?') !== false ? '&' : '?'); $page = $start !== '%d' ? ($start / $this->items_per_page) + 1 : $start;
$queryString .= http_build_query($urlParams); $url .= strtr($this->page_slug, ['%PAGE%' => $page, '%AMP%' => $amp]);
$url .= $queryString; $amp = '&';
}
if (!empty($order))
{
$url .= $amp . 'order=' . $order;
$amp = '&';
}
if (!empty($dir))
{
$url .= $amp . 'dir=' . $dir;
$amp = '&';
} }
return $url; return $url;

@ -141,21 +141,6 @@ class Tag
return $rows; return $rows;
} }
public function getContributorList()
{
return Registry::get('db')->queryPairs('
SELECT u.id_user, u.first_name, u.surname, u.slug, COUNT(*) AS num_assets
FROM assets_tags AS at
LEFT JOIN assets AS a ON at.id_asset = a.id_asset
LEFT JOIN users AS u ON a.id_user_uploaded = u.id_user
WHERE at.id_tag = {int:id_tag}
GROUP BY a.id_user_uploaded
ORDER BY u.first_name, u.surname',
[
'id_tag' => $this->id_tag,
]);
}
public static function getPeople($id_parent = 0, $offset = 0, $limit = 24, $return_format = 'array') public static function getPeople($id_parent = 0, $offset = 0, $limit = 24, $return_format = 'array')
{ {
$rows = Registry::get('db')->queryAssocs(' $rows = Registry::get('db')->queryAssocs('

@ -75,11 +75,6 @@ abstract class User
return $this->ip_address; return $this->ip_address;
} }
public function getSlug()
{
return $this->slug;
}
/** /**
* Returns whether user is logged in. * Returns whether user is logged in.
*/ */

@ -367,11 +367,9 @@ div.polaroid a {
---------------------*/ ---------------------*/
.album_button_box { .album_button_box {
float: right; float: right;
display: flex;
margin-bottom: 3rem; margin-bottom: 3rem;
} }
.album_button_box > a, .album_button_box > a {
.album_button_box .btn {
background: var(--bs-body-bg); background: var(--bs-body-bg);
box-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3); box-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
border-color: var( --bs-secondary-bg); border-color: var( --bs-secondary-bg);
@ -379,9 +377,7 @@ div.polaroid a {
padding: 8px 10px; padding: 8px 10px;
margin-left: 12px; margin-left: 12px;
} }
.album_button_box > a:hover, .album_button_box > a:hover {
.album_button_box .btn:hover,
.album_button_box .btn:focus {
background: var(--bs-secondary-bg); background: var(--bs-secondary-bg);
border-color: var(--bs-tertiary-bg); border-color: var(--bs-tertiary-bg);
color: var(--bs-secondary-color); color: var(--bs-secondary-color);

@ -8,15 +8,11 @@
class AlbumButtonBox extends Template class AlbumButtonBox extends Template
{ {
private $active_filter;
private $buttons; private $buttons;
private $filters;
public function __construct(array $buttons, array $filters, $active_filter) public function __construct($buttons)
{ {
$this->active_filter = $active_filter;
$this->buttons = $buttons; $this->buttons = $buttons;
$this->filters = $filters;
} }
public function html_main() public function html_main()
@ -28,39 +24,6 @@ class AlbumButtonBox extends Template
echo ' echo '
<a class="btn btn-light" href="', $button['url'], '">', $button['caption'], '</a>'; <a class="btn btn-light" href="', $button['url'], '">', $button['caption'], '</a>';
if (!empty($this->filters))
{
echo '
<div class="dropdown">
<button class="btn btn-light dropdown-toggle" type="button" data-bs-toggle="dropdown" aria-expanded="false">
<i class="bi bi-filter"></i>';
if ($this->active_filter)
{
echo '
<span class="badge text-bg-danger">',
$this->filters[$this->active_filter]['label'], '</span>';
}
echo '
</button>
<ul class="dropdown-menu">';
foreach ($this->filters as $key => $filter)
{
$is_active = $key === $this->active_filter;
echo '
<li><a class="dropdown-item', $is_active ? ' active' : '',
'" href="', $filter['link'], '">',
$filter['caption'],
'</a></li>';
}
echo '
</ul>
</div>';
}
echo ' echo '
</div>'; </div>';
} }

@ -8,7 +8,6 @@
class PhotoPage extends Template class PhotoPage extends Template
{ {
private $activeFilter;
private $photo; private $photo;
private $metaData; private $metaData;
private $tag; private $tag;
@ -81,11 +80,6 @@ class PhotoPage extends Template
</a>'; </a>';
} }
public function setActiveFilter($filter)
{
$this->activeFilter = $filter;
}
public function setTag(Tag $tag) public function setTag(Tag $tag)
{ {
$this->tag = $tag; $this->tag = $tag;
@ -93,14 +87,14 @@ class PhotoPage extends Template
private function photoNav() private function photoNav()
{ {
if ($previousUrl = $this->photo->getUrlForPreviousInSet($this->tag, $this->activeFilter)) if ($previousUrl = $this->photo->getUrlForPreviousInSet($this->tag))
echo ' echo '
<a href="', $previousUrl, '#photo_frame" id="previous_photo"><i class="bi bi-arrow-left"></i></a>'; <a href="', $previousUrl, '#photo_frame" id="previous_photo"><i class="bi bi-arrow-left"></i></a>';
else else
echo ' echo '
<span id="previous_photo"><i class="bi bi-arrow-left"></i></span>'; <span id="previous_photo"><i class="bi bi-arrow-left"></i></span>';
if ($nextUrl = $this->photo->getUrlForNextInSet($this->tag, $this->activeFilter)) if ($nextUrl = $this->photo->getUrlForNextInSet($this->tag))
echo ' echo '
<a href="', $nextUrl, '#photo_frame" id="next_photo"><i class="bi bi-arrow-right"></i></a>'; <a href="', $nextUrl, '#photo_frame" id="next_photo"><i class="bi bi-arrow-right"></i></a>';
else else