WebSite X5Help Center

 
Torben Ravn
Torben Ravn
User

How install a timestamp to html site into WebsiteX5/pro  en

Author: Torben Ravn
Visited 1343, Followers 1, Shared 0  

How to install time stamp on a page so that each time you upload, the time is automatically inserted "when the website was last updated" Have used it in the front page in the past

___ <Html> <Head> <meta http-equiv = "Content-Language" content = "en"> <meta http-equiv = "Content-Type" content = "text / html; charset = windows-1252"> <title> New Page 1 </title> </ Head> <Body> <p> <font face = "Times New Roman" color = "# 808080"> The site was last updated the <! - web bot bot = "Timestamp" S-Type = "EDITED" S-Format = "% d-% m-% Y" -> </font> </p> </ Body> </ Html> ____

But it doesn't work when you put it on a pure html page

Please help !

Posted on the
2 ANSWERS - 2 USEFUL
Paul M.
Paul M.
Moderator

Hello Torben,

FrontPage webbots won't work in WebSite X5...  they'll only work with FrontPage.

So you'd need to use an alternative method to display the time (and/or date).

WebSite X5 has good support for PHP, so that would be an excellent choice in my opinion.

You could use code such as the following:

<?php
$file = $_SERVER["SCRIPT_NAME"];
$break = Explode('/', $file);
$pfile = $break[count($break) - 1];
//echo $pfile;
echo "This page was last modified on " .date("d F Y g:ia",filemtime($pfile));
?>

That code's not my own: it's freely available on the internet.

Put the code inside an HTML Object on any page, or you could also use the Expert tab on any Page Properties to insert it.

Then just ensure your page file extension is set to .php, again using the Page Properties.

The code works fine...  I checked it before posting.

Hope this helps.

Kind regards,

Paul

Search the WebSite X5 Help Center

Read more
Posted on the from Paul M.
 ‪ KolAsim ‪ ‪
 ‪ KolAsim ‪ ‪
Moderator

(It> En) ... in addition to Paul's excellent suggestion...

... in an HTML Code Object:
... paste or type:
[NOW]   ... x the date of publication / update

-----JS------------------------------------
... or, x the date of publication / update, paste or type this code JS:
<script> document.write (document.lastModified); </ script>

------PHP----------------------------------
... or, x the date of publication / update on the server side, paste or type this PHP code on page with PHP extension:
<?php echo date("Y-m-d | h:i:sa", getlastmod()); ?>

.

ciao

.

Read more
Posted on the from  ‪ KolAsim ‪ ‪