Hi All,
I have two small coding projects to complete. Let me first say that I am more concerned with getting the first one complete first. The second one will be great if it can be done, but not needed right away...
First script project is a random image script (another one), only this time, I am not using this for database purposes like the last one. This script will be one will that will be put into a directory on my server with images in the same folder (or another) doesn't matter where images are stored, but it will need to pick the 'correct' image out of the bunch of images. Here's the trick, the script must display the correct picture based on the time of year. I have a date script (date meaning month, day, year... Not dating script) that looks like this:
Code:
calendar = new Date();
day = calendar.getDay();
month = calendar.getMonth();
date = calendar.getDate();
year = calendar.getYear();
if (year < 1000)
year+=1900
cent = parseInt(year/100);
g = year % 19;
k = parseInt((cent - 17)/25);
i = (cent - parseInt(cent/4) - parseInt((cent - k)/3) + 19*g + 15) % 30;
i = i - parseInt(i/28)*(1 - parseInt(i/28)*parseInt(29/(i+1))*parseInt((21-g)/11));
j = (year + parseInt(year/4) + i + 2 - cent + parseInt(cent/4)) % 7;
l = i - j;
emonth = 3 + parseInt((l + 40)/44);
edate = l + 28 - 31*parseInt((emonth/4));
emonth--;
var dayname = new Array ("Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday");
var monthname =
new Array ("January","February","March","April","May","June","July","August","September","October","November","December" );
document.write("<font face=verdana,arial size=2>");
document.write(dayname[day] + ", ");
document.write(monthname[month] + " ");
if (date< 10) document.write("0" + date + ", ");
else document.write(date + ", ");
document.write(year + " <font color=000000>");
// Easter
if ((month == emonth) && (date == edate)) document.write("Easter Sunday (Western) ");
// January
if ((month == 0) && (date == 1)) document.write("Today Is New Year's Day");
if ((month == 0) && (date == 15)) document.write("Today Is Adults Day (Japan)");
if ((month == 0) && (date == 27)) document.write("Wolfgang Amadeus Mozart born (1756)");
if ((month == 0) && (day == 1) && (date > 14) && (date< 22)) document.write("Today Is Martin Luther King's Birthday");
// February
if ((month == 1) && (date == 2)) document.write("Today Is Groundhog Day");
if ((month == 1) && (date == 8)) document.write("Jules Verne born (1828)");
if ((month == 1) && (date == 11)) document.write("Today Is National Foundation Day (Japan)");
if ((month == 1) && (date== 12)) document.write("Today Is Lincoln's Birthday");
if((month == 1) && (date == 14)) document.write("Today Is St. Valentine's Day");
if ((month == 1) && (date == 15)) document.write("Galileo Galilei born (1564)");
if ((month == 1) && (date == 22)) document.write("Today Is Washington's Birthday");
if ((month == 1) && (date == 29)) document.write("Today Is Leap Day");
// March
if ((month == 2) && (date == 3)) document.write("Today Is Girl's Day (Japan)");
if ((month == 2) && (date == 17)) document.write("Today Is St. Patrick's Day");
if ((month == 2) && (date == 21)) document.write("J.S. Bach born (1685)");
// April
if ((month == 3) && (date == 1)) document.write("Today Is April Fools' Day");
if ((month == 3) && (date == 8)) document.write("Buddha born");
if ((month == 3) && (date == 15) && (day != 0)) document.write("Today Is Income Tax Day (USA), ");
if ((month == 3) && (date == 16) && (day == 1)) document.write("Today Is Income Tax Day (USA) ");
if ((month == 3) && (date == 15)) document.write("Leonardo da Vinci born (1452)");
if ((month == 3) && (date == 22)) document.write("Today Is Earth Day");
if ((month == 3) && (date == 29)) document.write("Today Is The Emperor's Birthday (Japan)");
if ((month == 3) && (day == 0) && (date > 0) && (date< 8)) document.write("Daylight Savings Time Begins");
// May
if ((month == 4) && (date == 1)) document.write("Today Is May Day, Boy's Day (Japan)");
if ((month == 4) && (date == 2)) document.write("Today Is Constitution Day (Japan)");
if ((month == 4) && (date == 5)) document.write("Today Is Cinco de Mayo (Mexico), Children's Day (Japan)");
if ((month == 4) && (date == 14)) document.write("Today Is Independence Day (Paraguay)");
if ((month == 4) && (day == 0) && (date > 7) && (date< 16)) document.write("Today Is Mother's Day");
if ((month == 4) && (day == 1) && (date > 24)) document.write("Today Is Memorial Day");
// June
if ((month == 5) && (date == 5)) document.write("Today Is Constitution Day (Denmark)");
if ((month == 5) && (date == 6)) document.write("Today Is D-Day (USA)");
if ((month == 5) && (date == 11)) document.write("Today Is Kamehameha (Hawaii)");
if ((month == 5) && (date == 14)) document.write("Today Is FlagDay (USA)");
if ((month == 5) && (date == 21)) document.write("Today Starts Summer Solstice");
if((month == 5) && (date == 24)) document.write("Today Is St. Jean Baptiste Day (Canada)");
if ((month == 5) && (date == 30)) document.write("Today Is Independence Day (Zaire)");
if ((month == 5) && (day == 0) && (date > 15) && (date< 24)) document.write("Today Is Father's Day");
// July
if ((month == 6) && (date == 1)) document.write("Today Is Independence Day (Canada)");
if ((month == 6) && (date == 4)) document.write("Today Is Independence Day (USA)");
if ((month == 6) && (date == 14)) document.write("Today Is Bastille Day (France)");
// August
if ((month == 7) && (date == 1)) document.write("Today Is Confederation Day (Switzerland)");
if ((month == 7) && (date == 10)) document.write("Today Is Independence Day (Ecuador)");
if ((month == 7) && (date == 15)) document.write("Today Is Independence Day (India)");
// September
if ((month == 8) && (date == 7)) document.write("Today Is Independence Day (Brazil)");
if ((month == 8) && (date == 15)) document.write("Today Is Respect for the Aged Day (Japan)");
if ((month == 8) && (date == 16)) document.write("Today Is Independence Day (Mexico)");
if ((month == 8) && (day== 1)&& (date > 0) && (date< 8)) document.write("Today Is Labor Day (USA)");
// October
if ((month == 9) && (date == 1)) document.write("Today Is German Reunufication (1990)");
if ((month == 9) && (date == 10)) document.write("Today Is Health-Sports Day (Japan)");
if ((month == 9) && (day == 1) && (date > 7) && (date< 16)) document.write("Today Is Columbus Day (USA)");
if ((month == 9) && (day == 0) && (date > 24) && (date< 31)) document.write("Daylight Savings Time Ends");
if ((month == 9) && (day == 0) && (date == 31)) document.write("Daylight Savings Time Ends<BR>");
if ((month == 9) && (date == 24)) document.write("Today Is United Nations Day");
if ((month == 9) && (date == 31)) document.write("Today Is Halloween! Happy Halloween!");
// November
if ((month == 10) && (date == 1)) document.write("Today Is All Saints Day");
if ((month == 10) && (date == 2)) document.write("Today Is All Souls Day");
if ((month == 10) && (date == 3)) document.write("Today Is Culture Day (Japan)");
if ((month == 10) && (date == 11)) document.write("Today Is Veteran's Day (USA), Remembrance Day (Canada)");
if ((month == 10) && (date ==20)) document.write("Today Is Revolution Day (Mexico)");
if ((month == 10) && (date == 23)) document.write("Today Is Labor Thanksgiving Day (Japan)");
if ((month == 10) && (day == 4) && (date > 23) && (date< 30)) document.write("Today Is Thanksgiving! (USA)");
if ((month == 10) && (date == 30) && (day == 4)) document.write("Today Is Thanksgiving! (USA)");
// December
if ((month == 11) && (date == 10)) document.write("Today Is Human Rights Day");
if ((month == 11) && (date == 21)) document.write("Today Begins Winter Solstice");
if ((month == 11) && (date == 24)) document.write("<b>Today Is Christmas Eve</b>");
if ((month == 11) && (date == 25)) document.write("<b>Today Is Christmas Day! Merry Christmas!</b>");
if ((month == 11) && (date == 26)) document.write("Today Is Boxing Day");
if ((month == 11) && (date == 31)) document.write("Today Is New Year's Eve");
document.write("<br></font>");
The most important thing about the above date script, is that it displays a statement like Today is Christmas on December 25th...Now, I want the random image script to work similar, except, I want the script to display an image instead of just a text statement, and I need it to display it 1 month prior to the actaul date and remove that image 1 day after. What I mean by removing it, is to not display any image. I want this to add banners to my homepage. I hope you understand what I am looking for.
For the other project, I was looking for someone to add an 'offline' payment form to my checkout page on my website. I have the form page already made, I just need it added so that it 'works' during checkout. It's not real-time, I just want the payment info to be included in the email that the shopping cart sends to me.
Thank you all!
Sorry for the long post.
-Brian