Grizzly Adam
Active member
I have two statements that I want to combine into one depending on the user who owns the album. If the album owner id is 1351, I want to call the second snippet of code. Can anyone help?
Code:
public function getBreadCrumbs(array $user, $album = array())
{
$breadCrumbs = array();
$breadCrumbs['user_'.$user['user_id']] = array(
'href' => XenForo_Link::buildPublicLink('full:useralbums/list', $user),
'value' => new XenForo_Phrase('xfr_useralbums_xs_albums', array('name' => $user['username'])),
);
if (!empty($album))
{
$breadCrumbs[$album['album_id']] = array(
'href' => XenForo_Link::buildPublicLink('full:useralbums/view', $album),
'value' => XenForo_Helper_String::censorString($album['title'])
);
}
return $breadCrumbs;
}
Code:
public function getGalleryCrumbs(array $user, $album = array())
{
if (!empty($album))
{
$breadCrumbs[$album['album_id']] = array(
'href' => XenForo_Link::buildPublicLink('full:useralbums/view', $album),
'value' => XenForo_Helper_String::censorString($album['title'])
);
}
return $galleryCrumbs;
}