Forum Moderators: coopster
Is this too much, or is there a way to condense it?
if (isset($HTTP_GET_VARS['category'])){
echo'You may also like <a href="' . tep_href_link(SIMILAR) . '">these</a>';
}else{
if (isset($HTTP_GET_VARS['manid']) && $themanquer['similar_country'] !==''){
if ($themanquer['similar_country'] =='CAN'){
$location='Canadian';
}elseif ($themanquer['similar_country'] =='FIN'){
$location='Finnish';
}elseif ($themanquer['similar_country'] =='GER'){
$location='German';
}elseif ($themanquer['similar_country'] =='NOR'){
$location='Norwegian';
}elseif ($themanquer['similar_country'] =='SWE'){
$location='Swedish';
}elseif ($themanquer['similar_country'] =='USA'){
$location='American';
}
echo'Can\'t find it? Try more <a href="' . tep_href_link('loc-'.$themanquer['similar_country']) . '-' . $themanquer['similar_type'].'">'.$location.' ' .$themanquer['similar_type'].'</a>, ';
echo'and <a href="/type-'.$themanquer['similar_type'].'">'.$themanquer['similar_type'],'</a><br />';
}else{
echo'Try other <a href="/type-'.$themanquer['similar_type'].'">'.$themanquer['similar_type'],'</a> stuff.<br/>';
}
}
switch() [php.net]
Define an array somewhere at the top of your PHP file:
$Countries = array(
'CAN' => 'Canadian',
'FIN' => 'Finnish',
'GER' => 'German',
'NOR' => 'Norwegian',
'SWE' => 'Swedish',
'USA' => 'American');
if (isset($Countries[$themanquer['similar_country']]))
{
$location = $Countries[$themanquer['similar_country']];
}