Go Back   CodingForums.com > :: Client side development > JavaScript programming

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rating: Thread Rating: 2 votes, 4.50 average.
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 03-07-2013, 02:22 AM   PM User | #16
jmrker
Senior Coder

 
jmrker's Avatar
 
Join Date: Aug 2006
Location: FL
Posts: 2,797
Thanks: 30
Thanked 462 Times in 456 Posts
jmrker will become famous soon enough
Lightbulb

Quote:
Originally Posted by Old Pedant View Post
Yes, jmrker, but your script depends on (a) the users' computer clocks being set correctly and (b) the users being in the same time zone as the server [though it's easy to adjust for the latter].

See how I pass the server time in, from PHP, and then use the discovered offset in all other calculations.
Yes, and if my battery dies, my watch is only right twice a day.
I, for one, do not worry about other's clock settings in JS.
I would rely on the server's clock, much like you have done, if it is that important.

I also left the logic available to adjust for MST using UTC and/or the gettimezone() function. I'm not in MST so I left that as an exercise for the student.
jmrker is offline   Reply With Quote
Old 03-12-2013, 06:05 PM   PM User | #17
djultra
New Coder

 
Join Date: Mar 2013
Posts: 62
Thanks: 0
Thanked 0 Times in 0 Posts
djultra is an unknown quantity at this point
Quote:
Originally Posted by jmrker View Post
Yes, and if my battery dies, my watch is only right twice a day.
I, for one, do not worry about other's clock settings in JS.
I would rely on the server's clock, much like you have done, if it is that important.

I also left the logic available to adjust for MST using UTC and/or the gettimezone() function. I'm not in MST so I left that as an exercise for the student.
hi again old pendent sent me a script so that my images would change?
now is there any way a radio stream could go in that script so that when our DJ'S come on air with there stream the image changes with the stream?
djultra is offline   Reply With Quote
Old 03-12-2013, 06:40 PM   PM User | #18
jmrker
Senior Coder

 
jmrker's Avatar
 
Join Date: Aug 2006
Location: FL
Posts: 2,797
Thanks: 30
Thanked 462 Times in 456 Posts
jmrker will become famous soon enough
Question

Quote:
Originally Posted by djultra View Post
hi again old pendent sent me a script so that my images would change?
now is there any way a radio stream could go in that script so that when our DJ'S come on air with there stream the image changes with the stream?

I'm not sure I understand the question in the first line.

Is the script you are using posted in an earlier part of this thread (which post)
or is it an entirely different portion of code?

What is in the radio stream that contains the name or ID of the DJ currently on air?
Where does the information come from to change the image display?

Do you have a link to the site to view? What does the code you are using look like?
jmrker is offline   Reply With Quote
Old 03-17-2013, 04:35 PM   PM User | #19
djultra
New Coder

 
Join Date: Mar 2013
Posts: 62
Thanks: 0
Thanked 0 Times in 0 Posts
djultra is an unknown quantity at this point
i dont have an ID for the DJ

but its a entirly new code

i dont have a link iver
djultra is offline   Reply With Quote
Old 03-17-2013, 06:08 PM   PM User | #20
jmrker
Senior Coder

 
jmrker's Avatar
 
Join Date: Aug 2006
Location: FL
Posts: 2,797
Thanks: 30
Thanked 462 Times in 456 Posts
jmrker will become famous soon enough
Exclamation

Quote:
Originally Posted by djultra View Post
i dont have an ID for the DJ

but its a entirly new code

i dont have a link iver
I'm not sure I can be of further help unless you come up with some answers for my previous post.

I don't care what the identity of the DJ is. Make-up something.
What is the "entirly new code"?
Without a link, how is the WWW supposed to see it?

With so many questions unanswered, I await additional information before proceeding with further suggestions.
jmrker is offline   Reply With Quote
Old 03-21-2013, 06:58 PM   PM User | #21
djultra
New Coder

 
Join Date: Mar 2013
Posts: 62
Thanks: 0
Thanked 0 Times in 0 Posts
djultra is an unknown quantity at this point
Quote:
Originally Posted by Old Pedant View Post
Yes, jmrker, but your script depends on (a) the users' computer clocks being set correctly and (b) the users being in the same time zone as the server [though it's easy to adjust for the latter].

See how I pass the server time in, from PHP, and then use the discovered offset in all other calculations.
hi there the script don't work that you gave me

i tried everything but i were think of using this script

http://www.destiny106.co.uk/djcenter/imgrotator.js
djultra is offline   Reply With Quote
Old 03-21-2013, 07:14 PM   PM User | #22
jmrker
Senior Coder

 
jmrker's Avatar
 
Join Date: Aug 2006
Location: FL
Posts: 2,797
Thanks: 30
Thanked 462 Times in 456 Posts
jmrker will become famous soon enough
Lightbulb

Quote:
Originally Posted by djultra View Post
hi there the script don't work that you gave me

i tried everything but i were think of using this script

http://www.destiny106.co.uk/djcenter/imgrotator.js
If you are calling this as an external file, get rid of any and all HTML code
including the <!-- and //--> tags.
jmrker is offline   Reply With Quote
Old 03-21-2013, 07:28 PM   PM User | #23
djultra
New Coder

 
Join Date: Mar 2013
Posts: 62
Thanks: 0
Thanked 0 Times in 0 Posts
djultra is an unknown quantity at this point
ok but will that code work
djultra is offline   Reply With Quote
Old 03-21-2013, 08:35 PM   PM User | #24
Old Pedant
Supreme Master coder!

 
Old Pedant's Avatar
 
Join Date: Feb 2009
Posts: 23,556
Thanks: 62
Thanked 4,055 Times in 4,024 Posts
Old Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to all
Depends on what you mean by "work".

Looking at the contents of picarr[ ] and then where you do the switch (picarr[pntr]), not a single one of your case values matches any of your picarr[x] values, so your switch will *always* end up getting to the default: and so thelink and endlink will always be just "".

Which means you could throw all this code away and just do
Code:
   thelink = endlink = "";
and get the same effect.

I won't even comment any more on the fact that you are using obsolete document.write code.
__________________
An optimist sees the glass as half full.
A pessimist sees the glass as half empty.
A realist drinks it no matter how much there is.
Old Pedant is offline   Reply With Quote
Old 03-21-2013, 10:30 PM   PM User | #25
djultra
New Coder

 
Join Date: Mar 2013
Posts: 62
Thanks: 0
Thanked 0 Times in 0 Posts
djultra is an unknown quantity at this point
Quote:
Originally Posted by Old Pedant View Post
Depends on what you mean by "work".

Looking at the contents of picarr[ ] and then where you do the switch (picarr[pntr]), not a single one of your case values matches any of your picarr[x] values, so your switch will *always* end up getting to the default: and so thelink and endlink will always be just "".

Which means you could throw all this code away and just do
Code:
   thelink = endlink = "";
and get the same effect.

I won't even comment any more on the fact that you are using obsolete document.write code.
well um isent there a image rotator that does work
as the one i got given doesnt work
djultra is offline   Reply With Quote
Old 03-21-2013, 10:34 PM   PM User | #26
Old Pedant
Supreme Master coder!

 
Old Pedant's Avatar
 
Join Date: Feb 2009
Posts: 23,556
Thanks: 62
Thanked 4,055 Times in 4,024 Posts
Old Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to all
Did you ever even try the code I gave you in my post #10?

I hate to say it, but I feel you are just taking code and throwing it against the wall and hoping that some of it will stick. Might do as well just showing random images at this point.
__________________
An optimist sees the glass as half full.
A pessimist sees the glass as half empty.
A realist drinks it no matter how much there is.
Old Pedant is offline   Reply With Quote
Old 03-21-2013, 10:51 PM   PM User | #27
djultra
New Coder

 
Join Date: Mar 2013
Posts: 62
Thanks: 0
Thanked 0 Times in 0 Posts
djultra is an unknown quantity at this point
Quote:
Originally Posted by Old Pedant View Post
Did you ever even try the code I gave you in my post #10?

I hate to say it, but I feel you are just taking code and throwing it against the wall and hoping that some of it will stick. Might do as well just showing random images at this point.
oh god no im throwing it against the wall mate lol god no it just dont work
for me
djultra is offline   Reply With Quote
Old 03-21-2013, 11:32 PM   PM User | #28
Old Pedant
Supreme Master coder!

 
Old Pedant's Avatar
 
Join Date: Feb 2009
Posts: 23,556
Thanks: 62
Thanked 4,055 Times in 4,024 Posts
Old Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to all
Well, I don't know where to go from here except to mostly start all over.

Let me ask you the SAME QUESTIONS I asked before:

Quote:
Let me make 100% sure I understand this:

djultra will be mondays 3pm till 6pm, GMT
dj Rabbit will be mondays 12pm till 4pm, GMT
dj john will be tuesdays 2pm till 7pm, GMT

then on weekends there will be a show together with djultra and dj rabbit
between 4pm and 6pm, GMT

At all other times the display will show autodj.
Notice carefully that I specified all times to be GMT.

Yes or no? If no, then make corrections.
__________________
An optimist sees the glass as half full.
A pessimist sees the glass as half empty.
A realist drinks it no matter how much there is.
Old Pedant is offline   Reply With Quote
Old 03-21-2013, 11:34 PM   PM User | #29
djultra
New Coder

 
Join Date: Mar 2013
Posts: 62
Thanks: 0
Thanked 0 Times in 0 Posts
djultra is an unknown quantity at this point
Quote:
Originally Posted by Old Pedant View Post
Well, I don't know where to go from here except to mostly start all over.

Let me ask you the SAME QUESTIONS I asked before:


Notice carefully that I specified all times to be GMT.

Yes or no? If no, then make corrections.
well were dj'ing 24/7 now so im going to do 12pm till 2pm
dj rabbit is 12pm till 12 midnight i do not know wat dj john is
djultra is offline   Reply With Quote
Old 03-21-2013, 11:37 PM   PM User | #30
Old Pedant
Supreme Master coder!

 
Old Pedant's Avatar
 
Join Date: Feb 2009
Posts: 23,556
Thanks: 62
Thanked 4,055 Times in 4,024 Posts
Old Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to all
While you are at it, create a file on your server named timetest.php.

Put just this code into it:
Code:
<html><body>
<script type="text/javascript">
<?php
      echo "var serverTime = new Date(" . date("Y,m,j,G,i,s") . ");";
?>
document.write( serverTime.toString() );
</script>
</body></html>
Run that page in your browser.
Copy/paste what it shows you to here.
__________________
An optimist sees the glass as half full.
A pessimist sees the glass as half empty.
A realist drinks it no matter how much there is.
Old Pedant is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 03:39 PM.


Advertisement
Log in to turn off these ads.