pheww that was far more complex that I had thought it would be, I completely forgot ‘archives’ were subdivided into lots of different things but I think I’ve caught them all now. Thanks for pointing me in the right direction with get_query_var that solved several issues.
Below is the final version in case it helps anybody else, this is the function call for the super-cool-qrcode plugin (but getting those urls is relevant to lots of things) and it can be seen working here now: https://www.asquare.org/networkresearch/2009/art-by-telephone
Garrett
//which ype of page are we viewing?
//render an appropriate QR Code
switch (1)
{
//for posts
case (is_single()):
echo '<img src="'.sqr_url(get_permalink(), "165", "UTF-8", "L", "0").'" width="175" height="175" border="0" />';
break;
//for pages
case (is_page()):
echo '<img src="'.sqr_url(get_permalink(), "176", "UTF-8", "L", "0").'" width="175" height="175" border="0" />';
break;
//for category archives
case is_category():
echo '<img src="'.sqr_url(get_bloginfo('url').get_option('category_base')."/".get_query_var('category_name'), "165", "UTF-8", "L", "0").'" width="175" height="175" border="0" />';
break;
//for tag archives
case is_tag():
echo '<img src="'.sqr_url(get_bloginfo('url').get_option('tag_base')."/".get_query_var('tag'), "174", "UTF-8", "L", "0").'" width="175" height="175" border="0" />';
break;
//currently not used
//for author archives
//case is_author():
//echo '<img src="'.sqr_url(, "165", "UTF-8", "L", "0").'" width="175" height="175" border="0" />';
//break;
//for date archives
case is_date():
echo '<img src="'.sqr_url(get_bloginfo('url')."/".get_query_var('year')."/".zeroise(get_query_var('monthnum'), 2), "174", "UTF-8", "L", "0").'" width="175" height="175" border="0" />';
break;
//for search pages
case is_search():
echo '<img src="'.sqr_url(get_bloginfo('url')."/index.php?s=".get_search_query()."&submit=", "165", "UTF-8", "L", "0").'" width="175" height="175" border="0" />';
break;
//for everything else
default:
echo '<img src="'.sqr_url(get_bloginfo('url'), "174", "UTF-8", "L", "0").'" width="175" height="175" border="0" />';
break;
}