Welcome to the GoFuckYourself.com - Adult Webmaster Forum forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact us.

Post New Thread Reply

Register GFY Rules Calendar
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >
Discuss what's fucking going on, and which programs are best and worst. One-time "program" announcements from "established" webmasters are allowed.

 
Thread Tools
Old 12-01-2005, 12:45 AM   #1
latinasojourn
Confirmed User
 
Join Date: Oct 2003
Posts: 3,191
javascript guru, what's problem here?

hi, i'm trying to rework a script written to show a different URL each day---it was originally written for 366 days, but i've shortened it to 13 days as a test---but does not show anything on the page.

i know nothing of javascript---can anyone tell me what's wrong? thanks!

hahahahahahahahahahahahahahahahahahahahahahahahaha hahahahahahahahahahahahahahahahahahahahahahaha


<HTML>

<head>
<title>Link Day</title>
</head>
<body>
<table align="center" border="0" width="300" height="100" cellspacing="0" cellpadding="0">
<tr align="center" valign="top">
<td align="center" valign="top">
<script>
/*
Enter the 366 urls and names below you wish to go to for each day of the year. DO NOT use commas
in the name or the script will not work.
*/
var daylinks=new Array()
daylinks[1]="http://www.cnn.com,CNN"
daylinks[2]="http://www.abcnews.com,ABCNews"
daylinks[3]="http://www.cnet.com,ABC"
daylinks[4]="http://www.geocities.com,Geocities"
daylinks[5]="http://www.lycos.com,Lycos"
daylinks[6]="http://www.infoseek.com,Infoseek"
daylinks[7]="http://www.hotbot.com,Hotbot"
daylinks[8]="http://www.tripod.com,Tripod"
daylinks[9]="http://www.wsabstract.com,Website Abstraction"
daylinks[10]="http://www.wired.com,Wired"
daylinks[11]="http://www.hotwired.com,Hotwired.com"
daylinks[12]="http://www.requestcode.com,Request Code"
daylinks[13]="http://www.dynamicdrive.com,Dynamic Drive"
var numdays=0
var daysa=new Array(31,28,31,30,31,30,31,31,30,31,30,31)
var daysb=new Array(31,29,31,30,31,30,31,31,30,31,30,31) // for leap year
var tdate=new Date()
var tmonth=tdate.getMonth()
var tyear=tdate.getFullYear()
var tdays=tdate.getDate()
remain=tyear % 4
if(remain!=0) // if not leap year
{
for(x=0;x<tmonth;x++)
{
numdays=numdays+daysa[x]
}
}
else // if leap year
{
for(x=0;x<tmonth;x++)
{
numdays=numdays+daysb[x]
}
}
today=numdays+tdays
ranlink=daylinks[today].split(",") // separate the address and name
document.write("The featured link for today is: <a href='"+ranlink[0]+"' title='"+ranlink[1]+"' target='_new'>"+ranlink[1]+"</a>")
document.close()
</script>
</td>
</tr>
</table>
</body>
</html>
latinasojourn is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 12-01-2005, 01:00 AM   #2
Nikita Khrushchev
Registered User
 
Join Date: Oct 2005
Posts: 17
Cou cant just use a script for a year. So use 366 days, or dont use it.

Do you want a random link script?
__________________
SIG TOO BIG! Maximum 120x60 button and no more than 3 text lines of DEFAULT SIZE and COLOR. Unless your sig is for a GFY top banner sponsor, you may use a 624x80 instead of a 120x60. Let me repeat... A 120 x 60 button and no more that 3 lines of DEFAULT SIZE AND COLOR text.

Last edited by Nikita Khrushchev; 12-01-2005 at 01:01 AM..
Nikita Khrushchev is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 12-01-2005, 01:12 AM   #3
latinasojourn
Confirmed User
 
Join Date: Oct 2003
Posts: 3,191
Quote:
Originally Posted by Nikita Khrushchev
Cou cant just use a script for a year. So use 366 days, or dont use it.

Do you want a random link script?
no thanks, i've got random, i need something to hold a URL for 24hrs, and then change to next URL for 24hrs---not change at each refresh.

but i only want maybe 60 days.

the application is for a content rotation thing i'm doing in a member's area.
latinasojourn is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 12-01-2005, 01:31 AM   #4
J.P.
Confirmed User
 
Join Date: Jun 2004
Posts: 689
try replacing the line that says:

Code:
today=numdays+tdays
with:

Code:
today=(numdays + tdays) % daylinks.length
and start the daylinks array with offset 0, like this:

Code:
daylinks[0]="http://www.cnn.com,CNN"
daylinks[1]="http://www.abcnews.com,ABCNews"
daylinks[2]="http://www.cnet.com,ABC"
daylinks[3]="http://www.geocities.com,Geocities"
daylinks[4]="http://www.lycos.com,Lycos"
daylinks[5]="http://www.infoseek.com,Infoseek"
...
this should solve your problem...
__________________
Webmasters! Looking for new affiliate programs to promote?
Affiliate Program Search <-- Search for programs with FHGs, RSS feed, specific niche sponsors, ...
J.P. is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 12-01-2005, 01:45 AM   #5
latinasojourn
Confirmed User
 
Join Date: Oct 2003
Posts: 3,191
Quote:
Originally Posted by J.P.
try replacing the line that says:

Code:
today=numdays+tdays
with:

Code:
today=(numdays + tdays) % daylinks.length
and start the daylinks array with offset 0, like this:

Code:
daylinks[0]="http://www.cnn.com,CNN"
daylinks[1]="http://www.abcnews.com,ABCNews"
daylinks[2]="http://www.cnet.com,ABC"
daylinks[3]="http://www.geocities.com,Geocities"
daylinks[4]="http://www.lycos.com,Lycos"
daylinks[5]="http://www.infoseek.com,Infoseek"
...
this should solve your problem...


great, it does resolve, and does not change on refresh, and i hope it will change again tomorrow.

you are a king!

THANKS SO MUCH!!!!!!!!
latinasojourn is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 12-02-2005, 01:57 AM   #6
J.P.
Confirmed User
 
Join Date: Jun 2004
Posts: 689
I know I am
__________________
Webmasters! Looking for new affiliate programs to promote?
Affiliate Program Search <-- Search for programs with FHGs, RSS feed, specific niche sponsors, ...
J.P. is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Post New Thread Reply
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >

Bookmarks



Advertising inquiries - marketing at gfy dot com

Contact Admin - Advertise - GFY Rules - Top

©2000-, AI Media Network Inc



Powered by vBulletin
Copyright © 2000- Jelsoft Enterprises Limited.