Log in

View Full Version : new image every hour...



queerfm
05-26-2006, 04:02 AM
Hi i have been looking for this type of script for my new site how every i can seem to see one can anyone help?

The script i want calls on a new image every hour how ever it depends on what time it is in Perth Australia witch is +8hours.

i was thinking that there would be many ways to do this wether it finds a new html page on that hour.

Also This is for a radio station website which is getting a BIG face lift.
So any suggestions on how to get this work would be GREAT.

Also i am looking for a script that will let people request songs we have over 700 songs was thinking of making one big form which i know i have to do but is there any easyer way to do this?

One last question.

Is there a way that i can dissplay RSS feeds with out the bullett holes nect to the item?

this would be cool as i could have a ticker that showed the latest in music news.

P.S. the site is being designed in CSS and html this is my first site in CSS so iam really looking forward to seeing what people think.

I am trying to make a site that looks like many pages but only has one page so far i have looked at scripts like yahoo.com.au search area and MSN. I love there new Australian Site looks like windows media player skin.

msn.com.au

Also one last last thing.

- Is there anyway to do what yahoo.com.au does with users name for e.g. i have a phpbb forum and i would like it that when they came to the site it said good morning Russell or if not signed in it says Good Morning (IP ADDRESS) or (Guest)


Sorry for all the questions but makes it easyer then posting like 4 different post and they are all for the same site.

Please feel free to email me at queerfm.com.au

benslayton
05-26-2006, 04:06 AM
for the requesting a song Try these people...
http://express.perseus.com/perseus/asp/login.aspx

you can edit the source code and still have it sent properly. It's what I did.:D

benslayton
05-26-2006, 04:22 AM
Ok, see this http://www.dynamicdrive.com/dynamicindex17/dowiframe.htm I don't know if this will work, but you might be able to change:
daycontent[1]="monday.htm" //Monday content
daycontent[2]="tuesday.htm" //Tuesday content
daycontent[3]="wednesday.htm"
daycontent[4]="thursday.htm"
daycontent[5]="friday.htm"
daycontent[6]="saturday.htm"
daycontent[0]="sunday.htm"

to something for every hour. And how many hours/pics?

Twey
05-26-2006, 11:56 AM
<img id="hrimg" src="img0.jpg">
<script type="text/javascript">
document.getElementById("hrimg").src = "img" + (new Date()).getHours() + ".jpg";
</script>That will work unless you want it to use a specific image each hour, rather than just a different one. In that case, you will need to use server-side scripting.

queerfm
05-26-2006, 04:22 PM
Thanks for all the help so far.

Now where do i start well maby with the form for the songs, Thanks for the IDEA i am looking at it right now.

And the pic code.
I need it for every hour an image for e.g. I have a lunch time show at 12pm Western Australia time +8hours

so i need a pic of me to come up.

Thanks for every ones help sp far

benslayton
05-26-2006, 04:29 PM
If i'm not mistaken. Dont the form place give you free unlimited results???

queerfm
05-26-2006, 04:39 PM
i don't know, i have just been givin a list of songs over 800 of them how this is going to be interesting i have to get this done with in 2 weeks what the!!!!

Please if any one can help me that would be GREAT.

I just was thinking i a think i have an idea of how to get the image to work with the time in some ones country let me explain my idea is what ill need help with as i want the images to be in a css form so i don't have to edit the html pages so much.

so lets say its bettween
8am and 9 am it shows image(a)
then
9am - 10am it shows image(b)
10am - 11am it shows image(c)


and so on till we get the full 24 hours.

then all i ave to do is find away to get them to chose the country that they are in so they get the right site and images. However i was thinking about doing this by time zone so it would be easyer.

e.g. yahoo.com.au has something like this can any one help with it.

you choise what state you are in and it takes you to a webpage for that state can we do this the same way like a drop down menu?

Thanks

benslayton
05-26-2006, 04:44 PM
If you can find a script. Just make an enter page asking for the country/timezone then that link that has the script will take them to the right one.

Twey
05-26-2006, 05:05 PM
I need it for every hour an image for e.g. I have a lunch time show at 12pm Western Australia time +8hours

so i need a pic of me to come up.Yeah, I was worried about that. You'll need to use some form of server-side scripting to get the server's current time.

queerfm
05-27-2006, 06:13 AM
could i use something like this

<SCRIPT LANGUAGE = 'JavaScript'><!--
var date = new Date();
var hours = date.getHours();
if ( (hours < 6) || (hours > 18) )
document.write("<IMG SRC='moon.gif'>")
else
document.write("<IMG SRC='sun.gif'>");
//--></SCRIPT>

however i need some help.

how do i get this script to show more images like ever hour, i have worked out how ill fix the time zones, so that fine. just need this script to show more images one image for every hour.

Thanks

Twey
05-27-2006, 10:04 AM
Yes, that will work, you can just add more <img> tags into the document.write() calls.
The type attribute is required, and the language attribute is deprecated for <script>, and <img> should have an alt.
<script type="text/javascript">
var hours = (new Date()).getHours();
if ( (hours < 6) || (hours > 18) )
document.write('<img src="moon.gif" alt="The Moon">');
else
document.write('<img src="sun.gif" alt="The Sun">');
</script>

tech_support
05-27-2006, 10:20 AM
or...


<script type="text/javascript">
var imgsrc1 = "thisimg1.gif"
var imgsrc2 = "thisimg2.gif"
var hours = (new Date()).getHours();
if ( (hours < 6) || (hours > 18) )
document.getelementbyID("image1").src = imgsrc1
else
document.getelementbyID("image1").src = imgsrc2
</script>
<img border="0" src="thisimg.gif" id="image1">

Twey
05-27-2006, 11:18 AM
Yes, that is usually a better idea, since it will cater for non-JS browsers too, and I suggested it originally. The problem is that there will be multiple images, possibly an inconsistent number, which is impossible to code for using the above method whilst maintaining support for non-JS browsers without using a server-side language.

getElementById() is case-sensitive in most browsers. :)

queerfm
05-27-2006, 05:22 PM
ok well now this is the part i am having problems wit now, i have copyed the code:

<script type="text/javascript">
var imgsrc1 = "thisimg1.gif"
var imgsrc2 = "thisimg2.gif"
var hours = (new Date()).getHours();
if ( (hours < 6) || (hours > 18) )
document.getelementbyID("image1").src = imgsrc1
else
document.getelementbyID("image1").src = imgsrc2
</script>
<img border="0" src="thisimg.gif" id="image1">


into my website how ever how do i make it get a different image each hour i get the <6 ||>18 meaning less then 6 hours and more then 18 hours but how do i make it like this

image1 - for 1am
image2 - for 2am
image3 - for 3am
and so on
right down till
image 24 - 12pm


Sorry but i need help

Twey
05-27-2006, 06:20 PM
I take it, then, that you don't want multiple images per hour after all, and my original, more efficient code can be used instead.

<img id="hrimg" src="img0.jpg">
<script type="text/javascript">
document.getElementById("hrimg").src = "img" + (new Date()).getHours() + ".jpg";
</script>will work fine, then. You will want images named img0.jpg through img23.jpg, twenty-four in total, for each hour, where hour 0 is midnight to 0100.

queerfm
06-02-2006, 11:56 AM
hi guys need some help with that last script. there are 7days in the week right how do i get it to show the right day automaticlly as half of the world is monday the other half is sunday.

Is there a script i can use to make this work please help.

queerfm
06-02-2006, 12:13 PM
also could some one make a drop down box that goes from -12 to +12 like this
-12,-11,-10,-9,-8,-7,-6,-5,-4,-3,-2,-1,0,+1,+2,+3,+4,+5,+6,+7,+8,+9,+10,+11,+12

and they mus all have a web folder e.g.
-12 = http://www.queerfm.net/m12/
-11 = http://www.queerfm.net/m11/
right till
+11 = http://www/queerfm.net/p11/
+12 = http://www.queerfm.net/p12/

I have downloaded demos but they don't work please help...

Twey
06-02-2006, 01:21 PM
The best thing to do here is to echo a server-side time value into the script, then make decisions based on that. Do you have any server-side languages?

queerfm
06-02-2006, 01:37 PM
well now lets see you can have a look at the new website i am working on http://www.queerfm.net/1.html

also you will see it tell you the time on your computer and then the perth time

if thats what you mean then yes that sever side i think

other then that i have no idea i will ask if you would like me to

queerfm
06-02-2006, 01:41 PM
Sorry this is the code i have on my webiste for the viewer time and perth time

in the header i have this

<SCRIPT LANGUAGE="JavaScript">
<!-- Begin
function GetTime() {
var dt = new Date();
var def = dt.getTimezoneOffset()/60;
var gmt = (dt.getHours() + def);
document.clock.local.value = (IfZero(dt.getHours()) + ":" + IfZero(dt.getMinutes()) + ":" + IfZero(dt.getSeconds()));
var ending = ":" + IfZero(dt.getMinutes()) + ":" + IfZero(dt.getSeconds());

var ho =check24(((gmt + 8) > 24) ? ((gmt + 8) - 24) : (gmt + 8));
document.clock.ho.value = (IfZero(ho) + ending);

setTimeout("GetTime()", 1000);
}
function IfZero(num) {
return ((num <= 9) ? ("0" + num) : num);
}
function check24(hour) {
return (hour >= 24) ? hour - 24 : hour;
}
// End -->
</script>

In body i have this




<body onLoad="javascript:GetTime();">

<form name="clock">
<p align="center"><strong>Your Time <input type="text" size="8" name="local">
</strong><span style="background-color: #FFFF00">Perth (GMT +8) </span>
<font color="#FF9933">
<input size="8" name="ho" style="background-color: #FFFF00"></font></p>
</form>

I hope that helps

queerfm
06-04-2006, 05:03 AM
can any one help???