Results 1 to 5 of 5

Thread: iframe change source everyday (365 days)?

  1. #1
    Join Date
    May 2014
    Posts
    4
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Question iframe change source everyday (365 days)?

    So, basically, I am making a custom "Bible in a Year" type deal for my church website. I found this script to change everyday of the month, http://www.dynamicdrive.com/dynamici...dowiframe2.htm, but I need the whole year. If this is possible in php include, I can live with that too, or maybe you have an easier way I can accomplish this painstaking task.
    Last edited by tc2010; 05-12-2014 at 02:10 AM.

  2. #2
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    The painstaking part is transcribing/organizing the verses. PHP would be easy to use to display one each day for a year. So would javascript, but you will be more accessible using PHP, and of the two, it's a little easier for what you're talking about:


    PHP Code:
    <?php
    $doy 
    date('z');
    while (
    strlen($doy) < 3){
        
    $doy '0' $doy;
    }
    include 
    'verse' $doy '.txt';
    ?>
    This will grab from the current folder, verse000.txt through verse365.txt (verse365.txt will only be displayed on Dec 31st of leap years), depending upon which day of the year it is. Today it would be verse129.txt (May 10th).

    So, as I say, the painstaking part is transcribing and organizing all those files.

    Good luck!

    Let me know if you have any questions.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  3. The Following User Says Thank You to jscheuer1 For This Useful Post:

    tc2010 (05-11-2014)

  4. #3
    Join Date
    May 2014
    Posts
    4
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default

    That sounds like a good approach, my only concern is styling. I was wanting to do some HTML styling (bold text, backgrounds, etc.), will this be possible using .txt?

  5. #4
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    There are lots of ways that could be done. You can use .htm or .html, which is what I would recommend. (You can just use .txt and have tags on there, but it's confusing.) That along with fairly consistent markup within the included files so that one stylesheet could be used to style whichever one of them happens to be up that day:

    PHP Code:
    <div id="verse">
    <?php 
    $doy 
    date('z'); 
    while (
    strlen($doy) < 3){ 
        
    $doy '0' $doy

    include 
    'verse' $doy '.htm'
    ?>
    </div>
    Then you could use just headers, spans, ps and divs on the external files and have rules, for example:

    Code:
    #verse h2 {color: blue;}
    on or linked to the main page. When a file is included, it's markup will follow those rules.

    When including htm, do not put DOCTYPE, head, body on the external file. Those can be used only once and should already be on the page that is including these other pages.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  6. #5
    Join Date
    May 2014
    Posts
    4
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default

    Perfect! Just tried it, and it seems to do exactly what I want! Thanks for all the help!!

Similar Threads

  1. Change a table cell's colour for 7 days
    By moose86 in forum JavaScript
    Replies: 8
    Last Post: 08-06-2013, 02:33 AM
  2. Daily iframe content II not enough days
    By nuncio2 in forum Dynamic Drive scripts help
    Replies: 5
    Last Post: 06-13-2013, 04:28 AM
  3. Change days to session?
    By thaidatelink in forum Dynamic Drive scripts help
    Replies: 1
    Last Post: 08-21-2009, 06:30 AM
  4. Getting hacks everyday
    By allahverdi in forum JavaScript
    Replies: 6
    Last Post: 06-20-2008, 12:10 AM
  5. dynamically change image source
    By rizlaa in forum JavaScript
    Replies: 4
    Last Post: 10-04-2006, 09:20 AM

Bookmarks

Posting Permissions

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