Monday, April 04, 2011 at 1:08 AM.

radio2Suite.viewContentLinks

on viewContentLinks (adruser) {
	<<Changes
		<<3/25/11; 10:07:05 AM by DW
			<<Support for bookmarklet.
		<<3/4/11; 8:18:49 AM by DW
			<<Add a link to the archives for each feed.
		<<3/3/11; 9:17:15 AM by DW
			<<Guard against non-existent RSS and HTML renderings for feeds.
		<<3/3/11; 9:01:42 AM by DW
			<<Guard against links that are not defined.
		<<3/2/11; 7:05:24 PM by DW
			<<Created. 
	local (adrdata = radio2suite.init (), t, pta = html.getpagetableaddress (), now = clock.now ());
	new (tabletype, @t);
	bundle { //set t.feedLinks
		local (adrfeed, viewerUrl = radio2Suite.data.strings.xmlviewerUrl);
		t.feedLinks = "";
		for adrfeed in @adruser^.feeds {
			if defined (adrfeed^.stats.feedUrl) {
				local (url = adrfeed^.stats.feedUrl);
				t.feedLinks = t.feedLinks + "<a href=\"" + viewerUrl + url + "\">" + url + "</a><br><br>"}}};
	bundle { //set t.htmlLinks
		local (adrfeed, viewerUrl = radio2Suite.data.strings.xmlviewerUrl);
		t.htmlLinks = "";
		for adrfeed in @adruser^.feeds {
			if defined (adrfeed^.stats.htmlUrl) {
				local (url = adrfeed^.stats.htmlUrl);
				t.htmlLinks = t.htmlLinks + "<a href=\"" + url + "\">" + url + "</a><br><br>"}}};
	bundle { //set t.archiveLinks -- 3/4/11 by DW
		local (adrfeed);
		t.archiveLinks = "";
		for adrfeed in @adruser^.feeds {
			if defined (adrfeed^.stats.feedUrl) {
				local (urlArchivePage = "archive?user=" + nameof (adruser^) + "&feed=" + nameof (adrfeed^));
				local (urlFeed = adrfeed^.stats.feedUrl, fname = string.lastfield (urlFeed, "/"));
				local (urlArchive = string.delete (urlFeed, sizeof (urlFeed) - sizeof (fname) + 1, sizeof (fname)));
				t.archiveLinks = t.archiveLinks + "<a href=\"" + urlArchivePage + "\">" + urlFeed + "</a><br><br>"}}};
	bundle { //set t.topLinksJsUrl
		if defined (adruser^.stats.urlTopLinksJs) {
			t.topLinksJsUrl = adruser^.stats.urlTopLinksJs}
		else {
			t.topLinksJsUrl = ""}};
	bundle { //set t.top40Links
		if defined (adruser^.stats.urlTopLinksHtml) {
			t.top40Links = adruser^.stats.urlTopLinksHtml}
		else {
			t.top40Links = ""}};
	bundle { //set t.readingListUrl
		if defined (adrdata^.stats.urlCommunityReadingList) {
			t.readingListUrl = adrdata^.stats.urlCommunityReadingList}
		else {
			t.readingListUrl = ""}};
	bundle { //set t.bookmarketcode
		t.bookmarkletcode = string.replaceall (radio2Suite.data.html.bookmarkletCode, "<%domain%>", pta^.host)};
	t.username = nameof (adruser^);
	t.now = now;
	
	local (s = string (radio2Suite.data.html.contentLinksTemplate));
	s = string.multiplereplaceall (s, @t, false, "<%", "%>");
	return (s)}



This listing is for code that runs in the OPML Editor environment. I created these listings because I wanted the search engines to index it, so that when I want to look up something in my codebase I don't have to use the much slower search functionality in my object database. Dave Winer.