Monday, November 08, 2010 at 12:05 AM.
system.verbs.builtins.radio.macros.cloudLinks
on cloudLinks () {
<<Changes
<<8/21/04; 9:52:36 AM by SK
<<Removed tables and replaced with paragraph tags. Visually it's nearly identical and makes CSS/XHTML compatibility easier.
<<3/7/02; 9:29:54 AM by DW
<<If radio.data.staticSiteStats.groupName is defined, add the group to the referers url. Fixes breakage caused in yesterday's corner-turn.
<<3/3/02; 2:12:15 AM by JES
<<Get the home URL through a call to radio.weblog.getUrl, instead of using a hard-coded calculation here. This only applies to the case where the home page has never been upstreamed.
<<3/1/02; 1:54:42 PM by JES
<<Added Updates link.
<<2/25/02; 3:10:48 PM by JES
<<Get the base-URLs of the referers and rankings pages from radio.data.cloudUrls.referers and radio.data.cloudUrls.rankings, instead of using hard-coded URLs here.
<<12/8/01; 5:49:38 PM by JES
<<Changed links to Referers and Site Rankings pages to the new urls at stats.userland.com and referers.userland.com.
<<12/8/01; 4:09:56 PM by JES
<<Get the home link url from the upstream sub-table of the filetable for the www folder. Default to the radio.weblogs.com url, if the url in the filetable hasn't been set yet.
<<11/14/01; 5:55:49 PM by DW
<<Link to the help system.
<<11/14/01; 5:07:45 PM by DW
<<Add white-on-orange question mark.
<<10/24/01; 7:48:49 PM by DW
<<Created
bundle { //if static rendering, return the empty string
try { //make it so we can run this script in the debugger
local (pta = html.getpagetableaddress ());
if pta^.radioResponder.flStaticRendering {
return ("")}}};
local (htmltext = "\r", indentlevel = 0);
on add (s) {
htmltext = htmltext + string.filledstring ("\t", indentlevel) + s + "\r\n"};
on addrow (s) {
<<add ("<tr><td><div class=\"small\">" + s + "</div></td></tr>")
<<//7/23/04; 11:29:10 AM by SK--commented out to remove tables
add ("<p>"+s+"</p>")};
<<add ("<div class=\"small\"><b>" + radio.string.getlocalizedstring ("cloudLinks.title") + ":</b> " + radio.userinterface.helplink ("Cloud Links") + "<br></div>")
<<//7/23/04; 11:29:10 AM by SK--commented out to remove tables
add ("<b>"+radio.string.getlocalizedstring ("cloudLinks.title") + ":</b> " + radio.userinterface.helplink ("Cloud Links"));
<<//7/23/04; 11:33:29 AM by SK--removed div tags so they can be decided in the templates, not the code here
<<add ("<table cellpadding=\"0\" cellspacing=\"5\">"); indentlevel++
<<//7/23/04; 11:29:10 AM by SK--commented out to remove tables
local (usernumstring = string.padwithzeros (user.radio.prefs.usernum, 7));
local (homeurl);
bundle { //calculate homeurl
homeurl = "http://radio.weblogs.com/" + usernumstring + "/";
local (adrfolder = @user.radio.settings.files.[user.radio.prefs.upstream.folder]);
if adrfolder^.upstream.url != "" {
homeurl = adrfolder^.upstream.url}
else {
try {
homeurl = radio.weblog.getUrl ()}}};
local (referersurl);
bundle { //calculate referersurl
referersurl = radio.data.cloudUrls.referers + usernumstring;
if defined (radio.data.staticSiteStats.groupName) {
referersurl = referersurl + "&group=" + radio.data.staticSiteStats.groupName}};
addrow ("<a href=\"" + homeurl + "\">Home</a> " + radio.string.getlocalizedstring ("cloudLinks.homeDescription"));
addrow ("<a href=\"" + referersurl + "\">Referers</a> " + radio.string.getlocalizedstring ("cloudLinks.referersDescription"));
addrow ("<a href=\"" + radio.data.cloudUrls.rankings + "\">Ranking by Page-Reads</a> " + radio.string.getlocalizedstring ("cloudLinks.rankingDescription"));
addrow ("<a href=\"" + radio.data.cloudUrls.weblogUpdates + "\">Updates</a> " + radio.string.getlocalizedstring ("cloudLinks.updatesDescription"));
<<add ("</table>"); indentlevel--
<<//7/23/04; 11:29:10 AM by SK--commented out to remove tables
return (htmltext)}
<<bundle //testing
<<cloudLinks ()
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.