Announcement

Collapse
No announcement yet.

Date uploaded variable

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

    Date uploaded variable

    I would like to include a "Site updated dd-mmm-yyyy" variable on my index page, so the current date is included each time the site is uploaded. This would automatically generate a new index.html file
    Is there a standard variable I could use for this?

    #2
    There's no Actinic variable for a 'Last Uploaded' date stamp. Tracey has passed me this code for doing the current date and time on a site. If you know JavaScript you could adapt it to show the date when the file was last changed.

    Code:
    <SCRIPT LANGUAGE = "JavaScript">
          
          var dayarray = new Array("Sunday<BR>", "Monday<BR>", "Tuesday<BR>", "Wednesday<BR>", "Thursday<BR>", "Friday<BR>", "Saturday<BR>");
          var montharray = new Array("January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December");
          
          var now = new Date();
          var myyear = now.getYear();
          var mymonth = now.getMonth();
          var myday = now.getDay();
          var mydate = now.getDate();
          var myhour = now.getHours()
          var myminute = now.getMinutes()
          
          if (myyear < 1000){myyear += 1900};
          if (myhour>=12){mymidday="pm" } else {mymidday="am"}
          if (myhour>12){myhour = myhour -12 }
          if (myhour==0){myhour = 12 }
          if (myhour<10){myhour="0"+myhour }
          if (myminute<10){myminute="0"+myminute }
          
          var timetext = dayarray[myday];
          timetext += " " + montharray[mymonth];
          timetext += " " + mydate;
          document.write(timetext);
          </SCRIPT>
    Of course, if you don't know JavaScript then you will just have to wait and see if anyone else helps out here.

    Comment


      #3
      Thanks Chris
      My scripting experience is limited.......

      I'm not sure I explained my request clearly. What I would like to do is to have the index file display the date of the upload, without (me remembering to) changing the file manually.

      I hoped that I could use a variable in the home page fragments, so each upload would trigger a regeneration of the index.html. This would write the current time into the page code.

      Stephen

      Comment


        #4
        Here's a way. It takes us back to the good old days of DOS as it uses a batch file and 2 DOS commands. They're all still there, even in XP though. Basically you ctart Actinic from a desktop shortcut that first runs the date and time DOS commands, redirecting their output to tiny textfiles. You then use CUSTOMVARs in Actinic to display the contents of these files:-

        Getting an upload date onto product page.

        Make a file called runact.bat (in Site1) from the following 3 lines.


        date /T > date.txt
        time /T > time.txt
        "C:\Program Files\Actinic Ecommerce v6\Catalog.exe"


        In Actinic / Advanced / Custom Properties create a customvar called THEDATE
        create another customvar called THETIME

        In Design / Options / Site Defaults / Properties click the "+" sign and Select THEDATE
        Set its Value to date.txt
        Check File Name and Use File Content
        (if using Business uncheck Searchable)

        click the "+" sign and Select THETIME
        Set its Value to time.txt
        Check File Name and Use File Content
        (if using Business uncheck Searchable)

        Now with windows explorer go to your Site1 folder and right click runact.bat
        and drag it onto the desktop (using the right button).
        When you drop it onto the desktop choose Create Shortcut(s) Here

        Now right-click that shortcut, choose Properties / Shortcut / Run and select Minimised.

        Now if you use this icon to start Actinic it will update the files date.txt and time.txt and then start Actinic.

        Wherever you want this info to appear on your pages just edit the appropriate Template and
        add the fragment CUSTOMVAR:THEDATE if you want the time to appear then use CUSTOMVAR:THETIME

        Warning: If you put this on a template that's used on every page then ALL your pages will
        need to be reloaded whenever the date or time changes. Use a separate Primary template for the pages
        you want thie dat/time on to avoid this.

        Norman
        Norman - www.drillpine.biz
        Edinburgh, U K / Bitez, Turkey

        Comment


          #5
          Thanks Norman
          I appreciate the information on creating and selecting a custom variable. I am comfortable with creating and using batch files. I will give this a try when I have sorted out my other problem(s) with the site.

          Stephen

          Comment

          Working...
          X