0
Welcome Guest! Login
0 items Join Now

Working on a Date "IF Statement"...

  • Working on a Date "IF Statement"...

    Posted 17 years 3 months ago
    • Ok, I know this is not a normal Rockettheme question, but I like you guys and get WAY more help here than in the Joomla Forums, AND I figure that this may be of interest to others down the line...

      I am interested in creating a content pages that show based on a date. In the case I am working on, I want the date to be the date a customer subscribes to my website. In other cases, it could be the registration date, for example.

      So, let's say I have content I want to serve up once per week...

      I would need to get the subscription date, and pass it to some code. That code would check the date, and show the content body or not.

      SO, here is my thought... Either it is code I can actually drop into (with JosReplace, for example) the content body (beginning and end), or actually create a mambot that could be used for MANY applications, with the insertion of the variable into the mambot and the insertion of the +number into the actual mambot when inserted.

      Either way, I cannot do it without help, but I AM willing to pay.

      I was thinking about this code as a base idea:
      <?php
      $d=date("D");
      $s= *not sure how I will pull sub date yet*
      if ($d>$s+7)
      &nbsp; echo "Story Body Goes Here"; 
      else
      &nbsp; echo "You are not subscribed"; 
      ?>

      Any thoughts?
    • --
      Heather M. Claus
      www.nookienotes.com/index.php <--- in development
  • Re: Working on a Date "IF Statement"...

    Posted 17 years 3 months ago
    • I'm not sure if this is the same thing or not, but I am also interested in something like this.

      Here is what I need to do:

      I am building a site for my wife's daycare. They basically have the same lunch menu from week to week. I would like a link on the main menu that says "Today's Menu". When that is pressed, you get the menu for Monday, Tuesday, etc.

      Can that be done?
  • Re: Working on a Date "IF Statement"...

    Posted 17 years 3 months ago
    • Yes, that is a similar application, although there is a piece of code that can do that directly. Hmmm. Do a search on Google for PHP if date code... I saw one that specifically worked with days of the week.

      If you can't find it, let me know - I'll try the search again.
    • --
      Heather M. Claus
      www.nookienotes.com/index.php <--- in development

Time to create page: 0.084 seconds