lime icon

Phosphorus and Lime

A Developer's Broadsheet

This blog has been deprecated. Please visit my new blog at klenwell.com/press.
JS: blogger archive link
The following script adds a link to the current archives page for your blogger blog without requiring you to list out all the archived months. As currently configured, it required monthly archives.

Put this in <HEAD> tag:

<script type="text/javascript">

// fx blogger_last_archive()
function blogger_last_archive() {

// DATA
var arch_root="http://phosphorusandlime.blogspot.com/";
var obj_DATE = new Date();
var arch_year= obj_DATE.getFullYear();
var arch_month= obj_DATE.getMonth() + 1;
var arch_tail="_01_phosphorusandlime_archive.html";

// MANIPULATE

// uncomment if you prefer to get archive for last month
// arch_month--;

// control for year turnover
if ( arch_month == 0 )
{
arch_month = 12;
}

// convert to two-digit field
if ( arch_month > 0 && arch_month <= 9 )
{
var s_arch_month = String(arch_month);
arch_month = "0" + s_arch_month;
}

// RETURN
document.write('<a href="' + arch_root + arch_year + '_' + arch_month + arch_tail + '">archives</a>' );
}
// end blogger_last_archive()

</script>


Put this in <BODY> tag where you wish to have link appear:

<script type="text/javascript">blogger_last_archive();</script>


See archives link in column to left for result.