Demo Discussion
Forum Config Examples Contributions Vulnerabilities
  Discussion forum about ELOG  Not logged in ELOG logo
icon1.gif   today date in template, posted by Stefano Lacaprara on Mon Apr 8 10:49:10 2024 
    icon2.gif   Re: today date in template, posted by Stefan Ritt on Mon Apr 8 11:27:09 2024 
       icon2.gif   Re: today date in template, posted by Konstantin Olchanski on Tue Apr 9 04:50:28 2024 
          icon2.gif   Re: today date in template, posted by David Pilgram on Tue Apr 9 13:49:51 2024 
Message ID: 69781     Entry time: Tue Apr 9 13:49:51 2024     In reply to: 69778
Icon: Reply  Author: David Pilgram  Author Email: David.Pilgram@epost.org.uk 
Category: Question  OS: Linux  ELOG Version: ELOG V3.1.4-395 
Subject: Re: today date in template 
This was given to me by Andreas Luedeke of this parish. 

In my elog.cfg file, I have the following:

Preset text = $shell(date '+[%d %b %y]')\n

and this puts at the top of every new thread I make today the following line

[09 Apr 24]

And for the same result for every reply as well, I have in elog.cfg

Prepend on reply = $shell(date '+[%d %b %y]')\n\n----------\n

with the ten dash characters to show the end of the thread, so the reply entry goes above the dashes.

Obviously time, name of day etc can be included by using the strftime codes.


> > This is a nice idea, but currently no text substations in templates are implemented. It only works in attributes right now.
> 
> but can it be done by javascript injection? load a custom .js or .html file, in this file run javascript code to root down the DOM tree until you 
> find the right place, replace .innerHTML with current date?
> 
> K.O.
ELOG V3.1.5-3fb85fa6