Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Page 1 of 2 12 LastLast
Results 1 to 15 of 20
  1. #1
    New to the CF scene
    Join Date
    Mar 2011
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Automatically Changing Text Daily Code

    I work at a college radio station and our brand new website just went live, but we're having one particular issue...

    We have a set list of shows that air each day, and on the site we have a marquee tag on the homepage that scrolls through showing each show and its broadcast time. Right now we're stuck changing this schedule each day by hand, but it's tough considering we're all college students ourselves and sometimes our own schedules simply don't allow the time.

    Is there a code that would allow this kind of a daily update to happen automatically?

    The format for the schedule is such:
    4 - 5 pm // "Show 01"
    5 - 6 pm // "Show 02"
    6 - 8 pm // "Show 03"
    8 - 10 pm // "Show 04"
    10 - 12 am // "Show 05"

    Any help would be very much appreciated!

  • #2
    Regular Coder Krupski's Avatar
    Join Date
    Dec 2010
    Location
    United States of America
    Posts
    505
    Thanks
    39
    Thanked 47 Times in 46 Posts
    Quote Originally Posted by Champuro View Post
    Is there a code that would allow this kind of a daily update to happen automatically?

    The format for the schedule is such:
    4 - 5 pm // "Show 01"
    5 - 6 pm // "Show 02"
    6 - 8 pm // "Show 03"
    8 - 10 pm // "Show 04"
    10 - 12 am // "Show 05"

    Any help would be very much appreciated!
    Yes, it's easy to do... but I need to see the code you're working with. Is the text you want to change in a span or a div?

    Need to see code.
    "Anything that is complex is not useful and anything that is useful is simple. This has been my whole life's motto." -- Mikhail T. Kalashnikov

  • #3
    New to the CF scene
    Join Date
    Mar 2011
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts
    It's in a span. This is what I have - the text inside is the schedule and I have seven different schedules that need to rotate automatically with each day.

    Code:
    <br><br><img src="./images/today.jpg" alt= "" style= "float: right;">
    <p><marquee onMouseOver=this.stop() onMouseOut=this.start() scrollamount=1  
    direction=up width="100%" height=100><br><p><center>
    
    4 - 5 pm // <i>"Show 01"</i><br>
    5 - 6 pm // <i>"Show 02"</i><br>
    6 - 8 pm // <i>"Show 03"</i><br>
    8 - 10 pm // <i>"Show 04"</i><br>
    10 - 12 am // <i>"Show 05"</i><br>
    </span></marquee><br><br>

  • #4
    Regular Coder Krupski's Avatar
    Join Date
    Dec 2010
    Location
    United States of America
    Posts
    505
    Thanks
    39
    Thanked 47 Times in 46 Posts
    Quote Originally Posted by Champuro View Post
    It's in a span. This is what I have - the text inside is the schedule and I have seven different schedules that need to rotate automatically with each day.
    Well, your code is missing some parts, but I think I get what you're trying to do.

    Look at this code:

    (HTML)
    Code:
    <span id="line1"></span><br />
    <span id="line2"></span><br />
    (JS)
    Code:
        document.getElementById('line1').innerHTML = 'I am line 1';
        document.getElementById('line2').innerHTML = 'I am line 2';

    See what that does? Does this give you the idea how to solve your problem?
    "Anything that is complex is not useful and anything that is useful is simple. This has been my whole life's motto." -- Mikhail T. Kalashnikov

  • #5
    New to the CF scene
    Join Date
    Mar 2011
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Haha, no - sorry. I'm an art student, not a programmer, so I really am only relatively well versed in basics.

    I'm not sure if you understand what I'm trying to do, though - I don't think I explained myself very well. I have a small block of text that's the schedule for our station, but the schedule changes each day since we have different shows running each day, so I'm trying to have that schedule automatically change itself each day rather than having to do it by hand.

  • #6
    Senior Coder jmrker's Avatar
    Join Date
    Aug 2006
    Location
    FL
    Posts
    3,026
    Thanks
    36
    Thanked 494 Times in 488 Posts

    Lightbulb Here's something to try ...

    Here's my guess at your requirements. Not very clear yet.
    Code:
    <html>
    <head>
    <title> Radio Schedule </title>
    <style type="text/css">
    .Schedule { 
      height:150px; width:300px;
      border:1px solid black;
      display:none;
    }
    #Sun { background-color: yellow; }
    #Mon { background-color: yellow; }
    #Tue { background-color: yellow; }
    #Wed { background-color: yellow; }
    #Thu { background-color: yellow; }
    #Fri { background-color: yellow; }
    #Sat { background-color: yellow; }
    </style>
    
    <script type="text/javascript">
    var scheduleDays = ['Sun','Mon','Tue','Wed','Thu','Fri','Sat'];
    onload = function() {
      var today = new Date();
      var DOW = today.getDay();
      document.getElementById(scheduleDays[DOW]).style.display = 'block';
    }
    </script>
    
    </head>
    <body>
    
    <h1>Radio Station Schedule</h1>
    <div class="Schedule" id="Sun">
    Sunday's Schedule<br>
    4 - 5 pm // <i>"Show 01"</i><br>
    5 - 6 pm // <i>"Show 02"</i><br>
    6 - 8 pm // <i>"Show 03"</i><br>
    8 - 10 pm // <i>"Show 04"</i><br>
    10 - 12 am // <i>"Show 05"</i><br>
    </div>
    
    <div class="Schedule" id="Mon">
    Monday's Schedule<br>
    4 - 5 pm // <i>"Show 01"</i><br>
    5 - 6 pm // <i>"Show 02"</i><br>
    6 - 8 pm // <i>"Show 03"</i><br>
    8 - 10 pm // <i>"Show 04"</i><br>
    10 - 12 am // <i>"Show 05"</i><br>
    </div>
    
    <div class="Schedule" id="Tue">
    Tuesday's Schedule<br>
    4 - 5 pm // <i>"Show 01"</i><br>
    5 - 6 pm // <i>"Show 02"</i><br>
    6 - 8 pm // <i>"Show 03"</i><br>
    8 - 10 pm // <i>"Show 04"</i><br>
    10 - 12 am // <i>"Show 05"</i><br>
    </div>
    
    <div class="Schedule" id="Wed">
    Wednesday's Schedule<br>
    4 - 5 pm // <i>"Show 01"</i><br>
    5 - 6 pm // <i>"Show 02"</i><br>
    6 - 8 pm // <i>"Show 03"</i><br>
    8 - 10 pm // <i>"Show 04"</i><br>
    10 - 12 am // <i>"Show 05"</i><br>
    </div>
    
    <div class="Schedule" id="Thu">
    Thursday's Schedule<br>
    4 - 5 pm // <i>"Show 01"</i><br>
    5 - 6 pm // <i>"Show 02"</i><br>
    6 - 8 pm // <i>"Show 03"</i><br>
    8 - 10 pm // <i>"Show 04"</i><br>
    10 - 12 am // <i>"Show 05"</i><br>
    </div>
    
    <div class="Schedule" id="Fri">
    Friday's Schedule<br>
    4 - 5 pm // <i>"Show 01"</i><br>
    5 - 6 pm // <i>"Show 02"</i><br>
    6 - 8 pm // <i>"Show 03"</i><br>
    8 - 10 pm // <i>"Show 04"</i><br>
    10 - 12 am // <i>"Show 05"</i><br>
    </div>
    
    <div class="Schedule" id="Sat">
    Saturday's Schedule<br>
    4 - 5 pm // <i>"Show 01"</i><br>
    5 - 6 pm // <i>"Show 02"</i><br>
    6 - 8 pm // <i>"Show 03"</i><br>
    8 - 10 pm // <i>"Show 04"</i><br>
    10 - 12 am // <i>"Show 05"</i><br>
    </div>
    
    </body>
    </html>
    You can change the colors for each display if you wish. I'll leave that to the artist in you!

    I did not put in the marquee as it is only a MSIE tag. Won't work in any other browers.

  • #7
    New to the CF scene
    Join Date
    Mar 2011
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts
    jmrker - that worked perfectly! Thank you SO much for all of your help~!

  • #8
    Senior Coder jmrker's Avatar
    Join Date
    Aug 2006
    Location
    FL
    Posts
    3,026
    Thanks
    36
    Thanked 494 Times in 488 Posts
    You're most welcome.
    Happy to help.
    Good Luck!

  • #9
    New to the CF scene
    Join Date
    Jan 2012
    Location
    Northern Virginia
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Changing Daily Quote in Email Signature

    I am very new and have no idea about where to begin, other than to say that I want to be able to have a daily quote in the last line of my signature to my gmail account. I would appreciate any information regarding the feasibility of having the quote automatically change to a new one each day.

  • #10
    Senior Coder jmrker's Avatar
    Join Date
    Aug 2006
    Location
    FL
    Posts
    3,026
    Thanks
    36
    Thanked 494 Times in 488 Posts

    Lightbulb

    I don't believe the gmail account is controlled by javascript, but I've really never looked into this.

    One suggestion would be to have a simple script that writes to a text box that could then
    be copied and pasted into the last section of your email when you wish to post it.
    That small program could be created from the earlier posts of this thread.

  • #11
    New to the CF scene
    Join Date
    Jan 2012
    Location
    Northern Virginia
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by jmrker View Post
    I don't believe the gmail account is controlled by javascript, but I've really never looked into this.

    One suggestion would be to have a simple script that writes to a text box that could then
    be copied and pasted into the last section of your email when you wish to post it.
    That small program could be created from the earlier posts of this thread.
    Thank you, very much, for your prompt response. I shall give it a try.

  • #12
    Master Coder felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, Australia
    Posts
    6,471
    Thanks
    0
    Thanked 634 Times in 624 Posts
    Quote Originally Posted by Champuro View Post
    Code:
    <marquee onMouseOver=this.stop() onMouseOut=this.start() scrollamount=1  
    direction=up width="100%" height=100></marquee><br><br>
    You do realise that the marquee tag is proprietary and that it will NOT cause the text to scroll in most browsers.

    You should be using a JavaScript marquee script if you want the text to scroll in all browsers and not just for a small percentage of visitors.
    Stephen
    Learn Modern JavaScript - http://javascriptexample.net/
    Helping others to solve their computer problem at http://www.felgall.com/

    Don't forget to start your JavaScript code with "use strict"; which makes it easier to find errors in your code.

  • #13
    New to the CF scene
    Join Date
    Apr 2012
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    thank you

    thank you jmrker for your code for auto switching the text!! .. It saved me. I'm just wondering if there's a way to modify it so that it switches a few hours after 12 am? If you could help me with this I would greatly appreciate it! Thank you again.

  • #14
    Senior Coder jmrker's Avatar
    Join Date
    Aug 2006
    Location
    FL
    Posts
    3,026
    Thanks
    36
    Thanked 494 Times in 488 Posts

    Exclamation

    Quote Originally Posted by mackm View Post
    thank you jmrker for your code for auto switching the text!! .. It saved me. I'm just wondering if there's a way to modify it so that it switches a few hours after 12 am? If you could help me with this I would greatly appreciate it! Thank you again.
    You're most welcome. Happy to help.

    But ... Switches to what? Also, how many is a few hours? 2, 3, 6 or more?
    Need more specific requirements.

  • #15
    New to the CF scene
    Join Date
    Apr 2012
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by jmrker View Post
    You're most welcome. Happy to help.

    But ... Switches to what? Also, how many is a few hours? 2, 3, 6 or more?
    Need more specific requirements.
    Well I set up a few tables on a daily schedule like the example you gave, so that a new table appears every day. The tables actually consist of drink specials and since most pubs and bars run well into the morning of the next day, I would like to have the specials switch at 6 am, rather than 12 am. (6 hours)

    Thank you for all your help!


  •  
    Page 1 of 2 12 LastLast

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •