Results 1 to 8 of 8

Thread: Daily iframe content II

  1. #1
    Join Date
    Jun 2005
    Posts
    13
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Daily iframe content II

    I am looking for a script similar to the Daily Iframe content II script. But the difference would be that it can work with Months of the Year instead of Days Of the Month.

    So, instead of having 31 days...Just have 12 Months. So that A Page Or Just an image can be rotated for each month of the year.

    Ex:

    ( Each month has it's own image / page..This would be great!! )

    Code:
    January 
    Febuary
    March
    April
    May
    June
    July
    August
    September
    October
    November
    December
    -Brian

  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

    Code:
    <script type="text/javascript">
    
    /***********************************************
    * Monthly iframe content II-  Dynamic Drive DHTML code library (www.dynamicdrive.com)
    * This notice MUST stay intact for legal use. Modified for Months by jscheuer1
    * Visit Dynamic Drive at http://www.dynamicdrive.com/ for full source code
    ***********************************************/
    
    var ie=document.all
    var dom=document.getElementById
    
    //Specify IFRAME display attributes
    var iframeprops='width=150 height=150 marginwidth="0" marginheight="0" hspace="0" vspace="0" frameborder="1" scrolling="no"'
    
    //Specify 12 URLs to display inside iframe, one for each month of the year
    var mnthcontent=new Array()
    mnthcontent[1]="1.htm"
    mnthcontent[2]="2.htm"
    mnthcontent[3]="3.htm"
    mnthcontent[4]="4.htm"
    mnthcontent[5]="5.htm"
    mnthcontent[6]="6.htm"
    mnthcontent[7]="7.htm"
    mnthcontent[8]="8.htm"
    mnthcontent[9]="9.htm"
    mnthcontent[10]="10.htm"
    mnthcontent[11]="11.htm"
    mnthcontent[12]="12.htm"
    
    
    //No need to edit after here
    if (ie||dom)
    document.write('<iframe id="dynstuff" src="" '+iframeprops+'></iframe>')
    
    var mydate=new Date()
    var myMonth=mydate.getMonth()
    
    function monthofyear_iframe(){
    if (ie||dom){
    var iframeobj=document.getElementById? document.getElementById("dynstuff") : document.all.dynstuff
    iframeobj.src=mnthcontent[myMonth+1]
    }
    }
    
    window.onload=monthofyear_iframe
    
    </script>
    - John
    ________________________

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

  3. #3
    Join Date
    Jan 2008
    Posts
    16
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Default

    ok, I have to admit, this script is exactly what I was looking for, but I do have on small request, and hopefully someone will see this and get back to me shortly. I am using this script to display a monthly calendar that shows the current months activities when you go to that page, but is there any way for me to put a set of links under the calendar to switch to a previous month, next month and back to the current month?

    Thanks, just wondering.

  4. #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

    Quote Originally Posted by sdzeltwanger View Post
    ok, I have to admit, this script is exactly what I was looking for, but I do have on small request, and hopefully someone will see this and get back to me shortly. I am using this script to display a monthly calendar that shows the current months activities when you go to that page, but is there any way for me to put a set of links under the calendar to switch to a previous month, next month and back to the current month?

    Thanks, just wondering.
    The way iframes work, it's like a small window in your page. I don't know what sort of calendar you are using. But if it already has links on it, those should work in the iframe. Otherwise, if you have the pages, each with a month on them, you could just make up links on those pages that would show in the iframe. Links in an iframe will load in that iframe.
    - John
    ________________________

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

  5. #5
    Join Date
    Jan 2008
    Posts
    16
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Default

    ok, here's my page.
    http://studentorgs.morris.umn.edu/parentpack/events.php

    the calendars and the words "Previous Month" "Current Month" and "Next Month" are all in external files in the folder events/2008/

    I understand what you were saying about the links in the iframe working in the iframe, but that helps and raises further questions.

    I guess what I was trying to ask previously is if there is a script that I can use on the links that will change the month so that I don't have to edit the links every month?

    The problem I have now is that I want to include clickable links in the calendar, but I don't want them to load in the iframe, is that possible, without having to have them load in a new window/tab?

  6. #6
    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

    You don't need to worry about that. You have 12 months, right? At the bottom of the October page, I see you have:

    Code:
    Previous Month          Current Month           Next Month
    You don't need Current Month, it's already showing. The Next Month could be linked to:

    november.htm

    Previous Month to:

    september.htm

    These links would never have to change, similar ones (with the appropriate month's files as their href) could be links on each month's page. Then all you would need to do is to make your iframe tall enough, so that the links could be seen.
    - John
    ________________________

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

  7. #7
    Join Date
    Jan 2008
    Posts
    16
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Default

    What I wanted to accomplish with the current month link was a one-click way back to the current month if I navigate forward or backwards a couple months. and the previous and next month links using a script of some sort would be easier for the site so that future web-admins will not have to worry about editing anything but the calendar contents each month. I also need the ability to switch years, so if I click on next month in December it will go to the January 2009 page.

    And I am still trying to figure out how to open links inside the iframe outside the iframe.

  8. #8
    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

    Since I see you have PHP, you would probably be better off with something like:

    http://www.k5n.us/webcalendar.php

    You can also Google for other PHP based event calendars:

    http://www.google.com/search?hl=en&q...oq=PHP+event+c

    However, to answer your questions. In HTML, you can target a link to an iframe or frame by its name. In javascript, one may use its number or name, or id (the syntax with id is different than with number or name).

    A fairly simple function could determine current month based on the Date Object, and next and previous based upon the name of the page currently displayed. This function could be used to fetch next, previous or current month pages, as long as they were named with both month and year according some consistent convention.

    But, you would run out of calendar pages if the user went too far forward or back. With a PHP calendar script, there would always be a calendar available. And it could even show recurring events (if any) as far into the future as anyone would care to look. And PHP would make the calendar, all that would need to be edited would be the events.
    - John
    ________________________

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

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
  •