Announcement

Collapse
No announcement yet.

Date variable

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Date variable

    Is there a date variable that can be used inside a blockif, to either show or hide content based upon a date range?

    I have seen php versions but would be better to keep within Sellerdeck if possible.

    just trying to get a redesign site to be more automated.

    Many thanks

    Jason
    Regards

    Jason

    Titan Jewellery (Swift Design)
    Zirconium Rings
    Damascus Steel Rings

    #2
    to either show or hide content based upon a date range
    There's a big difference between displaying content on the live site that changes depending on the day the page is being viewed and content that changes depending on the date that you're updating the site.

    Best explain in detail what you actually want to do.
    Norman - www.drillpine.biz
    Edinburgh, U K / Bitez, Turkey

    Comment


      #3
      Hi Norman,

      The live site isn't an issue just needs to be generated at upload. We upload every day so would always be current.

      For instance to change some of the graphics on the site to themed graphics for Valentines, mothers day etc based upon a date range.

      example

      standard image1.jpg

      1- 14 Feb valentines.jpg

      1 - 25 Dec Xmas.jpg

      Etc

      I know these can all easily be done with Sellerdeck just changing images, however I have more plans if this is indeed possible.

      Kind regards

      Jason
      Regards

      Jason

      Titan Jewellery (Swift Design)
      Zirconium Rings
      Damascus Steel Rings

      Comment


        #4
        PHP will be needed. Something like:
        Code:
        <actinic:block php="true">
        $dinf = array(
        	array(02, 01, 'valentine.jpg'),	// mm, dd, image
        	array(02, 14, ''),
        	array(04, 01, 'easter.jpg'),
        	array(04, 15, ''),
        	array(12, 01, 'christmas.jpg'),
        	array(12, 25, '')
        	);
        $imagetouse = '';
        $ranges = count($dinf);
        $thisday = date('j');
        $thismonth = date('n');
        for ($i=0; $i<$ranges; $i++)
        	{
        	list ($listmonth, $listday, $listimage) = $dinf[$i];
        	if ($listmonth <= $thismonth && $listday <= $thisday) $imagetouse = $listimage;
        	}
        if ( $imagetouse == '' ) $imagetouse = 'defaultimage.jpg';
        echo "<img src=\"$imagetouse\" />";
        </actinic:block>
        Norman - www.drillpine.biz
        Edinburgh, U K / Bitez, Turkey

        Comment


          #5
          Wow,

          Many thanks Norman will have a play.

          Will be in touch soon about some of your offerings.

          Kind regards

          Jason
          Regards

          Jason

          Titan Jewellery (Swift Design)
          Zirconium Rings
          Damascus Steel Rings

          Comment

          Working...
          X