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.
Results 1 to 6 of 6
  1. #1
    New to the CF scene
    Join Date
    Jan 2014
    Posts
    3
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Want to automatically schedule image swap

    Hello,

    Don't know if this is the correct forum but I believe my question falls into the server side issues so here goes.

    I manage a simple web site and every month one of the images on the home page gets swapped out for another one that I have in the image folder of the web site. It takes me less than 5 minutes twice a month to go and change the image to the next one for the month, a total of 24 images per year.

    Seems to me I should be able to automate this. I've done some C programming in the past, have taught myself JavaScript, and basically everything I know about HTML (which admittedly isn't extensive) but what I'm saying is that I'm willing to learn some new language if that's what it takes. But I don't know where to start and what I should be learning.

    Any and all suggestions would welcome. Thanks much!

    Helene

  • #2
    Senior Coder alykins's Avatar
    Join Date
    Apr 2011
    Posts
    1,901
    Thanks
    46
    Thanked 202 Times in 201 Posts
    What is the backend of your site written in? ie is it classic asp? .aspx (vb.net? c#.net?)? .jsp (Java)? .php? etc. This would be a question for one of those forums.

    I code C hash-tag .Net
    Reference: W3C W3CWiki .Net Lib
    Validate: html CSS
    Debug: Chrome FireFox IE

  • #3
    New to the CF scene
    Join Date
    Jan 2014
    Posts
    3
    Thanks
    2
    Thanked 0 Times in 0 Posts
    Thanks for your reply.

    When I said "simple", I truly meant simple.! The entire site is just HTML with some javascript for mouseovers, etc. There's nothing else that is dynamic. Which is why I figured if I wanted to do something like I mentioned, I was going to have to learn some programming language that addresses databases (the 24 images) and understands dates (change the image on the 15th of the month), etc.

    Which of the languages you mentioned would serve me best do you think?

    Thanks again!

    Helene

  • #4
    Senior Coder alykins's Avatar
    Join Date
    Apr 2011
    Posts
    1,901
    Thanks
    46
    Thanked 202 Times in 201 Posts
    If you have all the images saved to the server where the site is hosted, then you can hard code in javascript to get the date and pick a certain picture pending what the date is. I would ask a moderator in the javascript forum to move this thread there. I don't do client side coding anymore, but the logic should be easy...
    Code:
    *pseudo code*
    DateTime myDate = DateTime.Now;
    switch(myDate)
    {
      case January:
           get january pic
           break;
      case etc....
    }
    Note: again that is nowhere near valid javascript code, someone there may be able to help you better than I.

    I code C hash-tag .Net
    Reference: W3C W3CWiki .Net Lib
    Validate: html CSS
    Debug: Chrome FireFox IE

  • Users who have thanked alykins for this post:

    hfj2003 (01-22-2014)

  • #5
    The fat guy next door VIPStephan's Avatar
    Join Date
    Jan 2006
    Location
    Halle (Saale), Germany
    Posts
    8,877
    Thanks
    6
    Thanked 1,035 Times in 1,008 Posts
    No, not JavaScript. JS can be disabled/circumvented and the whole thing is useless. After all, there is not much dynamic stuff in terms of changes in the DOM after the page has loaded, or without reloading, respectively. It’s just a static image that’s supposed to change twice every month, so use a server-side language for this. They all have simple date functions (that rely on the server’s time settings, of course) that can be used. PHP is the most popular language on the market.

  • Users who have thanked VIPStephan for this post:

    hfj2003 (01-22-2014)

  • #6
    New to the CF scene
    Join Date
    Jan 2014
    Posts
    3
    Thanks
    2
    Thanked 0 Times in 0 Posts
    thanks so much --- I appreciate this help!

    Now I guess I need to learn PHP

    Helene


  •  

    Tags for this Thread

    Posting Permissions

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