';
if($piccredit<>'') {
$parts=explode('"',$piccredit);
// part 0 =

// take part 1 and split it down by comma delimiter. Last of X is always via Wiki Commons. Second-last of X is always Licence.
$split1=explode(',',$parts[1]);
$c=count($split1)-1;
$artist=$split1[($c-2)];
// if contains _by_ then drop the bit before
$dex=preg_split("/ by/",$artist);
$i=count($dex);
if($i>1) {
$artist=ltrim($dex[($i-1)]," ");
}
$licence=$split1[($c-1)];
$licence=str_replace('<','<',$licence);
$licence=str_replace('>','>',$licence);
$dex=explode('<',$licence);
$licencename=$dex[0];
$dex2=explode('>',$dex[1]);
$licenceurl=$dex2[0];
$linktolicence='
'.$licencename.'';
$modded=str_replace('title=','class="img-fluid rounded-sm" title=',$piccredit);
echo '
'.$modded.'';
echo '
We'd like to give credit to '.$artist.' for the above picture that we have reused under '.$linktolicence.'. We have modified the original to suit our site layout and colour scheme requirements and therefore our variant may also be reused under the same licence terms. Click the image above in this pop-up window to view the original on Wikimedia Commons along with full copyright, licence and reuse details.
';
} else {
echo '

';
echo '
'.$piccredit.'
';
}
echo '