Featured link javascript
From CGWiki
This javascript code will allow you to put a featured link on your site. See Fallen Angels Used Books' front page for an example.
Featured Link Javascript by Faub.
This piece goes in the <head> section of the HTML. (note, the sites in these links are from my links page. I basically just copied and pasted down the list.)
Code:
<script type="text/javascript">
<!--
function featuredLink() {
// J F M A M J J A S O N D
var daysinmonth = new Array( 0, 31,59,90,120,151,181,212,243,273,304,334,365 );
var link = new Array(
"http://yeahduff.keenspace.com/",
"http://alexandilia.keenspace.com/",
"http://orion.keenspace.com/",
"http://entity.keenspace.com/",
"http://brokenglass.keenspace.com/",
"http://cortland.keenspace.com/",
"http://pele.keenspace.com/",
"http://thedevilspanties.keenspace.com/",
"http://www.digitalwar.co.uk/",
"http://endofthings.keenspace.com/",
"http://flatwood.keenspace.com/",
"http://mercuryhat.keenspace.com/",
"http://ifthenelse.keenspace.com/",
"http://www.thejaded.co.uk/",
"http://kageroumanga.keenspace.com/",
"http://km.keenspace.com/",
"http://mixedmyth.keenspace.com/",
"http://morningstar.keenspace.com/",
"http://nahast.keenspace.com/",
"http://nekkoandjoruba.keenspace.com/",
"http://nishichi27.keenspace.com/",
"http://pointless.keenspace.com/",
"http://www.reasonedcognition.com/",
"http://spools.keenspace.com/",
"http://nowhere.keenspace.com/",
"http://roughies.keenspace.com/",
"http://therules.keenspace.com/",
"http://ju-lian.keenspace.com/",
"http://saturnalia.keenspace.com/",
"http://shifters.keenspace.com/",
"http://oosterwijk.keenspace.com/",
"http://gunsnstuff.keenspace.com/",
"http://npc.keenspace.com/",
"http://vagrantvivian.keenspace.com/"
);
var names = new Array(
"8:1",
"Alex & Ilia",
"Beyond Reality",
"Blue Zombie",
"Broken Glass",
"Cortland",
"Deity Permit",
"The Devil's Panties",
"Digital War",
"The End of Things",
"Flatwood",
"Gunmetal Annie",
"If-Then-Else",
"The Jaded",
"Kagerou",
"Kurenai Mashin",
"Mixed Myth",
"Morningstar",
"Nahast: Lands of Strife",
"Nekko and Jaruba",
"Nishichi27",
"Pointless",
"Reasoned Cognition",
"Retrogressive Indexing and Filing",
"Road From Nowhere",
"Roughies",
"The Rules",
"Rules of Make Believe",
"Saturnalia",
"Shifters",
"Star Bored",
"Swords are Cool",
"Tales of the Questor",
"Vagrant Vivian"
);
var today = new Date();
var month, date_str;
index = ( daysinmonth[ today.getMonth() ] + today.getDate() )% names.length;
return "<a href=\"" + link[ index ] + "\">" + names[ index ] + "</a>";
}
//-->
</script>
It would be better to put it in a separate .js file and include it with
<link rel="script" type="text/javascript" href="featured.js" />
but that's up to you.
Now, in the <body> section of your HTML, wherever you want to put it include:
<script type="text/javascript"> <!-- document.write( featuredLink()); //--> </script>
Just replace the links and the names with the sites that you want to link to. Note that there are two lists - the top one is the url and the bottom one is the name that appears. They are in order, so the fifth url will display the fifth name.
That's all there is.

