Saturday, February 16, 2002

Noscript updated for my Custom archive script generator

My archive script generator adds a bit more complexity to this already complex scheme. Here's an updated version of what you need to comment out in your archive template:

<!--
/*
-->

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title><$BlogTitle$></title>
<style>
body {background:#666666;margin: 0px;font-family: Verdana, Arial, sans-serif;color: black;}
em {color: red; font-style: normal;}
.blogtitle {font-family: Verdana, Arial, sans-serif;color: white;font-size:32px;margin-left:20px;margin-bottom:1px; text-transform:uppercase;}
.links {font-family: Verdana, Arial, sans-serif;font-size:11px;}
A.links:hover{color:white;}
A {font-weight:bold;text-decoration:none;}
A:hover {color:red;}
.date {font-family: Verdana, Arial, sans-serif;color: black;font-size:16px;font-weight:bold;margin:10px;}
.posts {font-family: Verdana, Arial, sans-serif;color: black;font-size:12px;margin:10px;margin-top:0px;}
.byline {font-family: Verdana, Arial, sans-serif;color: #999999;font-size:11px;}
</style>
</head>
<body bgcolor="#666666" marginwidth="0" marginheight="0" link="#336699" vlink="#003366" alink="red">
<div align="center"><br>
<table width="95%" border="1" cellspacing="0" cellpadding="0">
<tr>
<td colspan="2" bgcolor="#336699" height="65" valign="bottom"><div class="blogtitle"><b><$BlogTitle$></b></div></td>
</tr>
<tr>
<td bgcolor="#cccccc" width="150" valign="top" align="right">
<br>
<div class="posts">
<$BlogDescription$><br>
<br>
<!--
In accordance to the Blogger terms of service, please leave this button somewhere on your blogger-powered page.
Thanks!
-->
<a href="http://www.blogger.com/"><img src="http://buttons.blogger.com/bloggerbutton1.gif" width="88" height="31" border="0" alt="This page is powered by Blogger. Isn't yours?"></a>
</div></td>
<td bgcolor="white">

<!--
*/
// -->
<!--


// Generated by the Blogger Archive Script Generator
// at http://philringnalda.com/scriptgen/
// Based on code by Andy Buchanan from
// http://weblog.cheesephone.co.uk/mytemplate.html

// User data
var currentPageName = "current";
var currentPageLink = "./";
var archivePath = "";
var preLink = "";
var postLink = "";

function ArchivePage_MakeLink(){
var month_name = new Array("January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December");
var newName = preLink + month_name[this.StartDate.getMonth()]+" "+this.StartDate.getFullYear() + postLink;
var outString = "";

if ( -1 != location.href.indexOf( this.Link ) ){
outString = "<span class=\"archivelinks\">" + newName + "</span><br>";
}
else{
outString = "<a href=\"" + archivePath + this.Link + "\" class=\"archivelinks\">" + newName + "</a><br>";
}
return outString;
}

function ArchivePage_Compare( rhs ){
if ( this.StartDate == rhs.StartDate )
return 0;
else if ( this.StartDate > rhs.StartDate )
return 1;
else
return -1;
}

function ArchivePage( theLink, theName ){
this.Link = theLink;
this.Name = theName;

this.StartDate = new Date( this.Name.slice(6,10), this.Name.slice(0,2)-1, this.Name.slice(3,5) );
this.EndDate = new Date( this.Name.slice(13+6,13+10), this.Name.slice(13+0,13+2)-1, this.Name.slice(13+3,13+5) );

ArchivePage.prototype.MakeLink = ArchivePage_MakeLink;
ArchivePage.prototype.Compare = ArchivePage_Compare;
}

function bi_comp( a, b ){
return -a.Compare( b );
}


function FindIdx( myURL ){
for ( var n=0; n<BlogInfo.length; n++ ){
if ( -1 != myURL.indexOf( BlogInfo[n].Link ) )
return n;
}
return null;
}

function WriteArchiveSection( BlogInfo ){
BlogInfo.sort( bi_comp );
var start = 0;
var end = BlogInfo.length;
var currentPage = FindIdx(location.href);

if ( null != currentPage ){ document.write( "<a href=\"" + currentPageLink + "\">" + currentPageName + "</a><br>"); }
for ( var n=start; n<end; n++ ){
document.write( BlogInfo[n].MakeLink() );
}


}
var count=0;
var BlogInfo = new Array();
// -->
<Blogger>
<!--
BlogInfo[count++] = new ArchivePage( "<$BlogArchiveLink$>" , "<$BlogArchiveName$>" );
// --> <a href='<$BlogArchiveLink$>'><$BlogArchiveName$></a><br>

</Blogger>
<!--
WriteArchiveSection( BlogInfo );
// --> <a href='./'>current</a>
<!--
/*
// -->

<br></td>
</tr>
</table>
</div>
</body>
</html>
<!--
*/
// -->