Post by Tylr on Apr 16, 2007 10:51:37 GMT -8
This takes a few minutes to install, but it's probably the best way to have yearly calendar events without manually putting them in every year.
The function (red line) works like this:
doadd(eventname,cal_entry,inyearplace,themonth,shortenedmonth,eventday)
Where each variable is described below:
eventname = Name of the event
cal_entry = Event ID
inyearplace = In place of the year
themonth = Number of month the even occurs in
shortenedmonth = Shortened version of the month
eventday = Day the event occurs on
The end result should look something like this:
doadd('Christmas','1176748680',', Every Year','12','Dec','24')
Then just copy that line (like the blue lines) and modify it again for another event.
P.S. To use an apostrophe in an event name, you'll need to add a backslash (\). e.g., it would look like this:
doadd('Jesus\' Birthday','1176748680',', Every Year','12','Dec','24')
Main Footer
<script language="JavaScript">
<!--
/* Yearly eventitys by T.J. */
function doadd(eventname,cal_entry,inyearplace,themonth,shortenedmonth,eventday){
if(location.href.match('action=calendarview&thread='+cal_entry)){
var td=document.getElementsByTagName('td')
for(i=0;i<td.length;i++){
if(td.width=="100%" && td.className=="titlebg"){
td.innerHTML=td.innerHTML.split(',')[0]+inyearplace
}
}
}
if(location.href.match('action=calendar') && !location.href.match('action=calendarview')){
var ah=document.getElementsByTagName('a')
for(a=0;a<ah.length;a++){
if(ah.href.match('post&day='+eventday+'&month='+themonth) && !ah.parentNode.parentNode.parentNode.innerHTML.match(cal_entry)){
ah.parentNode.parentNode.parentNode.innerHTML+='<a href="/index.cgi?action=calendarview&thread='+cal_entry+'">'+eventname+'</a><br/>'
}
}
}
if(!location.href.match('action=')){
var td=document.getElementsByTagName('td')
if(td[2].innerHTML.match(shortenedmonth)){
for(i=0;i<td.length;i++){
if(td.className=='catbg' && td.innerHTML.match('Events This Month') && !td[i+3].innerHTML.match(cal_entry)){
td[i+3].innerHTML+='<font size="1">, <a href="index.cgi?action=calendarview&thread='+cal_entry+'">'+eventname+'</a></font>'
}
}
}
}
}
/* --- Do not edit above this line! --- */
doadd('Christmas','1176748680',', Every Year','12','Dec','24')
doadd('New Years','1176748688',', Every Year','01','Jan','01')
// -->
</script>
*fixed a typo in a location check - Wormo
The function (red line) works like this:
doadd(eventname,cal_entry,inyearplace,themonth,shortenedmonth,eventday)
Where each variable is described below:
eventname = Name of the event
cal_entry = Event ID
inyearplace = In place of the year
themonth = Number of month the even occurs in
shortenedmonth = Shortened version of the month
eventday = Day the event occurs on
The end result should look something like this:
doadd('Christmas','1176748680',', Every Year','12','Dec','24')
Then just copy that line (like the blue lines) and modify it again for another event.
P.S. To use an apostrophe in an event name, you'll need to add a backslash (\). e.g., it would look like this:
doadd('Jesus\' Birthday','1176748680',', Every Year','12','Dec','24')
Main Footer
<script language="JavaScript">
<!--
/* Yearly eventitys by T.J. */
function doadd(eventname,cal_entry,inyearplace,themonth,shortenedmonth,eventday){
if(location.href.match('action=calendarview&thread='+cal_entry)){
var td=document.getElementsByTagName('td')
for(i=0;i<td.length;i++){
if(td.width=="100%" && td.className=="titlebg"){
td.innerHTML=td.innerHTML.split(',')[0]+inyearplace
}
}
}
if(location.href.match('action=calendar') && !location.href.match('action=calendarview')){
var ah=document.getElementsByTagName('a')
for(a=0;a<ah.length;a++){
if(ah.href.match('post&day='+eventday+'&month='+themonth) && !ah.parentNode.parentNode.parentNode.innerHTML.match(cal_entry)){
ah.parentNode.parentNode.parentNode.innerHTML+='<a href="/index.cgi?action=calendarview&thread='+cal_entry+'">'+eventname+'</a><br/>'
}
}
}
if(!location.href.match('action=')){
var td=document.getElementsByTagName('td')
if(td[2].innerHTML.match(shortenedmonth)){
for(i=0;i<td.length;i++){
if(td.className=='catbg' && td.innerHTML.match('Events This Month') && !td[i+3].innerHTML.match(cal_entry)){
td[i+3].innerHTML+='<font size="1">, <a href="index.cgi?action=calendarview&thread='+cal_entry+'">'+eventname+'</a></font>'
}
}
}
}
}
/* --- Do not edit above this line! --- */
doadd('Christmas','1176748680',', Every Year','12','Dec','24')
doadd('New Years','1176748688',', Every Year','01','Jan','01')
// -->
</script>
*fixed a typo in a location check - Wormo