The difficulty is to handle the access rights to the article because anonymous users will be redirect to index of the site.
If you want to display the link to anonymous you can use autotag plugin. Create a new autotag call linkstory for exemple (check Replace with PHP).
Text Formatted Code
function phpautotags_linkstory ($p1,$p2) {
global $_TABLES,$_CONF;
$result = DB_query("SELECT COUNT(*) AS count FROM {$_TABLES['stories']} WHERE sid = '$p1'");
$A = DB_fetchArray($result);
if ($A['count'] > 0) {
if (SEC_hasAccess ($A['owner_id'], $A['group_id'],
$A['perm_owner'], $A['perm_group'], $A['perm_members'],
$A['perm_anon']) >= 2) {
$url = COM_buildUrl($_CONF['site_url'] . '/article.php?story='. $p1);
} else {
// You can custom the page ID here
$url = COM_buildUrl($_CONF['site_url'] . '/staticpages/index.php?page=my_custom_page');
}
$linktext = $p2;
if (empty($linktext)|| $p1==$p2) {
$linktext = stripslashes(DB_getItem($_TABLES['stories'],
'title', "sid = '$p1'"));
}
$content = COM_createLink($linktext, $url);
}
return $content;
}
Select execute php(return) and put this code in the content in text or html formatted
Text Formatted Code
return SEC_loginRequiredForm();