PHP Code:
$vbulletin->input->clean_array_gpc('r', array(
'artistid' => TYPE_UINT
));
$sql = "SELECT " . TABLE_PREFIX . "erc_artistmbr.*, " . TABLE_PREFIX . "erc_artist.artisttitle
FROM " . TABLE_PREFIX . "erc_artistmbr
LEFT JOIN " . TABLE_PREFIX . "erc_artist ON " . TABLE_PREFIX . "erc_artist.artistid = " . TABLE_PREFIX . "erc_artistmbr.artistid
";
if ($vbulletin->GPC['artistid'])
{
$artistid = $vbulletin->GPC['artistid'];
$sql .= " WHERE " . TABLE_PREFIX . "erc_artistmbr.artistid = $artistid";
}
$sql .= " ORDER BY " . TABLE_PREFIX . "erc_artist.artisttitle, erc_artistmbr.displayorder";
$artistmbrs = $db->query_read($sql);